diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2020-03-28 12:05:15 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2020-03-28 12:05:15 -0400 |
commit | 6c6a55d5bba7df20b31325f2a6a1d941a0e00dc1 (patch) | |
tree | 32d4e41e4a6cf1db154d9fcaa3b522cf5bb2e9b4 /src/mame | |
parent | 21bfb6a09ee3de9ec55dea716c98347b3188da86 (diff) |
upd7001: New device
ssv.cpp: Split state class up a bit (nw)
Diffstat (limited to 'src/mame')
-rw-r--r-- | src/mame/drivers/alphajuno.cpp | 4 | ||||
-rw-r--r-- | src/mame/drivers/px8.cpp | 12 | ||||
-rw-r--r-- | src/mame/drivers/roland_jx8p.cpp | 31 | ||||
-rw-r--r-- | src/mame/drivers/roland_s10.cpp | 10 | ||||
-rw-r--r-- | src/mame/drivers/ssv.cpp | 137 | ||||
-rw-r--r-- | src/mame/includes/ssv.h | 145 | ||||
-rw-r--r-- | src/mame/video/ssv.cpp | 40 |
7 files changed, 229 insertions, 150 deletions
diff --git a/src/mame/drivers/alphajuno.cpp b/src/mame/drivers/alphajuno.cpp index c563109a387..a03efd0e6a4 100644 --- a/src/mame/drivers/alphajuno.cpp +++ b/src/mame/drivers/alphajuno.cpp @@ -11,6 +11,8 @@ #include "cpu/mcs51/mcs51.h" #include "machine/mb63h149.h" #include "machine/nvram.h" +#include "machine/rescap.h" +#include "machine/upd7001.h" #include "video/hd44780.h" #include "emupal.h" #include "screen.h" @@ -116,6 +118,8 @@ void alphajuno_state::ajuno1(machine_config &config) //MB87123(config, "dco", 12_MHz_XTAL); + UPD7001(config, "adc", RES_K(27), CAP_P(47)); + // LCD: LM16155A or LM16155B screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); screen.set_refresh_hz(60); diff --git a/src/mame/drivers/px8.cpp b/src/mame/drivers/px8.cpp index 98288519fa8..a925282f4ac 100644 --- a/src/mame/drivers/px8.cpp +++ b/src/mame/drivers/px8.cpp @@ -21,7 +21,7 @@ - display - jumpers - ROM capsule - - uPD7001 + - uPD7001 (controlled by uPD7508) - RAM disk (64K/128K RAM, Z80, 4K ROM) - modem (82C55) - Multi-Unit (60K RAM, ROM capsule, modem, 82C55) @@ -32,6 +32,8 @@ #include "emu.h" #include "includes/px8.h" +#include "machine/rescap.h" +#include "machine/upd7001.h" #include "screen.h" #include "softlist.h" #include "speaker.h" @@ -744,8 +746,8 @@ void px8_state::px8(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &px8_state::px8_mem); m_maincpu->set_addrmap(AS_IO, &px8_state::px8_io); - /* slave cpu (HD6303) */ - m6803_cpu_device &slave(M6803(config, HD6303_TAG, XTAL_CR1 / 4)); /* 614 kHz */ + /* slave cpu (HD6303CA) */ + hd6301_cpu_device &slave(HD6301V1(config, HD6303_TAG, XTAL_CR1 / 4)); /* 614 kHz */ slave.set_addrmap(AS_PROGRAM, &px8_state::px8_slave_mem); slave.set_disable(); @@ -776,7 +778,9 @@ void px8_state::px8(machine_config &config) GENERIC_CARTSLOT(config, "capsule2", generic_plain_slot, "px8_cart", "bin,rom"); /* devices */ - I8251(config, I8251_TAG, 0); + I8251(config, I8251_TAG, XTAL_CR1 / 4); + + UPD7001(config, UPD7001_TAG, RES_K(27), CAP_P(47)); CASSETTE(config, m_cassette); m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED); diff --git a/src/mame/drivers/roland_jx8p.cpp b/src/mame/drivers/roland_jx8p.cpp index 7a6dc1bba17..37136fd1ddb 100644 --- a/src/mame/drivers/roland_jx8p.cpp +++ b/src/mame/drivers/roland_jx8p.cpp @@ -16,8 +16,8 @@ #include "machine/mb63h149.h" #include "machine/nvram.h" //#include "machine/pg800.h" -//#include "machine/rescap.h" -//#include "machine/upd7001.h" +#include "machine/rescap.h" +#include "machine/upd7001.h" class roland_jx8p_state : public driver_device { @@ -32,6 +32,7 @@ public: void jx8p(machine_config &config); void jx8po(machine_config &config); void jx10(machine_config &config); + void mks70(machine_config &config); private: u8 switches_r(offs_t offset); @@ -312,6 +313,10 @@ void roland_jx8p_state::jx8p(machine_config &config) { HD6303R(config, m_assignercpu, 16_MHz_XTAL / 2); // HD63B03RP m_assignercpu->set_addrmap(AS_PROGRAM, &roland_jx8p_state::jx8p_assigner_map); + m_assignercpu->in_p1_cb().set("adc", FUNC(upd7001_device::eoc_so_r)).bit(0); + m_assignercpu->out_p1_cb().set("adc", FUNC(upd7001_device::sck_w)).bit(1); + m_assignercpu->out_p1_cb().append("adc", FUNC(upd7001_device::si_w)).bit(2); + m_assignercpu->out_p1_cb().append("adc", FUNC(upd7001_device::cs_w)).bit(3); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // TC5517APL + battery @@ -320,7 +325,8 @@ void roland_jx8p_state::jx8p(machine_config &config) GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, nullptr, "jx8p_cart"); - //UPD7001(config, "adc", RES_K(27), CAP_P(47)); + upd7001_device &adc(UPD7001(config, "adc", RES_K(27), CAP_P(47))); + adc.dl_w(1); //UPD7537(config, "displaycpu", 400_kHz_XTAL); @@ -338,6 +344,10 @@ void roland_jx8p_state::jx10(machine_config &config) { HD6303R(config, m_assignercpu, 16_MHz_XTAL / 2); // HD63B03RP m_assignercpu->set_addrmap(AS_PROGRAM, &roland_jx8p_state::superjx_assigner_map); + m_assignercpu->in_p1_cb().set("adc", FUNC(upd7001_device::eoc_so_r)).bit(0); + m_assignercpu->out_p1_cb().set("adc", FUNC(upd7001_device::sck_w)).bit(1); + m_assignercpu->out_p1_cb().append("adc", FUNC(upd7001_device::si_w)).bit(2); + m_assignercpu->out_p1_cb().append("adc", FUNC(upd7001_device::cs_w)).bit(3); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // TC5564PL-20 + battery @@ -346,7 +356,8 @@ void roland_jx8p_state::jx10(machine_config &config) GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, nullptr, "jx8p_cart"); - //UPD7001(config, "adc", RES_K(27), CAP_P(47)); + upd7001_device &adc(UPD7001(config, "adc", RES_K(27), CAP_P(47))); + adc.dl_w(1); //UPD7538A(config, "displaycpu", 600_kHz_XTAL); @@ -354,6 +365,16 @@ void roland_jx8p_state::jx10(machine_config &config) SUPERJX_SYNTH(config, "upper", 16_MHz_XTAL / 2); } +void roland_jx8p_state::mks70(machine_config &config) +{ + jx10(config); + + m_assignercpu->in_p1_cb().set_constant(0x01); + m_assignercpu->out_p1_cb().set_nop(); + + config.device_remove("adc"); +} + ROM_START(jx8p) ROM_REGION(0x4000, "assigner", 0) ROM_LOAD("jx8p_a3-1.ic6", 0x0000, 0x4000, CRC(fc566635) SHA1(aa7ce16107553f337eb87bbe6171062950389ea1)) @@ -421,4 +442,4 @@ ROM_END SYST(1985, jx8p, 0, 0, jx8p, jx8p, roland_jx8p_state, empty_init, "Roland", "JX-8P Polyphonic Synthesizer (Ver. 3.x)", MACHINE_IS_SKELETON) SYST(1985, jx8po, jx8p, 0, jx8po, jx8p, roland_jx8p_state, empty_init, "Roland", "JX-8P Polyphonic Synthesizer (Ver. 2.x)", MACHINE_IS_SKELETON) SYST(1986, jx10, 0, 0, jx10, jx10, roland_jx8p_state, empty_init, "Roland", "JX-10 Super JX Polyphonic Synthesizer", MACHINE_IS_SKELETON) -SYST(1987, mks70, jx10, 0, jx10, mks70, roland_jx8p_state, empty_init, "Roland", "MKS-70 Super JX Polyphonic Synthesizer", MACHINE_IS_SKELETON) +SYST(1987, mks70, jx10, 0, mks70, mks70, roland_jx8p_state, empty_init, "Roland", "MKS-70 Super JX Polyphonic Synthesizer", MACHINE_IS_SKELETON) diff --git a/src/mame/drivers/roland_s10.cpp b/src/mame/drivers/roland_s10.cpp index 1710c8a1910..9170ed91b41 100644 --- a/src/mame/drivers/roland_s10.cpp +++ b/src/mame/drivers/roland_s10.cpp @@ -16,6 +16,8 @@ #include "machine/i8251.h" #include "machine/mb63h149.h" #include "machine/nvram.h" +#include "machine/rescap.h" +#include "machine/upd7001.h" #include "video/hd44780.h" #include "emupal.h" #include "screen.h" @@ -165,7 +167,7 @@ void roland_s10_state::s10_ext_map(address_map &map) { mks100_ext_map(map); map(0x5000, 0x57ff).mirror(0x800).rw("keyscan", FUNC(mb63h149_device::read), FUNC(mb63h149_device::write)); - //map(0xb000, 0xb0ff).mirror(0xf00).rw(FUNC(roland_s10_state::upd7001_r), FUNC(mb63h149_device::upd7001_w)); + //map(0xb000, 0xb000).mirror(0xfff).rw(FUNC(roland_s10_state::upd7001_r), FUNC(mb63h149_device::upd7001_w)); } void roland_s220_state::s220_ext_map(address_map &map) @@ -228,7 +230,7 @@ void roland_s10_state::s10(machine_config &config) m_lcdc->set_pixel_update_cb(FUNC(roland_s10_state::lcd_pixel_update)); m_lcdc->set_busy_factor(0.005); - //UPD7001(config, "adc", RES_K(27), CAP_P(47)); + UPD7001(config, "adc", RES_K(27), CAP_P(47)); //RF5C36(config, "wave", 26.88_MHz_XTAL); } @@ -239,7 +241,7 @@ void roland_s10_state::mks100(machine_config &config) m_maincpu->set_addrmap(AS_IO, &roland_s10_state::mks100_ext_map); config.device_remove("keyscan"); - //config.device_remove("adc"); + config.device_remove("adc"); } void roland_s220_state::s220(machine_config &config) @@ -248,7 +250,7 @@ void roland_s220_state::s220(machine_config &config) m_maincpu->set_addrmap(AS_IO, &roland_s220_state::s220_ext_map); config.device_remove("keyscan"); - //config.device_remove("adc"); + config.device_remove("adc"); // LCD unit: LDS7A1681A subdevice<screen_device>("screen")->set_size(6*16, 8*2); diff --git a/src/mame/drivers/ssv.cpp b/src/mame/drivers/ssv.cpp index 5f2a7e4de38..970b12979a1 100644 --- a/src/mame/drivers/ssv.cpp +++ b/src/mame/drivers/ssv.cpp @@ -260,7 +260,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(ssv_state::interrupt) } } -WRITE_LINE_MEMBER(ssv_state::gdfs_adc_int_w) +WRITE_LINE_MEMBER(gdfs_state::adc_int_w) { if (state) { @@ -452,12 +452,12 @@ void ssv_state::drifto94_map(address_map &map) Mobil Suit Gundam Final Shooting ***************************************************************************/ -READ16_MEMBER(ssv_state::gdfs_eeprom_r) +READ16_MEMBER(gdfs_state::eeprom_r) { return m_adc->data_r() | (m_eeprom->do_read() << 8); } -WRITE16_MEMBER(ssv_state::gdfs_eeprom_w) +WRITE16_MEMBER(gdfs_state::eeprom_w) { if (data & ~0x7b00) logerror("%s - Unknown EEPROM bit written %04X\n",machine().describe_context(),data); @@ -482,18 +482,18 @@ WRITE16_MEMBER(ssv_state::gdfs_eeprom_w) } -void ssv_state::gdfs_map(address_map &map) +void gdfs_state::gdfs_map(address_map &map) { ssv_map(map, 0xc00000); - map(0x400000, 0x41ffff).ram().w(FUNC(ssv_state::gdfs_tmapram_w)).share("gdfs_tmapram"); + map(0x400000, 0x41ffff).ram().w(FUNC(gdfs_state::tmapram_w)).share("gdfs_tmapram"); map(0x420000, 0x43ffff).ram(); map(0x440000, 0x44003f).ram().share("gdfs_tmapscroll"); - map(0x500000, 0x500001).w(FUNC(ssv_state::gdfs_eeprom_w)); - map(0x540000, 0x540001).r(FUNC(ssv_state::gdfs_eeprom_r)); + map(0x500000, 0x500001).w(FUNC(gdfs_state::eeprom_w)); + map(0x540000, 0x540001).r(FUNC(gdfs_state::eeprom_r)); map(0x600000, 0x600fff).ram(); - map(0x800000, 0x87ffff).rw(m_gdfs_st0020, FUNC(st0020_device::sprram_r), FUNC(st0020_device::sprram_w)); - map(0x8c0000, 0x8c00ff).rw(m_gdfs_st0020, FUNC(st0020_device::regs_r), FUNC(st0020_device::regs_w)); - map(0x900000, 0x9fffff).rw(m_gdfs_st0020, FUNC(st0020_device::gfxram_r), FUNC(st0020_device::gfxram_w)); + map(0x800000, 0x87ffff).rw(m_st0020, FUNC(st0020_device::sprram_r), FUNC(st0020_device::sprram_w)); + map(0x8c0000, 0x8c00ff).rw(m_st0020, FUNC(st0020_device::regs_r), FUNC(st0020_device::regs_w)); + map(0x900000, 0x9fffff).rw(m_st0020, FUNC(st0020_device::gfxram_r), FUNC(st0020_device::gfxram_w)); } @@ -736,49 +736,46 @@ void ssv_state::survarts_map(address_map &map) ***************************************************************************/ -READ16_MEMBER(ssv_state::sxyreact_ballswitch_r) +READ16_MEMBER(sxyreact_state::ballswitch_r) { - return m_io_service.read_safe(0); + return m_io_service->read(); } -READ16_MEMBER(ssv_state::sxyreact_dial_r) +uint8_t sxyreact_state::dial_r() { - return ((m_sxyreact_serial >> 1) & 0x80); + return m_sxyreact_adc->eoc_so_r() ? 0x80 : 0; } - -WRITE16_MEMBER(ssv_state::sxyreact_dial_w) +void sxyreact_state::dial_w(uint8_t data) { - if (ACCESSING_BITS_0_7) - { - if (data & 0x20) - m_sxyreact_serial = m_io_paddle.read_safe(0) & 0xff; - - if ( (m_sxyreact_dial & 0x40) && !(data & 0x40) ) // $40 -> $00 - m_sxyreact_serial <<= 1; // shift 1 bit - - m_sxyreact_dial = data; - } + m_sxyreact_adc->cs_w(BIT(data, 5)); + m_sxyreact_adc->sck_w(BIT(data, 6)); } -WRITE16_MEMBER(ssv_state::sxyreact_motor_w) +WRITE16_MEMBER(sxyreact_state::motor_w) { // popmessage("%04X",data); // 8 = motor on; 0 = motor off } -void ssv_state::sxyreact_map(address_map &map) +void ssv_state::cairblad_map(address_map &map) { ssv_map(map, 0xe00000); // map(0x020000, 0x03ffff).rw(FUNC(ssv_state::mainram_r), FUNC(ssv_state::mainram_w)); // sxyreac2 reads / writes here, why? map(0x210000, 0x210001).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); // map(0x210002, 0x210003).nopw(); // ? 1 at the start map(0x21000e, 0x21000f).w(FUNC(ssv_state::lockout_inv_w)); // Inverted lockout lines - map(0x500002, 0x500003).r(FUNC(ssv_state::sxyreact_ballswitch_r)); // ? - map(0x500004, 0x500005).rw(FUNC(ssv_state::sxyreact_dial_r), FUNC(ssv_state::sxyreact_motor_w)); // Dial Value (serial) - map(0x520000, 0x520001).w(FUNC(ssv_state::sxyreact_dial_w)); // Dial Value (advance 1 bit) map(0x580000, 0x58ffff).ram().share("nvram"); // NVRAM } +void sxyreact_state::sxyreact_map(address_map &map) +{ + cairblad_map(map); + map(0x500002, 0x500003).r(FUNC(sxyreact_state::ballswitch_r)); // ? + map(0x500004, 0x500004).r(FUNC(sxyreact_state::dial_r)); // Dial Value (serial) + map(0x500004, 0x500005).w(FUNC(sxyreact_state::motor_w)); + map(0x520000, 0x520000).w(FUNC(sxyreact_state::dial_w)); // Dial Value (advance 1 bit) +} + /*************************************************************************** Twin Eagle II @@ -870,12 +867,12 @@ void ssv_state::jsk_v810_mem(address_map &map) Eagle Shot Golf ***************************************************************************/ -WRITE8_MEMBER(ssv_state::eaglshot_gfxrom_bank_w) +void eaglshot_state::gfxrom_bank_w(uint8_t data) { membank("gfxrom")->set_entry(data < 6 ? data : 6); } -WRITE8_MEMBER(ssv_state::eaglshot_trackball_w) +void eaglshot_state::trackball_w(uint8_t data) { // All these get toggled during trackball reads; the precise arrangement is uncertain m_upd4701->cs_w(!BIT(data, 6)); @@ -887,28 +884,28 @@ WRITE8_MEMBER(ssv_state::eaglshot_trackball_w) -READ16_MEMBER(ssv_state::eaglshot_gfxram_r) +uint16_t eaglshot_state::gfxram_r(offs_t offset, uint16_t mem_mask) { - return m_eaglshot_gfxram[offset + (m_scroll[0x76/2] & 0xf) * 0x40000/2]; + return m_gfxram[offset + (m_scroll[0x76/2] & 0xf) * 0x40000/2]; } -WRITE16_MEMBER(ssv_state::eaglshot_gfxram_w) +void eaglshot_state::gfxram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { offset += (m_scroll[0x76/2] & 0xf) * 0x40000/2; - COMBINE_DATA(&m_eaglshot_gfxram[offset]); + COMBINE_DATA(&m_gfxram[offset]); m_gfxdecode->gfx(0)->mark_dirty(offset / (16*8/2)); } -void ssv_state::eaglshot_map(address_map &map) +void eaglshot_state::eaglshot_map(address_map &map) { ssv_map(map, 0xf00000); - map(0x180000, 0x1bffff).rw(FUNC(ssv_state::eaglshot_gfxram_r), FUNC(ssv_state::eaglshot_gfxram_w)); + map(0x180000, 0x1bffff).rw(FUNC(eaglshot_state::gfxram_r), FUNC(eaglshot_state::gfxram_w)); map(0x210000, 0x210001).nopr(); // .r("watchdog", FUNC(watchdog_timer_device::reset16_r)); // Watchdog // map(0x210002, 0x210003).nopw(); // ? 0,4 at the start - map(0x21000e, 0x21000f).w(FUNC(ssv_state::lockout_inv_w)); // Inverted lockout lines - map(0x800000, 0x800000).w(FUNC(ssv_state::eaglshot_gfxrom_bank_w)); - map(0x900000, 0x900000).w(FUNC(ssv_state::eaglshot_trackball_w)); + map(0x21000e, 0x21000f).w(FUNC(eaglshot_state::lockout_inv_w)); // Inverted lockout lines + map(0x800000, 0x800000).w(FUNC(eaglshot_state::gfxrom_bank_w)); + map(0x900000, 0x900000).w(FUNC(eaglshot_state::trackball_w)); map(0xa00000, 0xbfffff).bankr("gfxrom"); map(0xc00000, 0xc007ff).ram().share("nvram"); // NVRAM map(0xd00000, 0xd00000).r(m_upd4701, FUNC(upd4701_device::d_r)); @@ -2539,14 +2536,12 @@ void ssv_state::init_ssv_tilescram() // srmp4 // ((uint16_t *)memregion("maincpu")->base())[0x2b38/2] = 0x037a; /* patch to see gal test mode */ -void ssv_state::init_sexy() +void sxyreact_state::init_sexy() { init_ssv_tilescram(); - save_item(NAME(m_sxyreact_serial)); - save_item(NAME(m_sxyreact_dial)); } -void ssv_state::init_eaglshot() +void eaglshot_state::init_eaglshot() { init_ssv_tilescram(); membank("gfxrom")->configure_entries(0, 6+1, memregion("gfxdata")->base(), 0x200000); @@ -2632,12 +2627,12 @@ void ssv_state::drifto94(machine_config &config) m_screen->set_visarea(0, (0xcd-0x25)*2-1, 0, (0x101-0x13)-1); } -void ssv_state::gdfs(machine_config &config) +void gdfs_state::gdfs(machine_config &config) { ssv(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::gdfs_map); + m_maincpu->set_addrmap(AS_PROGRAM, &gdfs_state::gdfs_map); EEPROM_93C46_16BIT(config, m_eeprom); @@ -2646,18 +2641,16 @@ void ssv_state::gdfs(machine_config &config) m_adc->in_callback<1>().set_ioport("GUNY1"); m_adc->in_callback<2>().set_ioport("GUNX2"); m_adc->in_callback<3>().set_ioport("GUNY2"); - m_adc->eoc_callback().set(FUNC(ssv_state::gdfs_adc_int_w)); + m_adc->eoc_callback().set(FUNC(gdfs_state::adc_int_w)); /* video hardware */ m_screen->set_visarea(0, (0xd5-0x2c)*2-1, 0, (0x102-0x12)-1); - m_screen->set_screen_update(FUNC(ssv_state::screen_update_gdfs)); + m_screen->set_screen_update(FUNC(gdfs_state::screen_update)); - ST0020_SPRITES(config, m_gdfs_st0020, 0); - m_gdfs_st0020->set_palette(m_palette); + ST0020_SPRITES(config, m_st0020, 0); + m_st0020->set_palette(m_palette); m_gfxdecode->set_info(gfx_gdfs); - - MCFG_VIDEO_START_OVERRIDE(ssv_state,gdfs) } void ssv_state::hypreact(machine_config &config) @@ -2827,12 +2820,12 @@ void ssv_state::dynagear(machine_config &config) m_screen->set_visarea(0, (0xd4-0x2c)*2-1, 0, (0x102 - 0x12)-1); } -void ssv_state::eaglshot(machine_config &config) +void eaglshot_state::eaglshot(machine_config &config) { ssv(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::eaglshot_map); + m_maincpu->set_addrmap(AS_PROGRAM, &eaglshot_state::eaglshot_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -2844,39 +2837,45 @@ void ssv_state::eaglshot(machine_config &config) /* video hardware */ m_screen->set_visarea(0, (0xca - 0x2a)*2-1, 0, (0xf6 - 0x16)-1); - m_screen->set_screen_update(FUNC(ssv_state::screen_update_eaglshot)); + m_screen->set_screen_update(FUNC(eaglshot_state::screen_update)); m_gfxdecode->set_info(gfx_eaglshot); - - MCFG_VIDEO_START_OVERRIDE(ssv_state,eaglshot) } -void ssv_state::sxyreact(machine_config &config) +void sxyreact_state::sxyreact(machine_config &config) { ssv(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::sxyreact_map); + m_maincpu->set_addrmap(AS_PROGRAM, &sxyreact_state::sxyreact_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); WATCHDOG_TIMER(config, "watchdog"); + UPD7001(config, m_sxyreact_adc, 1'500'000); // FIXME: runs too fast because CPU doesn't wait long enough + m_sxyreact_adc->a0_callback().set_ioport("PADDLE"); + m_sxyreact_adc->dl_w(1); + m_sxyreact_adc->si_w(0); + /* video hardware */ m_screen->set_visarea(0, (0xcb - 0x22)*2-1, 0, (0xfe - 0x0e)-1); } -void ssv_state::sxyreac2(machine_config &config) +void sxyreact_state::sxyreac2(machine_config &config) { ssv(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::sxyreact_map); + m_maincpu->set_addrmap(AS_PROGRAM, &sxyreact_state::sxyreact_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); WATCHDOG_TIMER(config, "watchdog"); + UPD7001(config, m_sxyreact_adc, 1'500'000); // FIXME: runs too fast because CPU doesn't wait long enough + m_sxyreact_adc->a0_callback().set_ioport("PADDLE"); + /* video hardware */ m_screen->set_visarea(0, (0xcb - 0x23)*2-1, 0, (0xfe - 0x0e)-1); } @@ -2886,7 +2885,7 @@ void ssv_state::cairblad(machine_config &config) ssv(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::sxyreact_map); + m_maincpu->set_addrmap(AS_PROGRAM, &ssv_state::cairblad_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -4850,14 +4849,14 @@ GAME( 1993, survartsj, survarts, survarts, survarts, ssv_state, init_ssv, GAME( 1994, drifto94, 0, drifto94, drifto94, ssv_state, init_ssv, ROT0, "Visco", "Drift Out '94 - The Hard Order (Japan)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1994, eaglshot, 0, eaglshot, eaglshot, ssv_state, init_eaglshot, ROT0, "Sammy", "Eagle Shot Golf (US)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1994, eaglshotj, eaglshot, eaglshot, eaglshot, ssv_state, init_eaglshot, ROT0, "Sammy", "Eagle Shot Golf (Japan, bootleg?)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // from a bootleg ROM board with no proper Seta / Sammy markings, possibly original ROM tho? +GAME( 1994, eaglshot, 0, eaglshot, eaglshot, eaglshot_state, init_eaglshot, ROT0, "Sammy", "Eagle Shot Golf (US)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1994, eaglshotj, eaglshot, eaglshot, eaglshot, eaglshot_state, init_eaglshot, ROT0, "Sammy", "Eagle Shot Golf (Japan, bootleg?)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // from a bootleg ROM board with no proper Seta / Sammy markings, possibly original ROM tho? GAME( 1995, hypreact, 0, hypreact, hypreact, ssv_state, init_ssv, ROT0, "Sammy", "Mahjong Hyper Reaction (Japan)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) GAME( 1994, twineag2, 0, twineag2, twineag2, ssv_state, init_ssv_irq1, ROT270, "Seta", "Twin Eagle II - The Rescue Mission", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1995, gdfs, 0, gdfs, gdfs, ssv_state, init_ssv, ROT0, "Banpresto", "Mobile Suit Gundam Final Shooting (Japan)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // title screen spells the title "Mobil" but standardized spelling is "Mobile" it also lists the company name as "Banprest" instead of "Banpresto" +GAME( 1995, gdfs, 0, gdfs, gdfs, gdfs_state, init_ssv, ROT0, "Banpresto", "Mobile Suit Gundam Final Shooting (Japan)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // title screen spells the title "Mobil" but standardized spelling is "Mobile" it also lists the company name as "Banprest" instead of "Banpresto" // Ultra X Weapon: "developed by Seta" in ending screen GAME( 1995, ultrax, 0, ultrax, ultrax, ssv_state, init_ssv_irq1, ROT270, "Banpresto / Tsuburaya Productions / Seta", "Ultra X Weapons / Ultra Keibitai", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // 95-01-30 13:27:15 on startup @@ -4882,9 +4881,9 @@ GAME( 1997, srmp7, 0, srmp7, srmp7, ssv_state, init_ssv, GAME( 1998, ryorioh, 0, ryorioh, ryorioh, ssv_state, init_ssv, ROT0, "Visco", "Gourmet Battle Quiz Ryohrioh CooKing (Japan)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1998, sxyreact, 0, sxyreact, sxyreact, ssv_state, init_sexy, ROT0, "Sammy", "Pachinko Sexy Reaction (Japan)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1998, sxyreact, 0, sxyreact, sxyreact, sxyreact_state, init_sexy, ROT0, "Sammy", "Pachinko Sexy Reaction (Japan)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1999, sxyreac2, 0, sxyreac2, sxyreact, ssv_state, init_sexy, ROT0, "Sammy", "Pachinko Sexy Reaction 2 (Japan)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1999, sxyreac2, 0, sxyreac2, sxyreact, sxyreact_state, init_sexy, ROT0, "Sammy", "Pachinko Sexy Reaction 2 (Japan)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) GAME( 1999, cairblad, 0, cairblad, cairblad, ssv_state, init_ssv_tilescram, ROT270, "Sammy", "Change Air Blade (Japan)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/ssv.h b/src/mame/includes/ssv.h index 23819cdf9dd..21e2fad64e5 100644 --- a/src/mame/includes/ssv.h +++ b/src/mame/includes/ssv.h @@ -11,6 +11,7 @@ #include "machine/eepromser.h" #include "machine/timer.h" #include "machine/upd4701.h" +#include "machine/upd7001.h" #include "sound/es5506.h" #include "emupal.h" #include "screen.h" @@ -23,29 +24,20 @@ public: driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_ensoniq(*this, "ensoniq"), - m_eeprom(*this, "eeprom"), m_dsp(*this, "dsp"), - m_upd4701(*this, "upd4701"), - m_adc(*this, "adc"), m_mainram(*this, "mainram"), m_spriteram(*this, "spriteram"), m_scroll(*this, "scroll"), m_irq_vectors(*this, "irq_vectors"), - m_gdfs_tmapram(*this, "gdfs_tmapram"), - m_gdfs_tmapscroll(*this, "gdfs_tmapscroll"), - m_gdfs_st0020(*this, "st0020_spr"), m_input_sel(*this, "input_sel"), m_raster_interrupt_enabled(false), m_io_key(*this, "KEY%u", 0U), - m_io_service(*this, "SERVICE"), - m_io_paddle(*this, "PADDLE"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette") { } void ssv(machine_config &config); - void gdfs(machine_config &config); void dynagear(machine_config &config); void hypreac2(machine_config &config); void meosism(machine_config &config); @@ -56,12 +48,9 @@ public: void twineag2(machine_config &config); void ryorioh(machine_config &config); void janjans1(machine_config &config); - void eaglshot(machine_config &config); void survarts(machine_config &config); - void sxyreac2(machine_config &config); void ultrax(machine_config &config); void vasara(machine_config &config); - void sxyreact(machine_config &config); void mslider(machine_config &config); void jsk(machine_config &config); void hypreact(machine_config &config); @@ -71,27 +60,19 @@ public: void init_ssv(); void init_ssv_tilescram(); - void init_eaglshot(); - void init_sexy(); void init_ssv_irq1(); void init_jsk(); void init_pastelis(); -private: +protected: required_device<cpu_device> m_maincpu; required_device<es5506_device> m_ensoniq; - optional_device<eeprom_serial_93cxx_device> m_eeprom; optional_device<upd96050_device> m_dsp; - optional_device<upd4701_device> m_upd4701; - optional_device<adc0808_device> m_adc; required_shared_ptr<uint16_t> m_mainram; required_shared_ptr<uint16_t> m_spriteram; required_shared_ptr<uint16_t> m_scroll; required_shared_ptr<uint16_t> m_irq_vectors; - optional_shared_ptr<uint16_t> m_gdfs_tmapram; - optional_shared_ptr<uint16_t> m_gdfs_tmapscroll; - optional_device<st0020_device> m_gdfs_st0020; optional_shared_ptr<uint16_t> m_input_sel; int m_tile_code[16]; @@ -100,12 +81,8 @@ private: int m_shadow_pen_shift; uint8_t m_requested_int; uint16_t m_irq_enable; - std::unique_ptr<uint16_t[]> m_eaglshot_gfxram; - tilemap_t *m_gdfs_tmap; int m_interrupt_ultrax; bool m_raster_interrupt_enabled; - uint16_t m_sxyreact_serial; - int m_sxyreact_dial; uint32_t m_latches[8]; DECLARE_WRITE16_MEMBER(irq_ack_w); @@ -124,37 +101,19 @@ private: DECLARE_READ16_MEMBER(srmp7_irqv_r); DECLARE_WRITE16_MEMBER(srmp7_sound_bank_w); DECLARE_READ16_MEMBER(srmp7_input_r); - DECLARE_READ16_MEMBER(sxyreact_ballswitch_r); - DECLARE_READ16_MEMBER(sxyreact_dial_r); - DECLARE_WRITE16_MEMBER(sxyreact_dial_w); - DECLARE_WRITE16_MEMBER(sxyreact_motor_w); DECLARE_READ32_MEMBER(latch32_r); DECLARE_WRITE32_MEMBER(latch32_w); DECLARE_READ16_MEMBER(latch16_r); DECLARE_WRITE16_MEMBER(latch16_w); - DECLARE_WRITE8_MEMBER(eaglshot_gfxrom_bank_w); - DECLARE_WRITE8_MEMBER(eaglshot_trackball_w); - DECLARE_READ16_MEMBER(eaglshot_gfxram_r); - DECLARE_WRITE16_MEMBER(eaglshot_gfxram_w); - DECLARE_WRITE16_MEMBER(gdfs_tmapram_w); DECLARE_READ16_MEMBER(vblank_r); DECLARE_WRITE16_MEMBER(scroll_w); - DECLARE_READ16_MEMBER(gdfs_eeprom_r); - DECLARE_WRITE16_MEMBER(gdfs_eeprom_w); - - TILE_GET_INFO_MEMBER(get_tile_info_0); virtual void machine_reset() override; virtual void video_start() override; - DECLARE_VIDEO_START(gdfs); - DECLARE_VIDEO_START(eaglshot); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_gdfs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_eaglshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); - DECLARE_WRITE_LINE_MEMBER(gdfs_adc_int_w); void update_irq_state(); IRQ_CALLBACK_MEMBER(irq_callback); @@ -170,11 +129,10 @@ private: void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void enable_video(int enable); + void cairblad_map(address_map &map); void drifto94_map(address_map &map); void dsp_data_map(address_map &map); void dsp_prg_map(address_map &map); - void eaglshot_map(address_map &map); - void gdfs_map(address_map &map); void hypreac2_map(address_map &map); void hypreact_map(address_map &map); void janjans1_map(address_map &map); @@ -187,13 +145,10 @@ private: void srmp4_map(address_map &map); void srmp7_map(address_map &map); void survarts_map(address_map &map); - void sxyreact_map(address_map &map); void twineag2_map(address_map &map); void ultrax_map(address_map &map); optional_ioport_array<4> m_io_key; - optional_ioport m_io_service; - optional_ioport m_io_paddle; required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; @@ -201,4 +156,98 @@ private: void ssv_map(address_map &map, u32 rom); }; +class gdfs_state : public ssv_state +{ +public: + gdfs_state(const machine_config &mconfig, device_type type, const char *tag) : + ssv_state(mconfig, type, tag), + m_adc(*this, "adc"), + m_eeprom(*this, "eeprom"), + m_st0020(*this, "st0020_spr"), + m_tmapram(*this, "gdfs_tmapram"), + m_tmapscroll(*this, "gdfs_tmapscroll") + { } + + void gdfs(machine_config &config); + +protected: + virtual void video_start() override; + +private: + DECLARE_WRITE_LINE_MEMBER(adc_int_w); + + DECLARE_READ16_MEMBER(eeprom_r); + DECLARE_WRITE16_MEMBER(eeprom_w); + + void gdfs_map(address_map &map); + + TILE_GET_INFO_MEMBER(get_tile_info_0); + void tmapram_w(offs_t offset, uint16_t data, uint16_t mem_mask); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + required_device<adc0808_device> m_adc; + required_device<eeprom_serial_93cxx_device> m_eeprom; + required_device<st0020_device> m_st0020; + required_shared_ptr<uint16_t> m_tmapram; + required_shared_ptr<uint16_t> m_tmapscroll; + + tilemap_t *m_tmap; +}; + +class eaglshot_state : public ssv_state +{ +public: + eaglshot_state(const machine_config &mconfig, device_type type, const char *tag) : + ssv_state(mconfig, type, tag), + m_upd4701(*this, "upd4701") + { } + + void eaglshot(machine_config &config); + + void init_eaglshot(); + +protected: + virtual void video_start() override; + +private: + void gfxrom_bank_w(uint8_t data); + void trackball_w(uint8_t data); + uint16_t gfxram_r(offs_t offset, uint16_t mem_mask); + void gfxram_w(offs_t offset, uint16_t data, uint16_t mem_mask); + + void eaglshot_map(address_map &map); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + required_device<upd4701_device> m_upd4701; + + std::unique_ptr<uint16_t[]> m_gfxram; +}; + +class sxyreact_state : public ssv_state +{ +public: + sxyreact_state(const machine_config &mconfig, device_type type, const char *tag) : + ssv_state(mconfig, type, tag), + m_sxyreact_adc(*this, "adc"), + m_io_service(*this, "SERVICE") + { } + + void sxyreact(machine_config &config); + void sxyreac2(machine_config &config); + + void init_sexy(); + +private: + DECLARE_READ16_MEMBER(ballswitch_r); + uint8_t dial_r(); + void dial_w(uint8_t data); + DECLARE_WRITE16_MEMBER(motor_w); + + void sxyreact_map(address_map &map); + + required_device<upd7001_device> m_sxyreact_adc; + required_ioport m_io_service; +}; + #endif // MAME_INCLUDES_SSV_H diff --git a/src/mame/video/ssv.cpp b/src/mame/video/ssv.cpp index 1bbfd96cab8..b1cd23169d3 100644 --- a/src/mame/video/ssv.cpp +++ b/src/mame/video/ssv.cpp @@ -212,37 +212,37 @@ void ssv_state::video_start() save_item(NAME(m_shadow_pen_shift)); } -VIDEO_START_MEMBER(ssv_state,eaglshot) +void eaglshot_state::video_start() { ssv_state::video_start(); - m_eaglshot_gfxram = std::make_unique<uint16_t[]>(16 * 0x40000 / 2); + m_gfxram = std::make_unique<uint16_t[]>(16 * 0x40000 / 2); - m_gfxdecode->gfx(0)->set_source((uint8_t *)m_eaglshot_gfxram.get()); + m_gfxdecode->gfx(0)->set_source((uint8_t *)m_gfxram.get()); - save_pointer(NAME(m_eaglshot_gfxram), 16 * 0x40000 / 2); + save_pointer(NAME(m_gfxram), 16 * 0x40000 / 2); } -TILE_GET_INFO_MEMBER(ssv_state::get_tile_info_0) +TILE_GET_INFO_MEMBER(gdfs_state::get_tile_info_0) { - uint16_t tile = m_gdfs_tmapram[tile_index]; + uint16_t tile = m_tmapram[tile_index]; tileinfo.set(1, tile, 0, TILE_FLIPXY( tile >> 14 )); } -WRITE16_MEMBER(ssv_state::gdfs_tmapram_w) +void gdfs_state::tmapram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - COMBINE_DATA(&m_gdfs_tmapram[offset]); - m_gdfs_tmap->mark_tile_dirty(offset); + COMBINE_DATA(&m_tmapram[offset]); + m_tmap->mark_tile_dirty(offset); } -VIDEO_START_MEMBER(ssv_state,gdfs) +void gdfs_state::video_start() { ssv_state::video_start(); - m_gdfs_tmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ssv_state::get_tile_info_0)), TILEMAP_SCAN_ROWS, 16,16, 0x100,0x100); + m_tmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gdfs_state::get_tile_info_0)), TILEMAP_SCAN_ROWS, 16,16, 0x100,0x100); - m_gdfs_tmap->set_transparent_pen(0); + m_tmap->set_transparent_pen(0); } /*************************************************************************** @@ -939,21 +939,21 @@ void ssv_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) ***************************************************************************/ -uint32_t ssv_state::screen_update_eaglshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t eaglshot_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - return screen_update(screen, bitmap, cliprect); + return ssv_state::screen_update(screen, bitmap, cliprect); } -uint32_t ssv_state::screen_update_gdfs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t gdfs_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - screen_update(screen, bitmap, cliprect); + ssv_state::screen_update(screen, bitmap, cliprect); // draw zooming sprites - m_gdfs_st0020->update_screen(screen, bitmap, cliprect, false); + m_st0020->update_screen(screen, bitmap, cliprect, false); - m_gdfs_tmap->set_scrollx(0, m_gdfs_tmapscroll[0x0c/2]); - m_gdfs_tmap->set_scrolly(0, m_gdfs_tmapscroll[0x10/2]); - m_gdfs_tmap->draw(screen, bitmap, cliprect, 0, 0); + m_tmap->set_scrollx(0, m_tmapscroll[0x0c/2]); + m_tmap->set_scrolly(0, m_tmapscroll[0x10/2]); + m_tmap->draw(screen, bitmap, cliprect, 0, 0); return 0; } |