From 75315a750452dc9b89aaf02375de51cdaf69f08f Mon Sep 17 00:00:00 2001 From: AJR Date: Wed, 16 Oct 2019 23:03:32 -0400 Subject: [PATCH] glfgreat: Add analog controls and ADC; remove spurious fourth button tmnt.cpp: Separate some state classes; get rid of MCFG_MACHINE_START_OVERRIDE but keep other overrides for now (nw) --- src/mame/drivers/tmnt.cpp | 148 ++++++++++++++++++++------------------ src/mame/includes/tmnt.h | 93 ++++++++++++++++-------- src/mame/video/tmnt.cpp | 78 ++++++++++---------- 3 files changed, 183 insertions(+), 136 deletions(-) diff --git a/src/mame/drivers/tmnt.cpp b/src/mame/drivers/tmnt.cpp index 74147ce83df..4df050c746e 100644 --- a/src/mame/drivers/tmnt.cpp +++ b/src/mame/drivers/tmnt.cpp @@ -59,10 +59,12 @@ Updates: #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" +#include "machine/adc0804.h" #include "machine/eepromser.h" #include "machine/gen_latch.h" #include "machine/k054321.h" #include "machine/nvram.h" +#include "machine/rescap.h" #include "machine/watchdog.h" #include "sound/k054539.h" #include "sound/okim6295.h" @@ -169,7 +171,7 @@ INTERRUPT_GEN_MEMBER(tmnt_state::lgtnfght_interrupt) device.execute().set_input_line(M68K_IRQ_5, HOLD_LINE); } -WRITE8_MEMBER(tmnt_state::glfgreat_sound_w) +WRITE8_MEMBER(glfgreat_state::glfgreat_sound_w) { m_k053260->main_write(offset, data); @@ -178,12 +180,12 @@ WRITE8_MEMBER(tmnt_state::glfgreat_sound_w) } -WRITE16_MEMBER(tmnt_state::prmrsocr_sound_irq_w) +WRITE16_MEMBER(prmrsocr_state::prmrsocr_sound_irq_w) { m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); // Z80 } -WRITE8_MEMBER(tmnt_state::prmrsocr_audio_bankswitch_w) +WRITE8_MEMBER(prmrsocr_state::prmrsocr_audio_bankswitch_w) { membank("bank1")->set_entry(data & 7); } @@ -449,7 +451,7 @@ WRITE16_MEMBER(tmnt_state::thndrx2_eeprom_w) } } -WRITE16_MEMBER(tmnt_state::prmrsocr_eeprom_w) +WRITE16_MEMBER(prmrsocr_state::prmrsocr_eeprom_w) { if (ACCESSING_BITS_0_7) { @@ -602,7 +604,7 @@ void tmnt_state::blswhstl_main_map(address_map &map) map(0x780700, 0x78071f).w(m_k053251, FUNC(k053251_device::write)).umask16(0x00ff); } -WRITE16_MEMBER(tmnt_state::k053251_glfgreat_w) +WRITE16_MEMBER(glfgreat_state::k053251_glfgreat_w) { int i; @@ -623,14 +625,19 @@ WRITE16_MEMBER(tmnt_state::k053251_glfgreat_w) } } -void tmnt_state::glfgreat_main_map(address_map &map) +uint8_t glfgreat_state::controller_r() +{ + return m_analog_controller[m_controller_select]->read(); +} + +void glfgreat_state::glfgreat_main_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x100000, 0x103fff).ram(); /* main RAM */ - map(0x104000, 0x107fff).rw(FUNC(tmnt_state::k053245_scattered_word_r), FUNC(tmnt_state::k053245_scattered_word_w)).share("spriteram"); + map(0x104000, 0x107fff).rw(FUNC(glfgreat_state::k053245_scattered_word_r), FUNC(glfgreat_state::k053245_scattered_word_w)).share("spriteram"); map(0x108000, 0x108fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x10c000, 0x10cfff).rw(m_k053936, FUNC(k053936_device::linectrl_r), FUNC(k053936_device::linectrl_w)); /* 053936? */ - map(0x110000, 0x11001f).w(FUNC(tmnt_state::k053244_word_noA1_w)); /* duplicate! */ + map(0x110000, 0x11001f).w(FUNC(glfgreat_state::k053244_word_noA1_w)); /* duplicate! */ map(0x114000, 0x11401f).rw(m_k053245, FUNC(k05324x_device::k053244_r), FUNC(k05324x_device::k053244_w)).umask16(0x00ff); /* duplicate! */ map(0x118000, 0x11801f).w(m_k053936, FUNC(k053936_device::ctrl_w)); map(0x11c000, 0x11c01f).w(m_k053251, FUNC(k053251_device::write)).umask16(0xff00); @@ -638,33 +645,34 @@ void tmnt_state::glfgreat_main_map(address_map &map) map(0x120002, 0x120003).portr("P3/P4"); map(0x120004, 0x120005).portr("COINS/DSW3"); map(0x120006, 0x120007).portr("DSW1/DSW2"); - map(0x121000, 0x121001).r(FUNC(tmnt_state::glfgreat_ball_r)); /* returns the color of the center pixel of the roz layer */ - map(0x122000, 0x122001).w(FUNC(tmnt_state::glfgreat_122000_w)); + map(0x121000, 0x121001).r(FUNC(glfgreat_state::glfgreat_ball_r)); /* returns the color of the center pixel of the roz layer */ + map(0x122000, 0x122001).w(FUNC(glfgreat_state::glfgreat_122000_w)); + map(0x123000, 0x123000).rw("adc", FUNC(adc0804_device::read), FUNC(adc0804_device::write)); map(0x124000, 0x124001).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); - map(0x125000, 0x125003).r(m_k053260, FUNC(k053260_device::main_read)).umask16(0xff00).w(FUNC(tmnt_state::glfgreat_sound_w)).umask16(0xff00); - map(0x200000, 0x207fff).rw(FUNC(tmnt_state::k052109_word_noA12_r), FUNC(tmnt_state::k052109_word_noA12_w)); - map(0x300000, 0x3fffff).r(FUNC(tmnt_state::glfgreat_rom_r)); + map(0x125000, 0x125003).r(m_k053260, FUNC(k053260_device::main_read)).umask16(0xff00).w(FUNC(glfgreat_state::glfgreat_sound_w)).umask16(0xff00); + map(0x200000, 0x207fff).rw(FUNC(glfgreat_state::k052109_word_noA12_r), FUNC(glfgreat_state::k052109_word_noA12_w)); + map(0x300000, 0x3fffff).r(FUNC(glfgreat_state::glfgreat_rom_r)); } -void tmnt_state::prmrsocr_main_map(address_map &map) +void prmrsocr_state::prmrsocr_main_map(address_map &map) { map(0x000000, 0x07ffff).rom(); map(0x100000, 0x103fff).ram(); /* main RAM */ - map(0x104000, 0x107fff).rw(FUNC(tmnt_state::k053245_scattered_word_r), FUNC(tmnt_state::k053245_scattered_word_w)).share("spriteram"); + map(0x104000, 0x107fff).rw(FUNC(prmrsocr_state::k053245_scattered_word_r), FUNC(prmrsocr_state::k053245_scattered_word_w)).share("spriteram"); map(0x108000, 0x108fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x10c000, 0x10cfff).rw(m_k053936, FUNC(k053936_device::linectrl_r), FUNC(k053936_device::linectrl_w)); - map(0x110000, 0x11001f).w(FUNC(tmnt_state::k053244_word_noA1_w)); /* duplicate! */ + map(0x110000, 0x11001f).w(FUNC(prmrsocr_state::k053244_word_noA1_w)); /* duplicate! */ map(0x114000, 0x11401f).rw(m_k053245, FUNC(k05324x_device::k053244_r), FUNC(k05324x_device::k053244_w)).umask16(0x00ff); /* duplicate! */ map(0x118000, 0x11801f).w(m_k053936, FUNC(k053936_device::ctrl_w)); map(0x11c000, 0x11c01f).w(m_k053251, FUNC(k053251_device::write)).umask16(0xff00); map(0x120000, 0x120001).portr("P1/COINS"); map(0x120002, 0x120003).portr("P2/EEPROM"); map(0x121000, 0x12101f).m("k054321", FUNC(k054321_device::main_map)).umask16(0x00ff); - map(0x122000, 0x122001).w(FUNC(tmnt_state::prmrsocr_eeprom_w)); /* EEPROM + video control */ - map(0x123000, 0x123001).w(FUNC(tmnt_state::prmrsocr_sound_irq_w)); - map(0x200000, 0x207fff).rw(FUNC(tmnt_state::k052109_word_noA12_r), FUNC(tmnt_state::k052109_word_noA12_w)); + map(0x122000, 0x122001).w(FUNC(prmrsocr_state::prmrsocr_eeprom_w)); /* EEPROM + video control */ + map(0x123000, 0x123001).w(FUNC(prmrsocr_state::prmrsocr_sound_irq_w)); + map(0x200000, 0x207fff).rw(FUNC(prmrsocr_state::k052109_word_noA12_r), FUNC(prmrsocr_state::k052109_word_noA12_w)); map(0x280000, 0x280001).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); - map(0x300000, 0x33ffff).r(FUNC(tmnt_state::prmrsocr_rom_r)); + map(0x300000, 0x33ffff).r(FUNC(prmrsocr_state::prmrsocr_rom_r)); } @@ -1042,12 +1050,12 @@ void tmnt_state::lgtnfght_audio_map(address_map &map) } -void tmnt_state::glfgreat_audio_map(address_map &map) +void glfgreat_state::glfgreat_audio_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0xf000, 0xf7ff).ram(); map(0xf800, 0xf82f).rw(m_k053260, FUNC(k053260_device::read), FUNC(k053260_device::write)); - map(0xfa00, 0xfa00).w(FUNC(tmnt_state::sound_arm_nmi_w)); + map(0xfa00, 0xfa00).w(FUNC(glfgreat_state::sound_arm_nmi_w)); } @@ -1071,7 +1079,7 @@ void tmnt_state::thndrx2_audio_map(address_map &map) } -void tmnt_state::prmrsocr_audio_map(address_map &map) +void prmrsocr_state::prmrsocr_audio_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0xbfff).bankr("bank1"); @@ -1080,7 +1088,7 @@ void tmnt_state::prmrsocr_audio_map(address_map &map) [this](offs_t offset) { return m_k054539->read(((offset & 0x100) << 1) | (offset & 0xff)); }, [this](offs_t offset, u8 data) { m_k054539->write(((offset & 0x100) << 1) | (offset & 0xff), data); }); map(0xf000, 0xf003).m("k054321", FUNC(k054321_device::sound_map)); - map(0xf800, 0xf800).w(FUNC(tmnt_state::prmrsocr_audio_bankswitch_w)); + map(0xf800, 0xf800).w(FUNC(prmrsocr_state::prmrsocr_audio_bankswitch_w)); } @@ -1605,12 +1613,25 @@ static INPUT_PORTS_START( glfgreat ) PORT_DIPUNUSED_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW3:4" ) // manual says "not used" PORT_START("P1/P2") - KONAMI16_LSB( 1, IPT_BUTTON3, IPT_BUTTON4 ) - KONAMI16_MSB( 2, IPT_BUTTON3, IPT_BUTTON4 ) PORT_PLAYER(2) + KONAMI16_LSB_40( 1, IPT_BUTTON3 ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("adc", adc0804_device, intr_r) // shown in service mode DIP SW1:9, SW2:9 and SW3:5 + KONAMI16_MSB( 2, IPT_BUTTON3, IPT_UNUSED ) PORT_PLAYER(2) PORT_START("P3/P4") - KONAMI16_LSB( 3, IPT_BUTTON3, IPT_BUTTON4 ) PORT_PLAYER(3) - KONAMI16_MSB( 4, IPT_BUTTON3, IPT_BUTTON4 ) PORT_PLAYER(4) + KONAMI16_LSB( 3, IPT_BUTTON3, IPT_UNUSED ) PORT_PLAYER(3) + KONAMI16_MSB( 4, IPT_BUTTON3, IPT_UNUSED ) PORT_PLAYER(4) + + PORT_START("CONTROLA") + PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(35) PORT_KEYDELTA(35) PORT_PLAYER(1) + + PORT_START("CONTROLB") + PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(35) PORT_KEYDELTA(35) PORT_PLAYER(2) + + PORT_START("CONTROLC") + PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(35) PORT_KEYDELTA(35) PORT_PLAYER(3) + + PORT_START("CONTROLD") + PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(35) PORT_KEYDELTA(35) PORT_PLAYER(4) INPUT_PORTS_END static INPUT_PORTS_START( glfgreatu ) @@ -1642,7 +1663,6 @@ static INPUT_PORTS_START( glfgreatj ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Right Direction") PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Left Direction") PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 Club Select") - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Spare (P1 Button 4)") // shown in service mode DIP SW1:9, SW2:9 and SW3:5 PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_NAME("Spare (P2 Left)") PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_NAME("Spare (P2 Right)") PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_NAME("P2 Stance Select") @@ -1650,7 +1670,6 @@ static INPUT_PORTS_START( glfgreatj ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Right Direction") PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Left Direction") PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 Club Select") - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("Spare (P2 Button 4)") PORT_MODIFY("P3/P4") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_NAME("Spare (P3 Left)") @@ -1660,7 +1679,6 @@ static INPUT_PORTS_START( glfgreatj ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_NAME("P3 Right Direction") PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_NAME("P3 Left Direction") PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) PORT_NAME("P3 Club Select") - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3) PORT_NAME("Spare (P3 Button 4)") PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) PORT_NAME("Spare (P4 Left)") PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) PORT_NAME("Spare (P4 Right)") PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(4) PORT_NAME("P4 Stance Select") @@ -1668,7 +1686,6 @@ static INPUT_PORTS_START( glfgreatj ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_NAME("P4 Right Direction") PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_NAME("P4 Left Direction") PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) PORT_NAME("P4 Club Select") - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) PORT_NAME("Spare (P4 Button 4)") INPUT_PORTS_END static INPUT_PORTS_START( ssriders ) @@ -1882,7 +1899,7 @@ WRITE8_MEMBER(tmnt_state::volume_callback) m_k007232->set_volume(1, 0, (data & 0x0f) * 0x11); } -MACHINE_START_MEMBER(tmnt_state,common) +void tmnt_state::machine_start() { save_item(NAME(m_toggle)); save_item(NAME(m_last)); @@ -1909,7 +1926,6 @@ void tmnt_state::cuebrick(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::cuebrick_main_map); m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::tmnt_interrupt)); - MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) WATCHDOG_TIMER(config, "watchdog"); @@ -1963,7 +1979,6 @@ void tmnt_state::mia(machine_config &config) Z80(config, m_audiocpu, XTAL(3'579'545)); m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::mia_audio_map); - MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) WATCHDOG_TIMER(config, "watchdog"); @@ -2025,7 +2040,6 @@ void tmnt_state::tmnt(machine_config &config) Z80(config, m_audiocpu, XTAL(3'579'545)); m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::tmnt_audio_map); - MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,tmnt) WATCHDOG_TIMER(config, "watchdog"); @@ -2090,7 +2104,6 @@ void tmnt_state::punkshot(machine_config &config) m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::punkshot_audio_map); /* NMIs are generated by the 053260 */ - MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) WATCHDOG_TIMER(config, "watchdog"); @@ -2140,7 +2153,6 @@ void tmnt_state::lgtnfght(machine_config &config) Z80(config, m_audiocpu, XTAL(3'579'545)); m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::lgtnfght_audio_map); - MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) WATCHDOG_TIMER(config, "watchdog"); @@ -2194,7 +2206,6 @@ void tmnt_state::blswhstl(machine_config &config) m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::ssriders_audio_map); /* NMIs are generated by the 053260 */ - MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) EEPROM_ER5911_8BIT(config, "eeprom"); @@ -2259,22 +2270,24 @@ static GFXDECODE_START( gfx_glfgreat ) GFXDECODE_ENTRY( "zoom", 0, zoomlayout, 0x400, 16 ) GFXDECODE_END -void tmnt_state::glfgreat(machine_config &config) +void glfgreat_state::glfgreat(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, XTAL(32'000'000)/2); /* Confirmed */ - m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::glfgreat_main_map); - m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::lgtnfght_interrupt)); + m_maincpu->set_addrmap(AS_PROGRAM, &glfgreat_state::glfgreat_main_map); + m_maincpu->set_vblank_int("screen", FUNC(glfgreat_state::lgtnfght_interrupt)); Z80(config, m_audiocpu, XTAL(3'579'545)); - m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::glfgreat_audio_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &glfgreat_state::glfgreat_audio_map); /* NMIs are generated by the 053260 */ - MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) - MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) + MCFG_MACHINE_RESET_OVERRIDE(glfgreat_state,common) WATCHDOG_TIMER(config, "watchdog"); + adc0804_device &adc(ADC0804(config, "adc", RES_K(10), CAP_P(150))); + adc.vin_callback().set(FUNC(glfgreat_state::controller_r)); + /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); @@ -2282,7 +2295,7 @@ void tmnt_state::glfgreat(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ screen.set_size(64*8, 32*8); screen.set_visarea(14*8, (64-14)*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(tmnt_state::screen_update_glfgreat)); + screen.set_screen_update(FUNC(glfgreat_state::screen_update_glfgreat)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_glfgreat); @@ -2291,16 +2304,16 @@ void tmnt_state::glfgreat(machine_config &config) m_palette->enable_shadows(); m_palette->enable_hilights(); - MCFG_VIDEO_START_OVERRIDE(tmnt_state,glfgreat) + MCFG_VIDEO_START_OVERRIDE(glfgreat_state,glfgreat) K052109(config, m_k052109, 0); m_k052109->set_palette(m_palette); m_k052109->set_screen(nullptr); - m_k052109->set_tile_callback(FUNC(tmnt_state::tmnt_tile_callback), this); + m_k052109->set_tile_callback(FUNC(glfgreat_state::tmnt_tile_callback), this); K053245(config, m_k053245, 0); m_k053245->set_palette(m_palette); - m_k053245->set_sprite_callback(FUNC(tmnt_state::lgtnfght_sprite_callback), this); + m_k053245->set_sprite_callback(FUNC(glfgreat_state::lgtnfght_sprite_callback), this); K053936(config, m_k053936, 0); m_k053936->set_wrap(1); @@ -2317,26 +2330,25 @@ void tmnt_state::glfgreat(machine_config &config) m_k053260->add_route(1, "rspeaker", 1.0); } -MACHINE_START_MEMBER(tmnt_state,prmrsocr) +void prmrsocr_state::machine_start() { - MACHINE_START_CALL_MEMBER(common); + tmnt_state::machine_start(); uint8_t *ROM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000); } -void tmnt_state::prmrsocr(machine_config &config) +void prmrsocr_state::prmrsocr(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, XTAL(32'000'000)/2); /* Confirmed */ - m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::prmrsocr_main_map); - m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::lgtnfght_interrupt)); + m_maincpu->set_addrmap(AS_PROGRAM, &prmrsocr_state::prmrsocr_main_map); + m_maincpu->set_vblank_int("screen", FUNC(prmrsocr_state::lgtnfght_interrupt)); Z80(config, m_audiocpu, 8000000); /* ? */ - m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::prmrsocr_audio_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &prmrsocr_state::prmrsocr_audio_map); /* NMIs are generated by the 054539 */ - MCFG_MACHINE_START_OVERRIDE(tmnt_state,prmrsocr) - MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) + MCFG_MACHINE_RESET_OVERRIDE(prmrsocr_state,common) EEPROM_ER5911_8BIT(config, "eeprom"); @@ -2349,7 +2361,7 @@ void tmnt_state::prmrsocr(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ screen.set_size(64*8, 32*8); screen.set_visarea(14*8, (64-14)*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(tmnt_state::screen_update_glfgreat)); + screen.set_screen_update(FUNC(prmrsocr_state::screen_update_glfgreat)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_glfgreat); @@ -2358,16 +2370,16 @@ void tmnt_state::prmrsocr(machine_config &config) m_palette->enable_shadows(); m_palette->enable_hilights(); - MCFG_VIDEO_START_OVERRIDE(tmnt_state,prmrsocr) + MCFG_VIDEO_START_OVERRIDE(prmrsocr_state,prmrsocr) K052109(config, m_k052109, 0); m_k052109->set_palette(m_palette); m_k052109->set_screen(nullptr); - m_k052109->set_tile_callback(FUNC(tmnt_state::tmnt_tile_callback), this); + m_k052109->set_tile_callback(FUNC(prmrsocr_state::tmnt_tile_callback), this); K053245(config, m_k053245, 0); m_k053245->set_palette(m_palette); - m_k053245->set_sprite_callback(FUNC(tmnt_state::prmrsocr_sprite_callback), this); + m_k053245->set_sprite_callback(FUNC(prmrsocr_state::prmrsocr_sprite_callback), this); K053936(config, m_k053936, 0); m_k053936->set_offsets(85, 1); @@ -2400,7 +2412,6 @@ void tmnt_state::tmnt2(machine_config &config) m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::ssriders_audio_map); /* NMIs are generated by the 053260 */ - MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) EEPROM_ER5911_8BIT(config, "eeprom"); @@ -2456,7 +2467,6 @@ void tmnt_state::ssriders(machine_config &config) m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::ssriders_audio_map); /* NMIs are generated by the 053260 */ - MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) EEPROM_ER5911_8BIT(config, "eeprom"); @@ -2508,7 +2518,6 @@ void tmnt_state::sunsetbl(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &tmnt_state::sunsetbl_main_map); m_maincpu->set_vblank_int("screen", FUNC(tmnt_state::irq4_line_hold)); - MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) EEPROM_ER5911_8BIT(config, "eeprom"); @@ -2558,7 +2567,6 @@ void tmnt_state::thndrx2(machine_config &config) m_audiocpu->set_addrmap(AS_PROGRAM, &tmnt_state::thndrx2_audio_map); /* NMIs are generated by the 053260 */ - MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) EEPROM_ER5911_8BIT(config, "eeprom"); @@ -4297,9 +4305,9 @@ GAME( 1991, blswhstl, 0, blswhstl, blswhstl, tmnt_state, empty_init, GAME( 1991, blswhstla, blswhstl, blswhstl, blswhstl, tmnt_state, empty_init, ROT90, "Konami", "Bells & Whistles (Asia, version M)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, detatwin, blswhstl, blswhstl, blswhstl, tmnt_state, empty_init, ROT90, "Konami", "Detana!! Twin Bee (Japan, version J)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, glfgreat, 0, glfgreat, glfgreat, tmnt_state, empty_init, ROT0, "Konami", "Golfing Greats (World, version L)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1991, glfgreatu, glfgreat, glfgreat, glfgreatu, tmnt_state, empty_init, ROT0, "Konami", "Golfing Greats (US, version K)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1991, glfgreatj, glfgreat, glfgreat, glfgreatj, tmnt_state, empty_init, ROT0, "Konami", "Golfing Greats (Japan, version J)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1991, glfgreat, 0, glfgreat, glfgreat, glfgreat_state, empty_init, ROT0, "Konami", "Golfing Greats (World, version L)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1991, glfgreatu, glfgreat, glfgreat, glfgreatu, glfgreat_state, empty_init, ROT0, "Konami", "Golfing Greats (US, version K)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1991, glfgreatj, glfgreat, glfgreat, glfgreatj, glfgreat_state, empty_init, ROT0, "Konami", "Golfing Greats (Japan, version J)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1991, tmnt2, 0, tmnt2, ssridr4p, tmnt_state, empty_init, ROT0, "Konami", "Teenage Mutant Ninja Turtles - Turtles in Time (4 Players ver UAA)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, tmnt2a, tmnt2, tmnt2, ssrid4ps, tmnt_state, empty_init, ROT0, "Konami", "Teenage Mutant Ninja Turtles - Turtles in Time (4 Players ver ADA)", MACHINE_SUPPORTS_SAVE ) @@ -4330,5 +4338,5 @@ GAME( 1991, thndrx2, 0, thndrx2, thndrx2, tmnt_state, empty_init, GAME( 1991, thndrx2a, thndrx2, thndrx2, thndrx2, tmnt_state, empty_init, ROT0, "Konami", "Thunder Cross II (Asia)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, thndrx2j, thndrx2, thndrx2, thndrx2, tmnt_state, empty_init, ROT0, "Konami", "Thunder Cross II (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, prmrsocr, 0, prmrsocr, prmrsocr, tmnt_state, empty_init, ROT0, "Konami", "Premier Soccer (ver EAB)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, prmrsocrj, prmrsocr, prmrsocr, prmrsocr, tmnt_state, empty_init, ROT0, "Konami", "Premier Soccer (ver JAB)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, prmrsocr, 0, prmrsocr, prmrsocr, prmrsocr_state, empty_init, ROT0, "Konami", "Premier Soccer (ver EAB)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, prmrsocrj, prmrsocr, prmrsocr, prmrsocr, prmrsocr_state, empty_init, ROT0, "Konami", "Premier Soccer (ver JAB)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/tmnt.h b/src/mame/includes/tmnt.h index cf532358d85..6a0da21f451 100644 --- a/src/mame/includes/tmnt.h +++ b/src/mame/includes/tmnt.h @@ -52,9 +52,7 @@ public: void tmnt2(machine_config &config); void lgtnfght(machine_config &config); void thndrx2(machine_config &config); - void prmrsocr(machine_config &config); void sunsetbl(machine_config &config); - void glfgreat(machine_config &config); void tmnt(machine_config &config); void mia(machine_config &config); void punkshot(machine_config &config); @@ -63,7 +61,9 @@ public: void init_tmnt(); void init_cuebrick(); -private: +protected: + virtual void machine_start() override; + enum { TIMER_NMI @@ -82,11 +82,7 @@ private: int m_sorted_layer[3]; // this might not be necessary, but tmnt2 uses it in a strange way... tilemap_t *m_roz_tilemap; - int m_glfgreat_roz_rom_bank; - int m_glfgreat_roz_char_bank; - int m_glfgreat_roz_rom_mode; int m_glfgreat_pixel; - int m_prmrsocr_sprite_bank; int m_blswhstl_rombank; int m_tmnt_priorityflag; int m_lastdim; @@ -129,8 +125,6 @@ private: DECLARE_WRITE16_MEMBER(k053245_scattered_word_w); DECLARE_READ16_MEMBER(k053244_word_noA1_r); DECLARE_WRITE16_MEMBER(k053244_word_noA1_w); - DECLARE_WRITE16_MEMBER(prmrsocr_sound_irq_w); - DECLARE_WRITE8_MEMBER(prmrsocr_audio_bankswitch_w); DECLARE_READ8_MEMBER(tmnt_sres_r); DECLARE_WRITE8_MEMBER(tmnt_sres_w); DECLARE_WRITE8_MEMBER(sound_arm_nmi_w); @@ -143,30 +137,19 @@ private: DECLARE_WRITE16_MEMBER(blswhstl_eeprom_w); DECLARE_READ16_MEMBER(thndrx2_eeprom_r); DECLARE_WRITE16_MEMBER(thndrx2_eeprom_w); - DECLARE_WRITE16_MEMBER(prmrsocr_eeprom_w); DECLARE_WRITE8_MEMBER(cuebrick_nvbank_w); DECLARE_WRITE16_MEMBER(ssriders_soundkludge_w); - DECLARE_WRITE16_MEMBER(k053251_glfgreat_w); DECLARE_WRITE16_MEMBER(tmnt2_1c0800_w); DECLARE_WRITE16_MEMBER(tmnt_0a0000_w); DECLARE_WRITE16_MEMBER(punkshot_0a0020_w); DECLARE_WRITE16_MEMBER(lgtnfght_0a0018_w); DECLARE_WRITE16_MEMBER(blswhstl_700300_w); - DECLARE_READ16_MEMBER(glfgreat_rom_r); - DECLARE_WRITE16_MEMBER(glfgreat_122000_w); DECLARE_WRITE16_MEMBER(ssriders_eeprom_w); DECLARE_WRITE16_MEMBER(ssriders_1c0300_w); - DECLARE_WRITE16_MEMBER(prmrsocr_122000_w); - DECLARE_READ16_MEMBER(prmrsocr_rom_r); DECLARE_WRITE16_MEMBER(tmnt_priority_w); - DECLARE_READ16_MEMBER(glfgreat_ball_r); - DECLARE_WRITE8_MEMBER(glfgreat_sound_w); DECLARE_WRITE8_MEMBER(tmnt_upd_start_w); DECLARE_READ8_MEMBER(tmnt_upd_busy_r); - TILE_GET_INFO_MEMBER(glfgreat_get_roz_tile_info); - TILE_GET_INFO_MEMBER(prmrsocr_get_roz_tile_info); - DECLARE_MACHINE_START(common); DECLARE_MACHINE_RESET(common); DECLARE_VIDEO_START(cuebrick); DECLARE_VIDEO_START(mia); @@ -174,9 +157,6 @@ private: DECLARE_VIDEO_START(tmnt); DECLARE_VIDEO_START(lgtnfght); DECLARE_VIDEO_START(blswhstl); - DECLARE_VIDEO_START(glfgreat); - DECLARE_MACHINE_START(prmrsocr); - DECLARE_VIDEO_START(prmrsocr); uint32_t screen_update_mia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_tmnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_punkshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -197,7 +177,6 @@ private: K051960_CB_MEMBER(thndrx2_sprite_callback); K05324X_CB_MEMBER(lgtnfght_sprite_callback); K05324X_CB_MEMBER(blswhstl_sprite_callback); - K05324X_CB_MEMBER(prmrsocr_sprite_callback); K052109_CB_MEMBER(mia_tile_callback); K052109_CB_MEMBER(cuebrick_tile_callback); K052109_CB_MEMBER(tmnt_tile_callback); @@ -207,14 +186,10 @@ private: void blswhstl_main_map(address_map &map); void cuebrick_main_map(address_map &map); - void glfgreat_audio_map(address_map &map); - void glfgreat_main_map(address_map &map); void lgtnfght_audio_map(address_map &map); void lgtnfght_main_map(address_map &map); void mia_audio_map(address_map &map); void mia_main_map(address_map &map); - void prmrsocr_audio_map(address_map &map); - void prmrsocr_main_map(address_map &map); void punkshot_audio_map(address_map &map); void punkshot_main_map(address_map &map); void ssriders_audio_map(address_map &map); @@ -229,4 +204,66 @@ private: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; }; +class glfgreat_state : public tmnt_state +{ +public: + glfgreat_state(const machine_config &mconfig, device_type type, const char *tag) : + tmnt_state(mconfig, type, tag), + m_analog_controller(*this, "CONTROL%c", 'A') + { } + + void glfgreat(machine_config &config); + +private: + DECLARE_WRITE16_MEMBER(k053251_glfgreat_w); + uint8_t controller_r(); + DECLARE_READ16_MEMBER(glfgreat_rom_r); + DECLARE_WRITE16_MEMBER(glfgreat_122000_w); + DECLARE_READ16_MEMBER(glfgreat_ball_r); + DECLARE_WRITE8_MEMBER(glfgreat_sound_w); + + TILE_GET_INFO_MEMBER(glfgreat_get_roz_tile_info); + DECLARE_VIDEO_START(glfgreat); + + void glfgreat_audio_map(address_map &map); + void glfgreat_main_map(address_map &map); + + required_ioport_array<4> m_analog_controller; + + uint8_t m_controller_select; + int m_roz_rom_bank; + int m_roz_char_bank; + int m_roz_rom_mode; +}; + +class prmrsocr_state : public tmnt_state +{ +public: + prmrsocr_state(const machine_config &mconfig, device_type type, const char *tag) : + tmnt_state(mconfig, type, tag) + { } + + void prmrsocr(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + DECLARE_WRITE16_MEMBER(prmrsocr_sound_irq_w); + DECLARE_WRITE8_MEMBER(prmrsocr_audio_bankswitch_w); + DECLARE_WRITE16_MEMBER(prmrsocr_eeprom_w); + DECLARE_WRITE16_MEMBER(prmrsocr_122000_w); + DECLARE_READ16_MEMBER(prmrsocr_rom_r); + + TILE_GET_INFO_MEMBER(prmrsocr_get_roz_tile_info); + DECLARE_VIDEO_START(prmrsocr); + K05324X_CB_MEMBER(prmrsocr_sprite_callback); + + void prmrsocr_audio_map(address_map &map); + void prmrsocr_main_map(address_map &map); + + int m_sprite_bank; + int m_roz_char_bank; +}; + #endif // MAME_INCLUDES_TMNT_H diff --git a/src/mame/video/tmnt.cpp b/src/mame/video/tmnt.cpp index c50eab7e87b..24995b3b770 100644 --- a/src/mame/video/tmnt.cpp +++ b/src/mame/video/tmnt.cpp @@ -5,19 +5,19 @@ #include "includes/tmnt.h" #include "screen.h" -TILE_GET_INFO_MEMBER(tmnt_state::glfgreat_get_roz_tile_info) +TILE_GET_INFO_MEMBER(glfgreat_state::glfgreat_get_roz_tile_info) { uint8_t *rom = memregion("user1")->base(); int code; - tile_index += 0x40000 * m_glfgreat_roz_rom_bank; + tile_index += 0x40000 * m_roz_rom_bank; code = rom[tile_index + 0x80000] + 256 * rom[tile_index] + 256 * 256 * ((rom[tile_index / 4 + 0x100000] >> (2 * (tile_index & 3))) & 3); SET_TILE_INFO_MEMBER(0, code & 0x3fff, code >> 14, 0); } -TILE_GET_INFO_MEMBER(tmnt_state::prmrsocr_get_roz_tile_info) +TILE_GET_INFO_MEMBER(prmrsocr_state::prmrsocr_get_roz_tile_info) { uint8_t *rom = memregion("user1")->base(); int code = rom[tile_index + 0x20000] + 256 * rom[tile_index]; @@ -184,7 +184,7 @@ if (machine().input().code_pressed(KEYCODE_E) && (*color & 0x80)) *color = machi *color = m_sprite_colorbase + (*color & 0x1f); } -K05324X_CB_MEMBER(tmnt_state::prmrsocr_sprite_callback) +K05324X_CB_MEMBER(prmrsocr_state::prmrsocr_sprite_callback) { int pri = 0x20 | ((*color & 0x60) >> 2); if (pri <= m_layerpri[2]) @@ -196,7 +196,7 @@ K05324X_CB_MEMBER(tmnt_state::prmrsocr_sprite_callback) else *priority = 0xf0 | 0xcc | 0xaa; - *code |= m_prmrsocr_sprite_bank << 14; + *code |= m_sprite_bank << 14; *color = m_sprite_colorbase + (*color & 0x1f); } @@ -252,28 +252,30 @@ VIDEO_START_MEMBER(tmnt_state,lgtnfght)/* also tmnt2, ssriders */ save_item(NAME(m_lasten)); } -VIDEO_START_MEMBER(tmnt_state,glfgreat) +VIDEO_START_MEMBER(glfgreat_state,glfgreat) { - m_roz_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tmnt_state::glfgreat_get_roz_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 512, 512); + m_roz_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(glfgreat_state::glfgreat_get_roz_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 512, 512); m_roz_tilemap->set_transparent_pen(0); - m_glfgreat_roz_rom_bank = 0; - m_glfgreat_roz_char_bank = 0; - m_glfgreat_roz_rom_mode = 0; - save_item(NAME(m_glfgreat_roz_rom_bank)); - save_item(NAME(m_glfgreat_roz_char_bank)); - save_item(NAME(m_glfgreat_roz_rom_mode)); + m_controller_select = 0; + m_roz_rom_bank = 0; + m_roz_char_bank = 0; + m_roz_rom_mode = 0; + save_item(NAME(m_controller_select)); + save_item(NAME(m_roz_rom_bank)); + save_item(NAME(m_roz_char_bank)); + save_item(NAME(m_roz_rom_mode)); } -VIDEO_START_MEMBER(tmnt_state,prmrsocr) +VIDEO_START_MEMBER(prmrsocr_state,prmrsocr) { - m_roz_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tmnt_state::prmrsocr_get_roz_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 512, 256); + m_roz_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(prmrsocr_state::prmrsocr_get_roz_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 512, 256); m_roz_tilemap->set_transparent_pen(0); - m_prmrsocr_sprite_bank = 0; - m_glfgreat_roz_char_bank = 0; - save_item(NAME(m_prmrsocr_sprite_bank)); - save_item(NAME(m_glfgreat_roz_char_bank)); + m_sprite_bank = 0; + m_roz_char_bank = 0; + save_item(NAME(m_sprite_bank)); + save_item(NAME(m_roz_char_bank)); } VIDEO_START_MEMBER(tmnt_state,blswhstl) @@ -373,20 +375,20 @@ WRITE16_MEMBER(tmnt_state::blswhstl_700300_w) } -READ16_MEMBER(tmnt_state::glfgreat_rom_r) +READ16_MEMBER(glfgreat_state::glfgreat_rom_r) { - if (m_glfgreat_roz_rom_mode) - return memregion("zoom")->base()[m_glfgreat_roz_char_bank * 0x80000 + offset]; + if (m_roz_rom_mode) + return memregion("zoom")->base()[m_roz_char_bank * 0x80000 + offset]; else if (offset < 0x40000) { uint8_t *usr = memregion("user1")->base(); - return usr[offset + 0x80000 + m_glfgreat_roz_rom_bank * 0x40000] + 256 * usr[offset + m_glfgreat_roz_rom_bank * 0x40000]; + return usr[offset + 0x80000 + m_roz_rom_bank * 0x40000] + 256 * usr[offset + m_roz_rom_bank * 0x40000]; } else - return memregion("user1")->base()[((offset & 0x3ffff) >> 2) + 0x100000 + m_glfgreat_roz_rom_bank * 0x10000]; + return memregion("user1")->base()[((offset & 0x3ffff) >> 2) + 0x100000 + m_roz_rom_bank * 0x10000]; } -WRITE16_MEMBER(tmnt_state::glfgreat_122000_w) +WRITE16_MEMBER(glfgreat_state::glfgreat_122000_w) { if (ACCESSING_BITS_0_7) { @@ -394,25 +396,25 @@ WRITE16_MEMBER(tmnt_state::glfgreat_122000_w) machine().bookkeeping().coin_counter_w(0, data & 0x01); machine().bookkeeping().coin_counter_w(1, data & 0x02); + m_controller_select = (data & 0x0c) >> 2; + /* bit 4 = enable char ROM reading through the video RAM */ m_k052109->set_rmrd_line((data & 0x10) ? ASSERT_LINE : CLEAR_LINE); /* bit 5 = 53596 tile rom bank selection */ - if (m_glfgreat_roz_rom_bank != (data & 0x20) >> 5) + if (m_roz_rom_bank != (data & 0x20) >> 5) { - m_glfgreat_roz_rom_bank = (data & 0x20) >> 5; + m_roz_rom_bank = (data & 0x20) >> 5; m_roz_tilemap->mark_all_dirty(); } /* bit 6,7 = 53596 char bank selection for ROM test */ - m_glfgreat_roz_char_bank = (data & 0xc0) >> 6; - - /* other bits unknown */ + m_roz_char_bank = (data & 0xc0) >> 6; } if (ACCESSING_BITS_8_15) { /* bit 8 = 53596 char/rom selection for ROM test */ - m_glfgreat_roz_rom_mode = data & 0x100; + m_roz_rom_mode = data & 0x100; } } @@ -452,7 +454,7 @@ WRITE16_MEMBER(tmnt_state::ssriders_1c0300_w) } } -WRITE16_MEMBER(tmnt_state::prmrsocr_122000_w) +WRITE16_MEMBER(prmrsocr_state::prmrsocr_122000_w) { if (ACCESSING_BITS_0_7) { @@ -464,19 +466,19 @@ WRITE16_MEMBER(tmnt_state::prmrsocr_122000_w) m_k052109->set_rmrd_line((data & 0x10) ? ASSERT_LINE : CLEAR_LINE); /* bit 6 = sprite ROM bank */ - m_prmrsocr_sprite_bank = (data & 0x40) >> 6; - m_k053245->bankselect(m_prmrsocr_sprite_bank << 2); + m_sprite_bank = (data & 0x40) >> 6; + m_k053245->bankselect(m_sprite_bank << 2); /* bit 7 = 53596 region selector for ROM test */ - m_glfgreat_roz_char_bank = (data & 0x80) >> 7; + m_roz_char_bank = (data & 0x80) >> 7; /* other bits unknown (unused?) */ } } -READ16_MEMBER(tmnt_state::prmrsocr_rom_r) +READ16_MEMBER(prmrsocr_state::prmrsocr_rom_r) { - if(m_glfgreat_roz_char_bank) + if(m_roz_char_bank) return memregion("zoom")->base()[offset]; else { @@ -606,7 +608,7 @@ uint32_t tmnt_state::screen_update_lgtnfght(screen_device &screen, bitmap_ind16 } -READ16_MEMBER(tmnt_state::glfgreat_ball_r) +READ16_MEMBER(glfgreat_state::glfgreat_ball_r) { #ifdef MAME_DEBUG popmessage("%04x", m_glfgreat_pixel);