Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbbert committed Dec 11, 2024
2 parents 8f1f45e + 3bd3ca7 commit 40ceed9
Show file tree
Hide file tree
Showing 13 changed files with 479 additions and 376 deletions.
22 changes: 14 additions & 8 deletions src/mame/homebrew/zexall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@
Ram 0000-FFFF (preloaded with binary)
Special calls take place for three ram values (this interface was designed by kevtris):
FFFD - 'ack' - shared ram with output device; z80 reads from here and considers the byte at FFFF read if this value incremented
FFFE - 'req' - shared ram with output device; z80 writes an incrementing value to FFFE to indicate that there is a byte waiting at FFFF
and hence requesting the output device on the other end do something about it, until FFFD is incremented by the
output device to acknowledge receipt
FFFD - 'ack' - shared ram with output device; z80 reads from here and considers
the byte at FFFF read if this value incremented
FFFE - 'req' - shared ram with output device; z80 writes an incrementing value
to FFFE to indicate that there is a byte waiting at FFFF and hence
requesting the output device on the other end do something about it,
until FFFD is incremented by the output device to acknowledge receipt
FFFF - 'data' - shared ram with output device; z80 writes the data to be sent to output device here
One i/o port is used, but left unemulated:
0001 - bit 0 controls whether interrupt timer is enabled (1) or not (0), this is a holdover from a project of kevtris' and can be ignored.
0001 - bit 0 controls whether interrupt timer is enabled (1) or not (0),
this is a holdover from a project of kevtris' and can be ignored.
******************************************************************************/

#include "emu.h"

#include "cpu/z80/z80.h"
#include "machine/terminal.h"

Expand All @@ -43,6 +48,10 @@ class zexall_state : public driver_device

void zexall(machine_config &config);

protected:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;

private:
uint8_t output_ack_r();
uint8_t output_req_r();
Expand All @@ -60,9 +69,6 @@ class zexall_state : public driver_device
uint8_t m_out_req = 0U; // byte written to 0xFFFE
uint8_t m_out_req_last = 0U; // old value at 0xFFFE before the most recent write
uint8_t m_out_ack = 0U; // byte written to 0xFFFC

virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
};


Expand Down
83 changes: 47 additions & 36 deletions src/mame/irem/m92.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(m92_state::scanline_interrupt)
{
m_upd71059c->ir0_w(0);
}

}
}

Expand Down Expand Up @@ -300,15 +299,15 @@ void m92_state::sound_reset_w(uint16_t data)

void m92_state::m92_base_map(address_map &map)
{
map(0xe0000, 0xeffff).ram(); /* System ram */
map(0xe0000, 0xeffff).ram(); // System ram
map(0xf8000, 0xf87ff).ram().share("spriteram");
map(0xf8800, 0xf8fff).rw(FUNC(m92_state::paletteram_r), FUNC(m92_state::paletteram_w));
map(0xf9000, 0xf900f).w(FUNC(m92_state::spritecontrol_w)).share("spritecontrol");
map(0xf9800, 0xf9801).w(FUNC(m92_state::videocontrol_w));
map(0xffff0, 0xfffff).rom().region("maincpu", 0x7fff0);
}

/* appears to be an earlier board */
// appears to be an earlier board
void m92_state::lethalth_map(address_map &map)
{
m92_base_map(map);
Expand All @@ -320,7 +319,7 @@ void m92_state::m92_map(address_map &map)
{
m92_base_map(map);
map(0x00000, 0xbffff).rom();
map(0xc0000, 0xcffff).rom().region("maincpu", 0x00000); /* Mirror used by In The Hunt as protection */
map(0xc0000, 0xcffff).rom().region("maincpu", 0x00000); // Mirror used by In The Hunt as protection
map(0xd0000, 0xdffff).ram().w(FUNC(m92_state::vram_w)).share("vram_data");
}

Expand All @@ -329,17 +328,27 @@ void m92_state::m92_banked_map(address_map &map)
m92_base_map(map);
map(0x00000, 0x9ffff).rom();
map(0xa0000, 0xbffff).bankr("mainbank");
map(0xc0000, 0xcffff).rom().region("maincpu", 0x00000); /* Mirror used by In The Hunt as protection */
map(0xc0000, 0xcffff).rom().region("maincpu", 0x00000); // Mirror used by In The Hunt as protection
map(0xd0000, 0xdffff).ram().w(FUNC(m92_state::vram_w)).share("vram_data");
}

/* This game has an eeprom on the game board */
// This game has an eeprom on the game board
void m92_state::majtitl2_map(address_map &map)
{
m92_banked_map(map);
map(0xf0000, 0xf3fff).rw("eeprom", FUNC(eeprom_parallel_28xx_device::read), FUNC(eeprom_parallel_28xx_device::write)).umask16(0x00ff);
}

void m92_state::nbbatman2bl_map(address_map &map)
{
m92_banked_map(map);

// disable for now, it has different sprite hardware
map(0xf8000, 0xf87ff).unmaprw();
map(0xf9000, 0xf900f).unmapw();
map(0xf9800, 0xf9801).unmapw();
}

void m92_state::m92_portmap(address_map &map)
{
map(0x00, 0x00).w("soundlatch", FUNC(generic_latch_8_device::write));
Expand All @@ -348,7 +357,7 @@ void m92_state::m92_portmap(address_map &map)
map(0x02, 0x02).w(FUNC(m92_state::coincounter_w));
map(0x04, 0x05).portr("DSW");
map(0x06, 0x07).portr("P3_P4");
map(0x08, 0x08).r("soundlatch2", FUNC(generic_latch_8_device::read)); // answer from sound CPU
map(0x08, 0x08).r("soundlatch2", FUNC(generic_latch_8_device::read)); // answer from sound CPU
map(0x40, 0x43).rw(m_upd71059c, FUNC(pic8259_device::read), FUNC(pic8259_device::write)).umask16(0x00ff);
map(0x80, 0x87).w(FUNC(m92_state::pf_control_w<0>));
map(0x88, 0x8f).w(FUNC(m92_state::pf_control_w<1>));
Expand Down Expand Up @@ -424,7 +433,7 @@ static INPUT_PORTS_START( m92_2player )
PORT_DIPUNKNOWN_DIPLOC( 0x8000, 0x8000, "SW3:8" )

PORT_START("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPUNKNOWN_DIPLOC( 0x0001, 0x0001, "SW1:1" )
PORT_DIPUNKNOWN_DIPLOC( 0x0002, 0x0002, "SW1:2" )
PORT_DIPUNKNOWN_DIPLOC( 0x0004, 0x0004, "SW1:3" )
Expand All @@ -437,7 +446,7 @@ static INPUT_PORTS_START( m92_2player )
PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" )
/* Dip switch bank 2 */
/* DIP switch bank 2 */
PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1")
PORT_DIPSETTING( 0x0100, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
Expand Down Expand Up @@ -490,10 +499,10 @@ INPUT_PORTS_END
static INPUT_PORTS_START( bmaster )
PORT_INCLUDE(m92_2player)

/* Game manual specificly mentions dip switch bank 3 is unused */
/* Game manual specificly mentions DIP switch bank 3 is unused */

PORT_MODIFY("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x0000, "1" )
PORT_DIPSETTING( 0x0003, "2" )
Expand All @@ -514,7 +523,7 @@ static INPUT_PORTS_START( gunforce )
PORT_INCLUDE(m92_2player)

PORT_MODIFY("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x0002, "2" )
PORT_DIPSETTING( 0x0003, "3" )
Expand All @@ -535,15 +544,15 @@ static INPUT_PORTS_START( lethalth )
PORT_INCLUDE(m92_2player)

PORT_MODIFY("COINS_DSW3")
/* Dip switch bank 3 */
/* DIP switch bank 3 */
PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW3:1,2")
PORT_DIPSETTING( 0x0200, "500K & 1M" )
PORT_DIPSETTING( 0x0300, "700K & 1.5M" )
PORT_DIPSETTING( 0x0000, "700K, 1.5M, 3M & 4.5M" )
PORT_DIPSETTING( 0x0100, "1M & 2M" )

PORT_MODIFY("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x0002, "2" )
PORT_DIPSETTING( 0x0003, "3" )
Expand All @@ -564,7 +573,7 @@ static INPUT_PORTS_START( thndblst )
PORT_INCLUDE(lethalth)

PORT_MODIFY("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0010, 0x0000, "Continuous Play" ) PORT_DIPLOCATION("SW1:5") /* manual says Unused */
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPSETTING( 0x0010, DEF_STR( Off ) )
Expand All @@ -575,7 +584,7 @@ static INPUT_PORTS_START( hook )
PORT_INCLUDE(m92_4player)

PORT_MODIFY("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x0000, "1" )
PORT_DIPSETTING( 0x0003, "2" )
Expand All @@ -597,7 +606,7 @@ static INPUT_PORTS_START( majtitl2 )
PORT_INCLUDE(m92_4player)

PORT_MODIFY("COINS_DSW3")
/* Dip switch bank 3 */
/* DIP switch bank 3 */
PORT_DIPNAME( 0x0100, 0x0100, "Ticket Dispenser" ) PORT_DIPLOCATION("SW3:1")
PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) /* "Ticket payout function is not working now" will be shown on screen */
PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) /* Stored data is shown on screen with the option to clear data */
Expand All @@ -615,12 +624,12 @@ static INPUT_PORTS_START( majtitl2 )
PORT_DIPSETTING( 0x0000, "DL 4SS" )

PORT_MODIFY("DSW")
/* Dip switch bank 2 */
/* DIP switch bank 2 */
PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:2")
PORT_DIPSETTING( 0x0200, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Cocktail ) )

/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0001, 0x0001, "Given Holes/Stroke Play" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x0000, "1" )
PORT_DIPSETTING( 0x0001, "2" )
Expand All @@ -646,7 +655,7 @@ static INPUT_PORTS_START( mysticri )
PORT_INCLUDE(m92_2player)

PORT_MODIFY("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x0002, "2" )
PORT_DIPSETTING( 0x0003, "3" )
Expand All @@ -667,7 +676,7 @@ static INPUT_PORTS_START( uccops )
PORT_INCLUDE(m92_3player)

PORT_MODIFY("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0003, 0x0002, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x0000, "1" )
PORT_DIPSETTING( 0x0003, "2" )
Expand All @@ -690,7 +699,7 @@ static INPUT_PORTS_START( rtypeleo )
PORT_INCLUDE(m92_2player)

PORT_MODIFY("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x0002, "2" )
PORT_DIPSETTING( 0x0003, "3" )
Expand All @@ -708,7 +717,7 @@ static INPUT_PORTS_START( inthunt )
PORT_INCLUDE(m92_2player)

PORT_MODIFY("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x0002, "2" )
PORT_DIPSETTING( 0x0003, "3" )
Expand All @@ -729,7 +738,7 @@ static INPUT_PORTS_START( nbbatman )
PORT_INCLUDE(m92_4player)

PORT_MODIFY("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x0000, "1" )
PORT_DIPSETTING( 0x0003, "2" )
Expand All @@ -753,7 +762,7 @@ static INPUT_PORTS_START( psoldier )
IREM_GENERIC_JOYSTICKS_3_BUTTONS(1, 2)

PORT_MODIFY("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0020, 0x0000, "Any Button to Start" ) PORT_DIPLOCATION("SW1:6")
PORT_DIPSETTING( 0x0020, DEF_STR( No ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) )
Expand All @@ -772,18 +781,18 @@ INPUT_PORTS_END

static INPUT_PORTS_START( dsoccr94j )
PORT_INCLUDE(m92_4player)
/* Dip Switch 2, dip 2 is listed as "Don't Change" and is "OFF" */
/* DIP Switch 2, dip 2 is listed as "Don't Change" and is "OFF" */

PORT_MODIFY("COINS_DSW3")
/* Dip switch bank 3 */
/* DIP switch bank 3 */
PORT_DIPNAME( 0x0300, 0x0300, "Player Power" ) PORT_DIPLOCATION("SW3:1,2")
PORT_DIPSETTING( 0x0000, "500" )
PORT_DIPSETTING( 0x0300, "1000" )
PORT_DIPSETTING( 0x0100, "1500" )
PORT_DIPSETTING( 0x0200, "2000" )

PORT_MODIFY("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0003, 0x0003, "Time" ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x0000, "1:30" )
PORT_DIPSETTING( 0x0003, "2:00" )
Expand All @@ -798,11 +807,11 @@ static INPUT_PORTS_START( dsoccr94j )
PORT_DIPSETTING( 0x0010, "Match Mode" )
PORT_DIPSETTING( 0x0000, "Power Mode" )
/*
Match Mode: Winner advances to the next game. Game Over for the loser
Power Mode: The Players can play the game until their respective powers run
out, reguardless of whether they win or lose the game.
Player 2 can join in any time during the game
Player power (time) can be adjusted by dip switch #3
Match Mode: Winner advances to the next game. Game Over for the loser
Power Mode: The Players can play the game until their respective powers run
out, reguardless of whether they win or lose the game.
Player 2 can join in any time during the game
Player power (time) can be adjusted by DIP switch #3
*/
PORT_DIPNAME( 0x0020, 0x0020, "Starting Button" ) PORT_DIPLOCATION("SW1:6")
PORT_DIPSETTING( 0x0000, "Button 1" )
Expand All @@ -814,7 +823,7 @@ static INPUT_PORTS_START( gunforc2 )
PORT_INCLUDE(m92_2player)

PORT_MODIFY("DSW")
/* Dip switch bank 1 */
/* DIP switch bank 1 */
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x0002, "3" )
PORT_DIPSETTING( 0x0003, "2" )
Expand Down Expand Up @@ -897,8 +906,8 @@ static const gfx_layout bootleg_spritelayout =


static GFXDECODE_START( gfx_bootleg )
GFXDECODE_ENTRY( "gfx1", 0, bootleg_charlayout, 0x400, 128 )
GFXDECODE_ENTRY( "gfx2", 0, bootleg_spritelayout, 0x400, 128 )
GFXDECODE_ENTRY( "gfx1", 0, bootleg_charlayout, 0, 128 )
GFXDECODE_ENTRY( "gfx2", 0, bootleg_spritelayout, 0, 128 )
GFXDECODE_END


Expand Down Expand Up @@ -1071,6 +1080,8 @@ void m92_state::nbbatman2bl(machine_config &config)
config.device_remove("ymsnd");
config.device_remove("irem");

m_maincpu->set_addrmap(AS_PROGRAM, &m92_state::nbbatman2bl_map);

m_gfxdecode->set_info(gfx_bootleg);

/* 8951 MCU as sound CPU */
Expand Down
10 changes: 6 additions & 4 deletions src/mame/irem/m92.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@
#include "machine/timer.h"
#include "sound/okim6295.h"
#include "video/bufsprite.h"

#include "emupal.h"
#include "screen.h"
#include "tilemap.h"

struct M92_pf_layer_info
{
tilemap_t * tmap = nullptr;
tilemap_t * wide_tmap = nullptr;
uint16_t vram_base = 0;
uint16_t control[4]{};
tilemap_t *tmap = nullptr;
tilemap_t *wide_tmap = nullptr;
uint16_t vram_base = 0;
uint16_t control[4]{};
};

class m92_state : public driver_device
Expand Down Expand Up @@ -126,6 +127,7 @@ class m92_state : public driver_device
void m92_base_map(address_map &map) ATTR_COLD;
void m92_portmap(address_map &map) ATTR_COLD;
void majtitl2_map(address_map &map) ATTR_COLD;
void nbbatman2bl_map(address_map &map) ATTR_COLD;
void ppan_portmap(address_map &map) ATTR_COLD;
void sound_map(address_map &map) ATTR_COLD;

Expand Down
Loading

0 comments on commit 40ceed9

Please sign in to comment.