mirror of
https://github.com/holub/mame
synced 2025-04-25 09:50:04 +03:00
Revert "acommand.cpp, cischeat.cpp, megasys1.cpp : Minor cleanups, Reduce duplicates, Reduce runtime tag lookups (#3422)"
This reverts commit 0e36acd53b
.
This commit is contained in:
parent
4016d92828
commit
98702ac870
@ -72,15 +72,16 @@ class acommand_state : public driver_device
|
||||
{
|
||||
public:
|
||||
acommand_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_spriteram(*this, "spriteram")
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_oki(*this, "oki%u", 1U)
|
||||
, m_gfxdecode(*this, "gfxdecode")
|
||||
, m_palette(*this, "palette")
|
||||
, m_bgtmap(*this, "bgtmap")
|
||||
, m_txtmap(*this, "txtmap")
|
||||
, m_digits(*this, "digit%u", 0U)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_oki1(*this, "oki1"),
|
||||
m_oki2(*this, "oki2"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette"),
|
||||
m_bgtmap(*this, "bgtmap"),
|
||||
m_txtmap(*this, "txtmap"),
|
||||
m_digits(*this, "digit%u", 0U)
|
||||
{ }
|
||||
|
||||
DECLARE_WRITE8_MEMBER(oki_bank_w);
|
||||
@ -108,7 +109,8 @@ protected:
|
||||
private:
|
||||
required_shared_ptr<uint16_t> m_spriteram;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device_array<okim6295_device, 2> m_oki;
|
||||
required_device<okim6295_device> m_oki1;
|
||||
required_device<okim6295_device> m_oki2;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<megasys1_tilemap_device> m_bgtmap;
|
||||
@ -220,8 +222,8 @@ WRITE16_MEMBER(acommand_state::ac_unk2_w)
|
||||
|
||||
WRITE8_MEMBER(acommand_state::oki_bank_w)
|
||||
{
|
||||
m_oki[0]->set_rom_bank(data & 0x3);
|
||||
m_oki[1]->set_rom_bank((data & 0x30) >> 4);
|
||||
m_oki1->set_rom_bank(data & 0x3);
|
||||
m_oki2->set_rom_bank((data & 0x30) >> 4);
|
||||
}
|
||||
|
||||
|
||||
@ -339,8 +341,8 @@ void acommand_state::acommand_map(address_map &map)
|
||||
|
||||
map(0x100001, 0x100001).w(this, FUNC(acommand_state::oki_bank_w));
|
||||
map(0x100008, 0x100009).portr("IN0").w(this, FUNC(acommand_state::output_lamps_w));
|
||||
map(0x100014, 0x100017).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x100018, 0x10001b).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x100014, 0x100017).rw(m_oki1, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x100018, 0x10001b).rw(m_oki2, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
|
||||
map(0x100040, 0x100041).rw(this, FUNC(acommand_state::ext_devices_0_r), FUNC(acommand_state::ext_devices_0_w));
|
||||
map(0x100044, 0x100045).rw(this, FUNC(acommand_state::ext_devices_1_r), FUNC(acommand_state::ext_devices_1_w));
|
||||
@ -442,10 +444,12 @@ static const gfx_layout tilelayout =
|
||||
16,16,
|
||||
RGN_FRAC(1,1),
|
||||
4,
|
||||
{ STEP4(0,1) },
|
||||
{ STEP8(0,4), STEP8(4*8*16,4) },
|
||||
{ STEP16(0,4*8) },
|
||||
16*16*4
|
||||
{ 0, 1, 2, 3 },
|
||||
{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
|
||||
16*32+0*4, 16*32+1*4, 16*32+2*4, 16*32+3*4, 16*32+4*4, 16*32+5*4, 16*32+6*4, 16*32+7*4 },
|
||||
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
|
||||
8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 },
|
||||
32*32
|
||||
};
|
||||
|
||||
static GFXDECODE_START( acommand )
|
||||
|
@ -566,10 +566,13 @@ WRITE16_MEMBER(cischeat_state::scudhamm_enable_w)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(cischeat_state::scudhamm_oki_bank_w)
|
||||
WRITE16_MEMBER(cischeat_state::scudhamm_oki_bank_w)
|
||||
{
|
||||
m_oki[0]->set_rom_bank((data >> 0) & 0x3);
|
||||
m_oki[1]->set_rom_bank((data >> 4) & 0x3);
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
m_oki1->set_rom_bank((data >> 0) & 0x3);
|
||||
m_oki2->set_rom_bank((data >> 4) & 0x3);
|
||||
}
|
||||
}
|
||||
|
||||
void cischeat_state::scudhamm_map(address_map &map)
|
||||
@ -583,10 +586,10 @@ void cischeat_state::scudhamm_map(address_map &map)
|
||||
map(0x0b0000, 0x0b3fff).ram().w("scroll2", FUNC(megasys1_tilemap_device::write)).share("scroll2"); // Scroll RAM 2
|
||||
map(0x0b8000, 0x0bffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0x0f0000, 0x0fffff).ram().share("ram"); // Work RAM + Spriteram
|
||||
map(0x100001, 0x100001).w(this, FUNC(cischeat_state::scudhamm_oki_bank_w)); // Sound
|
||||
map(0x100000, 0x100001).w(this, FUNC(cischeat_state::scudhamm_oki_bank_w)); // Sound
|
||||
map(0x100008, 0x100009).portr("IN0").w(this, FUNC(cischeat_state::scudhamm_leds_w)); // Buttons
|
||||
map(0x100015, 0x100015).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Sound
|
||||
map(0x100019, 0x100019).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); //
|
||||
map(0x100015, 0x100015).rw(m_oki1, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Sound
|
||||
map(0x100019, 0x100019).rw(m_oki2, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); //
|
||||
map(0x10001c, 0x10001d).w(this, FUNC(cischeat_state::scudhamm_enable_w)); // ?
|
||||
map(0x100040, 0x100041).r(this, FUNC(cischeat_state::scudhamm_analog_r)).nopw(); // A / D
|
||||
map(0x100044, 0x100045).r(this, FUNC(cischeat_state::scudhamm_motor_pos_r)); // Motor Position
|
||||
@ -668,14 +671,13 @@ void cischeat_state::armchmp2_map(address_map &map)
|
||||
map(0x0b0000, 0x0b7fff).ram().w("scroll2", FUNC(megasys1_tilemap_device::write)).share("scroll2"); // Scroll ram 2
|
||||
map(0x0b8000, 0x0bffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0x0f0000, 0x0fffff).ram().share("ram"); // Work RAM + Spriteram
|
||||
map(0x100000, 0x100001).portr("IN2") // DSW
|
||||
map(0x100001, 0x100001).w(this, FUNC(cischeat_state::scudhamm_oki_bank_w)); // Sound
|
||||
map(0x100000, 0x100001).portr("IN2").w(this, FUNC(cischeat_state::scudhamm_oki_bank_w)); // DSW + Sound
|
||||
map(0x100004, 0x100005).portr("IN3"); // DSW
|
||||
map(0x100008, 0x100009).rw(this, FUNC(cischeat_state::armchmp2_buttons_r), FUNC(cischeat_state::armchmp2_leds_w)); // Leds + Coin Counters + Buttons + Sensors
|
||||
map(0x10000c, 0x10000d).r(this, FUNC(cischeat_state::armchmp2_analog_r)).nopw(); // A / D
|
||||
map(0x100010, 0x100011).rw(this, FUNC(cischeat_state::armchmp2_motor_status_r), FUNC(cischeat_state::armchmp2_motor_command_w)); // Motor Limit Switches?
|
||||
map(0x100015, 0x100015).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Sound
|
||||
map(0x100019, 0x100019).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); //
|
||||
map(0x100015, 0x100015).rw(m_oki1, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Sound
|
||||
map(0x100019, 0x100019).rw(m_oki2, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); //
|
||||
}
|
||||
|
||||
|
||||
@ -707,8 +709,8 @@ WRITE16_MEMBER(cischeat_state::captflag_oki_bank_w)
|
||||
{
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
m_oki_bank[0]->set_entry(((data >> 0) + 1) & 0x7);
|
||||
m_oki_bank[1]->set_entry(((data >> 4) + 1) & 0x7);
|
||||
m_oki1_bank->set_entry(((data >> 0) + 1) & 0x7);
|
||||
m_oki2_bank->set_entry(((data >> 4) + 1) & 0x7);
|
||||
}
|
||||
}
|
||||
|
||||
@ -817,8 +819,8 @@ void cischeat_state::captflag_map(address_map &map)
|
||||
map(0x0f0000, 0x0fffff).ram().share("ram"); // Work RAM + Spriteram
|
||||
map(0x100000, 0x100001).portr("SW1_2").w(this, FUNC(cischeat_state::captflag_oki_bank_w)); // 2 x DSW + Sound
|
||||
map(0x100008, 0x100009).portr("Buttons").w(this, FUNC(cischeat_state::captflag_leds_w)); // Buttons + Leds
|
||||
map(0x100015, 0x100015).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Sound
|
||||
map(0x100019, 0x100019).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); //
|
||||
map(0x100015, 0x100015).rw(m_oki1, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Sound
|
||||
map(0x100019, 0x100019).rw(m_oki2, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); //
|
||||
map(0x10001c, 0x10001d).w(this, FUNC(cischeat_state::scudhamm_enable_w)); // ?
|
||||
map(0x100040, 0x100041).portr("SW01"); // DSW + Motor
|
||||
map(0x100044, 0x100045).w(this, FUNC(cischeat_state::captflag_motor_command_left_w)); // Motor Command (Left)
|
||||
@ -932,20 +934,23 @@ void cischeat_state::f1gpstar_map3(address_map &map)
|
||||
Big Run
|
||||
**************************************************************************/
|
||||
|
||||
WRITE8_MEMBER(cischeat_state::bigrun_soundbank_w)
|
||||
WRITE16_MEMBER(cischeat_state::bigrun_soundbank_w)
|
||||
{
|
||||
m_oki[0]->set_rom_bank((data >> 0) & 1);
|
||||
m_oki[1]->set_rom_bank((data >> 4) & 1);
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
m_oki1->set_rom_bank((data >> 0) & 1);
|
||||
m_oki2->set_rom_bank((data >> 4) & 1);
|
||||
}
|
||||
}
|
||||
|
||||
void cischeat_state::bigrun_sound_map(address_map &map)
|
||||
{
|
||||
map(0x000000, 0x03ffff).rom(); // ROM
|
||||
map(0x040001, 0x040001).r(m_soundlatch, FUNC(generic_latch_16_device::read)).w(this, FUNC(cischeat_state::bigrun_soundbank_w)); // From Main CPU
|
||||
map(0x040000, 0x040001).r(m_soundlatch, FUNC(generic_latch_16_device::read)).w(this, FUNC(cischeat_state::bigrun_soundbank_w)); // From Main CPU
|
||||
map(0x060000, 0x060001).w(m_soundlatch2, FUNC(generic_latch_16_device::write)); // To Main CPU
|
||||
map(0x080000, 0x080003).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff);
|
||||
map(0x0a0000, 0x0a0003).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0c0000, 0x0c0003).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0a0000, 0x0a0003).rw(m_oki1, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0c0000, 0x0c0003).rw(m_oki2, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0f0000, 0x0fffff).ram(); // RAM
|
||||
}
|
||||
|
||||
@ -954,22 +959,26 @@ void cischeat_state::bigrun_sound_map(address_map &map)
|
||||
Cisco Heat
|
||||
**************************************************************************/
|
||||
|
||||
template<int Chip>
|
||||
WRITE8_MEMBER(cischeat_state::cischeat_soundbank_w)
|
||||
WRITE16_MEMBER(cischeat_state::cischeat_soundbank_1_w)
|
||||
{
|
||||
m_oki[Chip]->set_rom_bank(data & 1);
|
||||
if (ACCESSING_BITS_0_7) m_oki1->set_rom_bank(data & 1);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(cischeat_state::cischeat_soundbank_2_w)
|
||||
{
|
||||
if (ACCESSING_BITS_0_7) m_oki2->set_rom_bank(data & 1);
|
||||
}
|
||||
|
||||
void cischeat_state::cischeat_sound_map(address_map &map)
|
||||
{
|
||||
map(0x000000, 0x03ffff).rom(); // ROM
|
||||
map(0x040003, 0x040003).w(this, FUNC(cischeat_state::cischeat_soundbank_w<0>)); // Sample Banking
|
||||
map(0x040005, 0x040005).w(this, FUNC(cischeat_state::cischeat_soundbank_w<1>)); // Sample Banking
|
||||
map(0x040002, 0x040003).w(this, FUNC(cischeat_state::cischeat_soundbank_1_w)); // Sample Banking
|
||||
map(0x040004, 0x040005).w(this, FUNC(cischeat_state::cischeat_soundbank_2_w)); // Sample Banking
|
||||
map(0x060002, 0x060003).w(m_soundlatch2, FUNC(generic_latch_16_device::write)); // To Main CPU
|
||||
map(0x060004, 0x060005).r(m_soundlatch, FUNC(generic_latch_16_device::read)); // From Main CPU
|
||||
map(0x080000, 0x080003).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff);
|
||||
map(0x0a0000, 0x0a0003).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0c0000, 0x0c0003).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0a0000, 0x0a0003).rw(m_oki1, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0c0000, 0x0c0003).rw(m_oki2, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0f0000, 0x0fffff).ram(); // RAM
|
||||
}
|
||||
|
||||
@ -981,12 +990,12 @@ void cischeat_state::cischeat_sound_map(address_map &map)
|
||||
void cischeat_state::f1gpstar_sound_map(address_map &map)
|
||||
{
|
||||
map(0x000000, 0x03ffff).rom(); // ROM
|
||||
map(0x040005, 0x040005).w(this, FUNC(cischeat_state::cischeat_soundbank_w<0>)); // Sample Banking (cischeat: 40002)
|
||||
map(0x040009, 0x040009).w(this, FUNC(cischeat_state::cischeat_soundbank_w<1>)); // Sample Banking (cischeat: 40004)
|
||||
map(0x040004, 0x040005).w(this, FUNC(cischeat_state::cischeat_soundbank_1_w)); // Sample Banking (cischeat: 40002)
|
||||
map(0x040008, 0x040009).w(this, FUNC(cischeat_state::cischeat_soundbank_2_w)); // Sample Banking (cischeat: 40004)
|
||||
map(0x060000, 0x060001).r(m_soundlatch, FUNC(generic_latch_16_device::read)).w(m_soundlatch2, FUNC(generic_latch_16_device::write)); // From Main CPU (cischeat: 60004)
|
||||
map(0x080000, 0x080003).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff);
|
||||
map(0x0a0000, 0x0a0003).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0c0000, 0x0c0003).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0a0000, 0x0a0003).rw(m_oki1, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0c0000, 0x0c0003).rw(m_oki2, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0e0000, 0x0fffff).ram(); // RAM (cischeat: f0000-fffff)
|
||||
}
|
||||
|
||||
@ -998,14 +1007,14 @@ void cischeat_state::f1gpstar_sound_map(address_map &map)
|
||||
void cischeat_state::f1gpstr2_sound_map(address_map &map)
|
||||
{
|
||||
map(0x000000, 0x03ffff).rom(); // ROM
|
||||
map(0x040005, 0x040005).w(this, FUNC(cischeat_state::cischeat_soundbank_w<0>)); // Sample Banking
|
||||
map(0x040009, 0x040009).w(this, FUNC(cischeat_state::cischeat_soundbank_w<1>)); // Sample Banking
|
||||
map(0x040004, 0x040005).w(this, FUNC(cischeat_state::cischeat_soundbank_1_w)); // Sample Banking
|
||||
map(0x040008, 0x040009).w(this, FUNC(cischeat_state::cischeat_soundbank_2_w)); // Sample Banking
|
||||
map(0x04000e, 0x04000f).nopw(); // ? 0 (f1gpstar: no)
|
||||
map(0x060002, 0x060003).w(m_soundlatch2, FUNC(generic_latch_16_device::write)); // To Main CPU
|
||||
map(0x060004, 0x060005).r(m_soundlatch, FUNC(generic_latch_16_device::read)); // From Main CPU
|
||||
map(0x080000, 0x080003).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff);
|
||||
map(0x0a0000, 0x0a0003).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0c0000, 0x0c0003).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0a0000, 0x0a0003).rw(m_oki1, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0c0000, 0x0c0003).rw(m_oki2, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0e0000, 0x0fffff).ram(); // RAM
|
||||
}
|
||||
|
||||
@ -3606,8 +3615,8 @@ ROM_END
|
||||
|
||||
DRIVER_INIT_MEMBER(cischeat_state, captflag)
|
||||
{
|
||||
m_oki_bank[0]->configure_entries(0, 0x100000 / 0x20000, memregion("oki1")->base(), 0x20000);
|
||||
m_oki_bank[1]->configure_entries(0, 0x100000 / 0x20000, memregion("oki2")->base(), 0x20000);
|
||||
m_oki1_bank->configure_entries(0, 0x100000 / 0x20000, memregion("oki1")->base(), 0x20000);
|
||||
m_oki2_bank->configure_entries(0, 0x100000 / 0x20000, memregion("oki2")->base(), 0x20000);
|
||||
}
|
||||
|
||||
|
||||
|
@ -212,7 +212,7 @@ void megasys1_state::megasys1Z_map(address_map &map)
|
||||
map(0x084200, 0x084205).w("scroll0", FUNC(megasys1_tilemap_device::scroll_w));
|
||||
map(0x084208, 0x08420d).w("scroll1", FUNC(megasys1_tilemap_device::scroll_w));
|
||||
map(0x084300, 0x084301).w(this, FUNC(megasys1_state::screen_flag_w));
|
||||
map(0x084308, 0x084309).w(m_soundlatch_z, FUNC(generic_latch_8_device::write)).umask16(0x00ff).cswidth(16);
|
||||
map(0x084308, 0x084309).w(this, FUNC(megasys1_state::soundlatch_z_w));
|
||||
map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
|
||||
map(0x08e000, 0x08ffff).ram().share("objectram");
|
||||
map(0x090000, 0x093fff).ram().w("scroll0", FUNC(megasys1_tilemap_device::write)).share("scroll0");
|
||||
@ -228,7 +228,7 @@ void megasys1_state::megasys1A_map(address_map &map)
|
||||
map(0x084000, 0x084001).w(this, FUNC(megasys1_state::active_layers_w));
|
||||
map(0x084008, 0x08400d).w("scroll2", FUNC(megasys1_tilemap_device::scroll_w));
|
||||
map(0x084100, 0x084101).rw(this, FUNC(megasys1_state::sprite_flag_r), FUNC(megasys1_state::sprite_flag_w));
|
||||
map(0x084308, 0x084309).w(m_soundlatch, FUNC(generic_latch_16_device::write));
|
||||
map(0x084308, 0x084309).w(this, FUNC(megasys1_state::soundlatch_w));
|
||||
map(0x098000, 0x09bfff).ram().w("scroll2", FUNC(megasys1_tilemap_device::write)).share("scroll2");
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ void megasys1_state::megasys1B_map(address_map &map)
|
||||
map(0x044200, 0x044205).w("scroll0", FUNC(megasys1_tilemap_device::scroll_w));
|
||||
map(0x044208, 0x04420d).w("scroll1", FUNC(megasys1_tilemap_device::scroll_w));
|
||||
map(0x044300, 0x044301).w(this, FUNC(megasys1_state::screen_flag_w));
|
||||
map(0x044308, 0x044309).w(m_soundlatch, FUNC(generic_latch_16_device::write));
|
||||
map(0x044308, 0x044309).w(this, FUNC(megasys1_state::soundlatch_w));
|
||||
map(0x048000, 0x0487ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
|
||||
map(0x04e000, 0x04ffff).ram().share("objectram");
|
||||
map(0x050000, 0x053fff).ram().w("scroll0", FUNC(megasys1_tilemap_device::write)).share("scroll0");
|
||||
@ -331,7 +331,7 @@ void megasys1_state::megasys1B_edfbl_map(address_map &map)
|
||||
map(0x0e0006, 0x0e0007).portr("P2");
|
||||
map(0x0e0008, 0x0e0009).portr("DSW1");
|
||||
map(0x0e000a, 0x0e000b).portr("DSW2");
|
||||
//map(0x0e000e, 0x0e000f).w(m_soundlatch, FUNC(generic_latch_16_device::write));
|
||||
//AM_RANGE(0x0e000e, 0x0e000f) AM_WRITE(soundlatch_w)
|
||||
}
|
||||
|
||||
void megasys1_state::megasys1B_monkelf_map(address_map &map)
|
||||
@ -380,7 +380,7 @@ void megasys1_state::megasys1C_map(address_map &map)
|
||||
map(0x0c2200, 0x0c2201).rw(this, FUNC(megasys1_state::sprite_flag_r), FUNC(megasys1_state::sprite_flag_w));
|
||||
map(0x0c2208, 0x0c2209).w(this, FUNC(megasys1_state::active_layers_w));
|
||||
map(0x0c2308, 0x0c2309).w(this, FUNC(megasys1_state::screen_flag_w));
|
||||
map(0x0c8000, 0x0c8001).r(m_soundlatch2, FUNC(generic_latch_16_device::read)).w(m_soundlatch, FUNC(generic_latch_16_device::write));
|
||||
map(0x0c8000, 0x0c8001).r(m_soundlatch2, FUNC(generic_latch_16_device::read)).w(this, FUNC(megasys1_state::soundlatch_c_w));
|
||||
map(0x0d2000, 0x0d3fff).ram().share("objectram");
|
||||
map(0x0d8000, 0x0d8001).rw(this, FUNC(megasys1_state::ip_select_r), FUNC(megasys1_state::ip_select_w));
|
||||
// 64th Street actively uses 0xe4*** for breakable objects.
|
||||
@ -416,7 +416,7 @@ void megasys1_state::megasys1D_map(address_map &map)
|
||||
map(0x0e0000, 0x0e0001).portr("DSW");
|
||||
map(0x0e8000, 0x0ebfff).ram().w("scroll0", FUNC(megasys1_tilemap_device::write)).share("scroll0");
|
||||
map(0x0f0000, 0x0f0001).portr("SYSTEM");
|
||||
map(0x0f8001, 0x0f8001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
|
||||
map(0x0f8001, 0x0f8001).rw(m_oki1, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
|
||||
// map(0x100000, 0x100001); // protection
|
||||
map(0x1f0000, 0x1fffff).ram() /*.w(this, FUNC(megasys1_state::ram_w))*/ .share("ram");
|
||||
}
|
||||
@ -484,15 +484,28 @@ void megasys1_state::megasys1D_oki_map(address_map &map)
|
||||
|
||||
*/
|
||||
|
||||
template<int Chip>
|
||||
READ8_MEMBER(megasys1_state::oki_status_r)
|
||||
/* YM2151 IRQ */
|
||||
WRITE_LINE_MEMBER(megasys1_state::sound_irq)
|
||||
{
|
||||
if (state)
|
||||
m_audiocpu->set_input_line(4, HOLD_LINE);
|
||||
}
|
||||
|
||||
READ8_MEMBER(megasys1_state::oki_status_1_r)
|
||||
{
|
||||
if (m_ignore_oki_status == 1)
|
||||
return 0;
|
||||
else
|
||||
return m_oki[Chip]->read_status();
|
||||
return m_oki1->read_status();
|
||||
}
|
||||
|
||||
READ8_MEMBER(megasys1_state::oki_status_2_r)
|
||||
{
|
||||
if (m_ignore_oki_status == 1)
|
||||
return 0;
|
||||
else
|
||||
return m_oki2->read_status();
|
||||
}
|
||||
/***************************************************************************
|
||||
[ Sound CPU - System A ]
|
||||
***************************************************************************/
|
||||
@ -504,10 +517,10 @@ void megasys1_state::megasys1A_sound_map(address_map &map)
|
||||
map(0x040000, 0x040001).r(m_soundlatch, FUNC(generic_latch_16_device::read));
|
||||
map(0x060000, 0x060001).w(m_soundlatch2, FUNC(generic_latch_16_device::write)); // to main cpu
|
||||
map(0x080000, 0x080003).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff);
|
||||
map(0x0a0001, 0x0a0001).r(this, FUNC(megasys1_state::oki_status_r<0>));
|
||||
map(0x0a0000, 0x0a0003).w(m_oki[0], FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0c0001, 0x0c0001).r(this, FUNC(megasys1_state::oki_status_r<1>));
|
||||
map(0x0c0000, 0x0c0003).w(m_oki[1], FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0a0001, 0x0a0001).r(this, FUNC(megasys1_state::oki_status_1_r));
|
||||
map(0x0a0000, 0x0a0003).w(m_oki1, FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0c0001, 0x0c0001).r(this, FUNC(megasys1_state::oki_status_2_r));
|
||||
map(0x0c0000, 0x0c0003).w(m_oki2, FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0e0000, 0x0fffff).ram();
|
||||
}
|
||||
|
||||
@ -517,8 +530,8 @@ void megasys1_state::kickoffb_sound_map(address_map &map)
|
||||
map(0x040000, 0x040001).r(m_soundlatch, FUNC(generic_latch_16_device::read));
|
||||
map(0x060000, 0x060001).w(m_soundlatch2, FUNC(generic_latch_16_device::write)); // to main cpu
|
||||
map(0x080000, 0x080003).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write)).umask16(0x00ff);
|
||||
map(0x0a0001, 0x0a0001).r(this, FUNC(megasys1_state::oki_status_r<0>));
|
||||
map(0x0a0000, 0x0a0003).w(m_oki[0], FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0a0001, 0x0a0001).r(this, FUNC(megasys1_state::oki_status_1_r));
|
||||
map(0x0a0000, 0x0a0003).w(m_oki1, FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0e0000, 0x0fffff).ram();
|
||||
}
|
||||
|
||||
@ -534,10 +547,10 @@ void megasys1_state::megasys1B_sound_map(address_map &map)
|
||||
map(0x040000, 0x040001).r(m_soundlatch, FUNC(generic_latch_16_device::read)).w(m_soundlatch2, FUNC(generic_latch_16_device::write)); /* from/to main cpu */
|
||||
map(0x060000, 0x060001).r(m_soundlatch, FUNC(generic_latch_16_device::read)).w(m_soundlatch2, FUNC(generic_latch_16_device::write)); /* from/to main cpu */
|
||||
map(0x080000, 0x080003).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask16(0x00ff);
|
||||
map(0x0a0001, 0x0a0001).r(this, FUNC(megasys1_state::oki_status_r<0>));
|
||||
map(0x0a0000, 0x0a0003).w(m_oki[0], FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0c0001, 0x0c0001).r(this, FUNC(megasys1_state::oki_status_r<1>));
|
||||
map(0x0c0000, 0x0c0003).w(m_oki[1], FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0a0001, 0x0a0001).r(this, FUNC(megasys1_state::oki_status_1_r));
|
||||
map(0x0a0000, 0x0a0003).w(m_oki1, FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0c0001, 0x0c0001).r(this, FUNC(megasys1_state::oki_status_2_r));
|
||||
map(0x0c0000, 0x0c0003).w(m_oki2, FUNC(okim6295_device::write)).umask16(0x00ff);
|
||||
map(0x0e0000, 0x0effff).ram();
|
||||
}
|
||||
|
||||
@ -1604,7 +1617,7 @@ WRITE16_MEMBER(megasys1_state::protection_peekaboo_w)
|
||||
COMBINE_DATA(&m_protection_val);
|
||||
|
||||
if ((m_protection_val & 0x90) == 0x90)
|
||||
m_okibank->set_entry(m_protection_val & 7);
|
||||
membank("okibank")->set_entry(m_protection_val & 7);
|
||||
|
||||
m_maincpu->set_input_line(4, HOLD_LINE);
|
||||
}
|
||||
@ -1706,12 +1719,10 @@ MACHINE_CONFIG_START(megasys1_state::system_A)
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MCFG_GENERIC_LATCH_16_ADD("soundlatch")
|
||||
MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 4))
|
||||
|
||||
MCFG_GENERIC_LATCH_16_ADD("soundlatch2")
|
||||
|
||||
MCFG_DEVICE_ADD("ymsnd", YM2151, SOUND_CPU_CLOCK/2) /* 3.5MHz (7MHz / 2) verified */
|
||||
MCFG_YM2151_IRQ_HANDLER(HOLDLINE("audiocpu", 4)) // INPUTLINE?
|
||||
MCFG_YM2151_IRQ_HANDLER(WRITELINE(*this, megasys1_state,sound_irq))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
|
||||
@ -1751,7 +1762,7 @@ MACHINE_CONFIG_START(megasys1_state::kickoffb)
|
||||
MCFG_DEVICE_REMOVE("oki2")
|
||||
|
||||
MCFG_DEVICE_ADD("ymsnd", YM2203, SOUND_CPU_CLOCK / 2)
|
||||
MCFG_YM2203_IRQ_HANDLER(HOLDLINE("audiocpu", 4)) // TODO: needs to be checked
|
||||
MCFG_YM2203_IRQ_HANDLER(WRITELINE(*this, megasys1_state, sound_irq)) // TODO: needs to be checked
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
MACHINE_CONFIG_END
|
||||
@ -1809,11 +1820,12 @@ MACHINE_CONFIG_START(megasys1_state::system_Bbl)
|
||||
MCFG_MEGASYS1_TILEMAP_ADD("scroll2", "palette", 256*2)
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
/* just the one OKI, used for sound and music */
|
||||
MCFG_DEVICE_ADD("oki1", OKIM6295, OKI4_SOUND_CLOCK, okim6295_device::PIN7_HIGH)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(megasys1_state::system_B_hayaosi1)
|
||||
@ -1843,9 +1855,6 @@ MACHINE_CONFIG_START(megasys1_state::system_C)
|
||||
|
||||
MCFG_DEVICE_MODIFY("audiocpu")
|
||||
MCFG_DEVICE_PROGRAM_MAP(megasys1B_sound_map)
|
||||
|
||||
MCFG_DEVICE_MODIFY("soundlatch")
|
||||
MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 2)) // Cybattler reads sound latch on irq 2
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -1943,7 +1952,6 @@ MACHINE_CONFIG_START(megasys1_state::system_Z)
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_GENERIC_LATCH_8_ADD("soundlatch_z")
|
||||
MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 5))
|
||||
|
||||
MCFG_DEVICE_ADD("ymsnd", YM2203, 1500000)
|
||||
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
|
||||
@ -4631,10 +4639,13 @@ DRIVER_INIT_MEMBER(megasys1_state,iganinju)
|
||||
}
|
||||
|
||||
// jitsupro writes oki commands to both the lsb and msb; it works because of byte smearing
|
||||
template<int Chip>
|
||||
WRITE16_MEMBER(megasys1_state::okim6295_both_w)
|
||||
WRITE16_MEMBER(megasys1_state::okim6295_both_1_w)
|
||||
{
|
||||
m_oki[Chip]->write_command(data & 0xff);
|
||||
m_oki1->write_command(data & 0xff);
|
||||
}
|
||||
WRITE16_MEMBER(megasys1_state::okim6295_both_2_w)
|
||||
{
|
||||
m_oki2->write_command(data & 0xff);
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(megasys1_state,jitsupro)
|
||||
@ -4646,8 +4657,8 @@ DRIVER_INIT_MEMBER(megasys1_state,jitsupro)
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_r),this));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x20000, 0x20009, write16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_w),this));
|
||||
|
||||
m_audiocpu->space(AS_PROGRAM).install_write_handler(0xa0000, 0xa0003, write16_delegate(FUNC(megasys1_state::okim6295_both_w<0>),this));
|
||||
m_audiocpu->space(AS_PROGRAM).install_write_handler(0xc0000, 0xc0003, write16_delegate(FUNC(megasys1_state::okim6295_both_w<1>),this));
|
||||
m_audiocpu->space(AS_PROGRAM).install_write_handler(0xa0000, 0xa0003, write16_delegate(FUNC(megasys1_state::okim6295_both_1_w),this));
|
||||
m_audiocpu->space(AS_PROGRAM).install_write_handler(0xc0000, 0xc0003, write16_delegate(FUNC(megasys1_state::okim6295_both_2_w),this));
|
||||
|
||||
m_mcu_hs = 0;
|
||||
memset(m_mcu_hs_ram, 0, sizeof(m_mcu_hs_ram));
|
||||
@ -4659,9 +4670,10 @@ DRIVER_INIT_MEMBER(megasys1_state,jitsupro)
|
||||
DRIVER_INIT_MEMBER(megasys1_state,peekaboo)
|
||||
{
|
||||
uint8_t *ROM = memregion("oki1")->base();
|
||||
memory_bank *okibank = membank("okibank");
|
||||
|
||||
m_okibank->configure_entry(7, &ROM[0x20000]);
|
||||
m_okibank->configure_entries(0, 7, &ROM[0x20000], 0x20000);
|
||||
okibank->configure_entry(7, &ROM[0x20000]);
|
||||
okibank->configure_entries(0, 7, &ROM[0x20000], 0x20000);
|
||||
|
||||
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x100000, 0x100001, read16_delegate(FUNC(megasys1_state::protection_peekaboo_r),this), write16_delegate(FUNC(megasys1_state::protection_peekaboo_w),this));
|
||||
|
||||
@ -4832,9 +4844,9 @@ GAME( 1989, lordofk, astyanax, system_A, astyanax, megasys1_state, ast
|
||||
GAME( 1989, hachoo, 0, system_A_hachoo, hachoo, megasys1_state, astyanax, ROT0, "Jaleco", "Hachoo!", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, jitsupro, 0, system_A, jitsupro, megasys1_state, jitsupro, ROT0, "Jaleco", "Jitsuryoku!! Pro Yakyuu (Japan)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, plusalph, 0, system_A, plusalph, megasys1_state, astyanax, ROT270, "Jaleco", "Plus Alpha", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, stdragon, 0, system_A, stdragon, megasys1_state, stdragon, ROT0, "Jaleco", "Saint Dragon (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // Raster effects aren't implemented
|
||||
GAME( 1989, stdragona,stdragon, system_A, stdragon, megasys1_state, stdragona,ROT0, "Jaleco", "Saint Dragon (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // ^^
|
||||
GAME( 1989, stdragonb,stdragon, system_A, stdragon, megasys1_state, stdragonb,ROT0, "bootleg","Saint Dragon (bootleg)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // ^^
|
||||
GAME( 1989, stdragon, 0, system_A, stdragon, megasys1_state, stdragon, ROT0, "Jaleco", "Saint Dragon (set 1)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, stdragona,stdragon, system_A, stdragon, megasys1_state, stdragona,ROT0, "Jaleco", "Saint Dragon (set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1989, stdragonb,stdragon, system_A, stdragon, megasys1_state, stdragonb,ROT0, "bootleg","Saint Dragon (bootleg)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1990, rodland, 0, system_A, rodland, megasys1_state, rodland, ROT0, "Jaleco", "Rod-Land (World, set 1)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1990, rodlanda, rodland, system_A, rodland, megasys1_state, rodlandj, ROT0, "Jaleco", "Rod-Land (World, set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1990, rodlandj, rodland, system_A, rodland, megasys1_state, rodlandj, ROT0, "Jaleco", "Rod-Land (Japan)", MACHINE_SUPPORTS_SAVE )
|
||||
|
@ -15,33 +15,35 @@ class cischeat_state : public driver_device
|
||||
{
|
||||
public:
|
||||
cischeat_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_tmap(*this, "scroll%u", 0)
|
||||
, m_ram(*this, "ram")
|
||||
, m_roadram(*this, "roadram.%u", 0)
|
||||
, m_f1gpstr2_ioready(*this, "ioready")
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_cpu1(*this, "cpu1")
|
||||
, m_cpu2(*this, "cpu2")
|
||||
, m_cpu3(*this, "cpu3")
|
||||
, m_cpu5(*this, "cpu5")
|
||||
, m_soundcpu(*this, "soundcpu")
|
||||
, m_screen(*this, "screen")
|
||||
, m_watchdog(*this, "watchdog")
|
||||
, m_oki(*this, "oki%u", 1)
|
||||
, m_gfxdecode(*this, "gfxdecode")
|
||||
, m_palette(*this, "palette")
|
||||
, m_soundlatch(*this, "soundlatch")
|
||||
, m_soundlatch2(*this, "soundlatch2")
|
||||
, m_captflag_hopper(*this, "hopper")
|
||||
, m_captflag_motor_left(*this, "motor_left")
|
||||
, m_captflag_motor_right(*this, "motor_right")
|
||||
, m_oki_bank(*this, "oki%u_bank", 1)
|
||||
{
|
||||
for (int side = 0; side < 2; ++side)
|
||||
m_captflag_motor_command[side] = m_captflag_motor_pos[side] = 0;
|
||||
m_captflag_leds = 0;
|
||||
}
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_tmap(*this, "scroll%u", 0),
|
||||
m_ram(*this, "ram"),
|
||||
m_roadram(*this, "roadram.%u", 0),
|
||||
m_f1gpstr2_ioready(*this, "ioready"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_cpu1(*this, "cpu1"),
|
||||
m_cpu2(*this, "cpu2"),
|
||||
m_cpu3(*this, "cpu3"),
|
||||
m_cpu5(*this, "cpu5"),
|
||||
m_soundcpu(*this, "soundcpu"),
|
||||
m_screen(*this, "screen"),
|
||||
m_watchdog(*this, "watchdog"),
|
||||
m_oki1(*this, "oki1"),
|
||||
m_oki2(*this, "oki2"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette"),
|
||||
m_soundlatch(*this, "soundlatch"),
|
||||
m_soundlatch2(*this, "soundlatch2"),
|
||||
m_captflag_hopper(*this, "hopper"),
|
||||
m_captflag_motor_left(*this, "motor_left"),
|
||||
m_captflag_motor_right(*this, "motor_right"),
|
||||
m_oki1_bank(*this, "oki1_bank"),
|
||||
m_oki2_bank(*this, "oki2_bank")
|
||||
{
|
||||
for (int side = 0; side < 2; ++side)
|
||||
m_captflag_motor_command[side] = m_captflag_motor_pos[side] = 0;
|
||||
m_captflag_leds = 0;
|
||||
}
|
||||
|
||||
optional_device_array<megasys1_tilemap_device, 3> m_tmap;
|
||||
required_shared_ptr<uint16_t> m_ram;
|
||||
@ -67,13 +69,13 @@ public:
|
||||
DECLARE_WRITE16_MEMBER(scudhamm_motor_command_w);
|
||||
DECLARE_WRITE16_MEMBER(scudhamm_leds_w);
|
||||
DECLARE_WRITE16_MEMBER(scudhamm_enable_w);
|
||||
DECLARE_WRITE8_MEMBER(scudhamm_oki_bank_w);
|
||||
DECLARE_WRITE16_MEMBER(scudhamm_oki_bank_w);
|
||||
DECLARE_READ16_MEMBER(armchmp2_motor_status_r);
|
||||
DECLARE_WRITE16_MEMBER(armchmp2_motor_command_w);
|
||||
DECLARE_READ16_MEMBER(armchmp2_analog_r);
|
||||
DECLARE_READ16_MEMBER(armchmp2_buttons_r);
|
||||
DECLARE_WRITE16_MEMBER(armchmp2_leds_w);
|
||||
DECLARE_WRITE8_MEMBER(bigrun_soundbank_w);
|
||||
DECLARE_WRITE16_MEMBER(bigrun_soundbank_w);
|
||||
DECLARE_READ16_MEMBER(scudhamm_motor_status_r);
|
||||
DECLARE_READ16_MEMBER(scudhamm_motor_pos_r);
|
||||
DECLARE_READ16_MEMBER(scudhamm_analog_r);
|
||||
@ -98,7 +100,8 @@ public:
|
||||
DECLARE_WRITE16_MEMBER(f1gpstar_soundint_w);
|
||||
DECLARE_WRITE16_MEMBER(f1gpstar_comms_w);
|
||||
DECLARE_WRITE16_MEMBER(f1gpstr2_io_w);
|
||||
template<int Chip> DECLARE_WRITE8_MEMBER(cischeat_soundbank_w);
|
||||
DECLARE_WRITE16_MEMBER(cischeat_soundbank_1_w);
|
||||
DECLARE_WRITE16_MEMBER(cischeat_soundbank_2_w);
|
||||
DECLARE_DRIVER_INIT(cischeat);
|
||||
DECLARE_DRIVER_INIT(bigrun);
|
||||
DECLARE_DRIVER_INIT(f1gpstar);
|
||||
@ -124,7 +127,8 @@ public:
|
||||
optional_device<cpu_device> m_soundcpu;
|
||||
required_device<screen_device> m_screen;
|
||||
optional_device<watchdog_timer_device> m_watchdog;
|
||||
required_device_array<okim6295_device, 2> m_oki;
|
||||
required_device<okim6295_device> m_oki1;
|
||||
required_device<okim6295_device> m_oki2;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
optional_device<generic_latch_16_device> m_soundlatch;
|
||||
@ -144,7 +148,8 @@ public:
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(captflag_motor_busy_r);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(captflag_motor_pos_r);
|
||||
|
||||
optional_memory_bank_array<2> m_oki_bank;
|
||||
optional_memory_bank m_oki1_bank;
|
||||
optional_memory_bank m_oki2_bank;
|
||||
DECLARE_WRITE16_MEMBER(captflag_oki_bank_w);
|
||||
|
||||
uint16_t m_captflag_leds;
|
||||
|
@ -19,35 +19,36 @@ class megasys1_state : public driver_device
|
||||
{
|
||||
public:
|
||||
megasys1_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_objectram(*this, "objectram")
|
||||
, m_tmap(*this, "scroll%u", 0)
|
||||
, m_ram(*this, "ram")
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_audiocpu(*this, "audiocpu")
|
||||
, m_oki(*this, "oki%u", 1)
|
||||
, m_gfxdecode(*this, "gfxdecode")
|
||||
, m_palette(*this, "palette")
|
||||
, m_screen(*this, "screen")
|
||||
, m_soundlatch(*this, "soundlatch")
|
||||
, m_soundlatch2(*this, "soundlatch2")
|
||||
, m_soundlatch_z(*this, "soundlatch_z")
|
||||
, m_rom_maincpu(*this, "maincpu")
|
||||
, m_io_system(*this, "SYSTEM")
|
||||
, m_io_p1(*this, "P1")
|
||||
, m_io_p2(*this, "P2")
|
||||
, m_io_dsw(*this, "DSW")
|
||||
, m_io_dsw1(*this, "DSW1")
|
||||
, m_io_dsw2(*this, "DSW2")
|
||||
, m_okibank(*this, "okibank")
|
||||
{ }
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_objectram(*this, "objectram"),
|
||||
m_tmap(*this, "scroll%u", 0),
|
||||
m_ram(*this, "ram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_oki1(*this, "oki1"),
|
||||
m_oki2(*this, "oki2"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette"),
|
||||
m_screen(*this, "screen"),
|
||||
m_soundlatch(*this, "soundlatch"),
|
||||
m_soundlatch2(*this, "soundlatch2"),
|
||||
m_soundlatch_z(*this, "soundlatch_z"),
|
||||
m_rom_maincpu(*this, "maincpu"),
|
||||
m_io_system(*this, "SYSTEM"),
|
||||
m_io_p1(*this, "P1"),
|
||||
m_io_p2(*this, "P2"),
|
||||
m_io_dsw(*this, "DSW"),
|
||||
m_io_dsw1(*this, "DSW1"),
|
||||
m_io_dsw2(*this, "DSW2")
|
||||
{ }
|
||||
|
||||
required_shared_ptr<uint16_t> m_objectram;
|
||||
optional_device_array<megasys1_tilemap_device, 3> m_tmap;
|
||||
required_shared_ptr<uint16_t> m_ram;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<cpu_device> m_audiocpu;
|
||||
optional_device_array<okim6295_device, 2> m_oki;
|
||||
optional_device<okim6295_device> m_oki1;
|
||||
optional_device<okim6295_device> m_oki2;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<screen_device> m_screen;
|
||||
@ -61,7 +62,6 @@ public:
|
||||
optional_ioport m_io_dsw;
|
||||
optional_ioport m_io_dsw1;
|
||||
optional_ioport m_io_dsw2;
|
||||
optional_memory_bank m_okibank;
|
||||
|
||||
// configuration
|
||||
uint16_t m_ip_select_values[7]; // System B and C
|
||||
@ -72,8 +72,10 @@ public:
|
||||
// all
|
||||
bitmap_ind16 m_sprite_buffer_bitmap;
|
||||
uint16_t m_screen_flag;
|
||||
std::unique_ptr<uint16_t[]> m_buffer_objectram[2];
|
||||
std::unique_ptr<uint16_t[]> m_buffer_spriteram16[2];
|
||||
std::unique_ptr<uint16_t[]> m_buffer_objectram;
|
||||
std::unique_ptr<uint16_t[]> m_buffer2_objectram;
|
||||
std::unique_ptr<uint16_t[]> m_buffer_spriteram16;
|
||||
std::unique_ptr<uint16_t[]> m_buffer2_spriteram16;
|
||||
|
||||
// all but System Z
|
||||
uint16_t m_active_layers;
|
||||
@ -95,6 +97,7 @@ public:
|
||||
// soldam
|
||||
uint16_t *m_spriteram;
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(sound_irq);
|
||||
DECLARE_READ16_MEMBER(ip_select_r);
|
||||
DECLARE_WRITE16_MEMBER(ip_select_w);
|
||||
DECLARE_READ16_MEMBER(protection_peekaboo_r);
|
||||
@ -112,11 +115,16 @@ public:
|
||||
DECLARE_READ16_MEMBER(sprite_flag_r);
|
||||
DECLARE_WRITE16_MEMBER(sprite_flag_w);
|
||||
DECLARE_WRITE16_MEMBER(screen_flag_w);
|
||||
DECLARE_WRITE16_MEMBER(soundlatch_w);
|
||||
DECLARE_WRITE16_MEMBER(soundlatch_z_w);
|
||||
DECLARE_WRITE16_MEMBER(soundlatch_c_w);
|
||||
DECLARE_WRITE16_MEMBER(monkelf_scroll0_w);
|
||||
DECLARE_WRITE16_MEMBER(monkelf_scroll1_w);
|
||||
void megasys1_set_vreg_flag(int which, int data);
|
||||
template<int Chip> DECLARE_READ8_MEMBER(oki_status_r);
|
||||
template<int Chip> DECLARE_WRITE16_MEMBER(okim6295_both_w);
|
||||
DECLARE_READ8_MEMBER(oki_status_1_r);
|
||||
DECLARE_READ8_MEMBER(oki_status_2_r);
|
||||
DECLARE_WRITE16_MEMBER(okim6295_both_1_w);
|
||||
DECLARE_WRITE16_MEMBER(okim6295_both_2_w);
|
||||
DECLARE_WRITE16_MEMBER(ram_w);
|
||||
|
||||
DECLARE_DRIVER_INIT(64street);
|
||||
|
@ -196,29 +196,30 @@ actual code sent to the hardware.
|
||||
#include "emu.h"
|
||||
#include "includes/megasys1.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
VIDEO_START_MEMBER(megasys1_state,megasys1)
|
||||
{
|
||||
m_spriteram = &m_ram[0x8000/2];
|
||||
|
||||
m_buffer_objectram[0] = std::make_unique<uint16_t[]>(0x2000/2);
|
||||
m_buffer_spriteram16[0] = std::make_unique<uint16_t[]>(0x2000/2);
|
||||
m_buffer_objectram[1] = std::make_unique<uint16_t[]>(0x2000/2);
|
||||
m_buffer_spriteram16[1] = std::make_unique<uint16_t[]>(0x2000/2);
|
||||
m_buffer_objectram = std::make_unique<uint16_t[]>(0x2000);
|
||||
m_buffer_spriteram16 = std::make_unique<uint16_t[]>(0x2000);
|
||||
m_buffer2_objectram = std::make_unique<uint16_t[]>(0x2000);
|
||||
m_buffer2_spriteram16 = std::make_unique<uint16_t[]>(0x2000);
|
||||
|
||||
m_active_layers = m_sprite_bank = m_screen_flag = m_sprite_flag = 0;
|
||||
|
||||
m_hardware_type_z = 0;
|
||||
if (m_soundlatch_z.found())
|
||||
if (strcmp(machine().system().name, "lomakai") == 0 ||
|
||||
strcmp(machine().system().name, "makaiden") == 0)
|
||||
m_hardware_type_z = 1;
|
||||
|
||||
m_screen->register_screen_bitmap(m_sprite_buffer_bitmap);
|
||||
|
||||
save_pointer(NAME(m_buffer_objectram[0].get()), 0x2000/2);
|
||||
save_pointer(NAME(m_buffer_spriteram16[0].get()), 0x2000/2);
|
||||
save_pointer(NAME(m_buffer_objectram[1].get()), 0x2000/2);
|
||||
save_pointer(NAME(m_buffer_spriteram16[1].get()), 0x2000/2);
|
||||
save_pointer(NAME(m_buffer_objectram.get()), 0x2000);
|
||||
save_pointer(NAME(m_buffer_spriteram16.get()), 0x2000);
|
||||
save_pointer(NAME(m_buffer2_objectram.get()), 0x2000);
|
||||
save_pointer(NAME(m_buffer2_spriteram16.get()), 0x2000);
|
||||
save_item(NAME(m_screen_flag));
|
||||
save_item(NAME(m_active_layers));
|
||||
save_item(NAME(m_sprite_flag));
|
||||
@ -265,6 +266,25 @@ WRITE16_MEMBER(megasys1_state::screen_flag_w)
|
||||
}
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(megasys1_state::soundlatch_w)
|
||||
{
|
||||
m_soundlatch->write(space, 0, data, mem_mask);
|
||||
m_audiocpu->set_input_line(4, HOLD_LINE);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(megasys1_state::soundlatch_z_w)
|
||||
{
|
||||
m_soundlatch_z->write(space, 0, data & 0xff);
|
||||
m_audiocpu->set_input_line(5, HOLD_LINE);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(megasys1_state::soundlatch_c_w)
|
||||
{
|
||||
// Cybattler reads sound latch on irq 2
|
||||
m_soundlatch->write(space, 0, data, mem_mask);
|
||||
m_audiocpu->set_input_line(2, HOLD_LINE);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(megasys1_state::monkelf_scroll0_w)
|
||||
{
|
||||
// code in routine $280 does this. protection?
|
||||
@ -371,6 +391,7 @@ inline void megasys1_state::draw_16x16_priority_sprite(screen_device &screen, bi
|
||||
|
||||
color = color * 16;
|
||||
|
||||
|
||||
for (int32_t y = 0; y < 16; y++, sy++, sx-=16)
|
||||
{
|
||||
// uint16_t *dest = &bitmap.pix16(sy)+ sx;
|
||||
@ -398,12 +419,15 @@ inline void megasys1_state::draw_16x16_priority_sprite(screen_device &screen, bi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void megasys1_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect)
|
||||
{
|
||||
int color,code,sx,sy,flipx,flipy,attr,sprite;
|
||||
|
||||
|
||||
|
||||
/* objram: 0x100*4 entries spritedata: 0x80 entries */
|
||||
|
||||
/* sprite order is from first in Sprite Data RAM (frontmost) to last */
|
||||
@ -424,8 +448,8 @@ void megasys1_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,co
|
||||
|
||||
int32_t color_mask = (m_sprite_flag & 0x100) ? 0x07 : 0x0f;
|
||||
|
||||
uint16_t *objectram = (uint16_t*)m_buffer_objectram[1].get();
|
||||
uint16_t *spriteram = (uint16_t*)m_buffer_spriteram16[1].get();
|
||||
uint16_t *objectram = (uint16_t*)m_buffer2_objectram.get();
|
||||
uint16_t *spriteram = (uint16_t*)m_buffer2_spriteram16.get();
|
||||
|
||||
for (int32_t offs = (0x800-8)/2; offs >= 0; offs -= 4)
|
||||
{
|
||||
@ -469,11 +493,13 @@ void megasys1_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,co
|
||||
} /* non Z hw */
|
||||
else
|
||||
{
|
||||
uint16_t *spriteram16 = m_spriteram;
|
||||
|
||||
/* MS1-Z just draws Sprite Data, and in reverse order */
|
||||
|
||||
for (sprite = 0x80-1;sprite >= 0;sprite--)
|
||||
{
|
||||
uint16_t *spritedata = &m_spriteram[ sprite * 0x10/2];
|
||||
uint16_t *spritedata = &spriteram16[ sprite * 0x10/2];
|
||||
|
||||
attr = spritedata[ 8/2 ];
|
||||
|
||||
@ -508,6 +534,8 @@ void megasys1_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,co
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
Convert the Priority Prom
|
||||
***************************************************************************/
|
||||
@ -518,6 +546,7 @@ struct priority
|
||||
int priorities[16];
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Layers order encoded as an int like: 0x01234, where
|
||||
|
||||
@ -537,6 +566,8 @@ struct priority
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Convert the 512 bytes in the Priority Prom into 16 ints, encoding
|
||||
the layers order for 16 selectable priority schemes.
|
||||
@ -710,11 +741,15 @@ void megasys1_state::priority_create()
|
||||
|
||||
} // pri_code
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
/* log the priority schemes */
|
||||
for (i = 0; i < 16; i++)
|
||||
logerror("PROM %X] %05x\n", i, m_layers_order[i]);
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
PALETTE_INIT_MEMBER(megasys1_state,megasys1)
|
||||
@ -723,6 +758,9 @@ PALETTE_INIT_MEMBER(megasys1_state,megasys1)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
Draw the game screen in the given bitmap_ind16.
|
||||
***************************************************************************/
|
||||
@ -833,11 +871,11 @@ WRITE_LINE_MEMBER(megasys1_state::screen_vblank)
|
||||
{
|
||||
/* Sprite are TWO frames ahead, like NMK16 HW. */
|
||||
//m_objectram
|
||||
std::copy_n(&m_buffer_objectram[0][0], 0x2000/2, &m_buffer_objectram[1][0]);
|
||||
std::copy_n(&m_objectram[0], 0x2000/2, &m_buffer_objectram[0][0]);
|
||||
memcpy(m_buffer2_objectram.get(),m_buffer_objectram.get(), 0x2000);
|
||||
memcpy(m_buffer_objectram.get(), m_objectram, 0x2000);
|
||||
//spriteram16
|
||||
std::copy_n(&m_buffer_spriteram16[0][0], 0x2000/2, &m_buffer_spriteram16[1][0]);
|
||||
std::copy_n(&m_spriteram[0], 0x2000/2, &m_buffer_spriteram16[0][0]);
|
||||
memcpy(m_buffer2_spriteram16.get(), m_buffer_spriteram16.get(), 0x2000);
|
||||
memcpy(m_buffer_spriteram16.get(), m_spriteram, 0x2000);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user