From fd9c369c3967e0662c48dbece5dca8bcabc87f5c Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 5 Jul 2021 19:14:46 +0200 Subject: sbmjb.cpp: tentatively hooked up most devices. Attract mode runs fine but need hopper emulation before it can be playable --- src/mame/drivers/sbmjb.cpp | 68 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/src/mame/drivers/sbmjb.cpp b/src/mame/drivers/sbmjb.cpp index e9b8f6522f7..39e21f4b0b6 100644 --- a/src/mame/drivers/sbmjb.cpp +++ b/src/mame/drivers/sbmjb.cpp @@ -20,6 +20,12 @@ various unpopulated IC spaces (marked M66011FP, M66230FP, M66240FP, M66300FP, uPD4701A, 2 TLP521-4) no dips + TODO: + - everything is guesswork and should be taken with a grain of salt, especially the M66220FP hook up; + - are the correct sounds played at the right times? + - hopper / medal (main roadblock before it can be considered playable); + - at boot the game zero-fills the 0x020000-0x020fff range in the tc0091lvc VRAM space, which is currently unmapped in tc009xlvc.cpp. + Doesn't seem to use it afterwards, though. */ #include "emu.h" @@ -32,6 +38,9 @@ #include "screen.h" #include "speaker.h" + +namespace { + class sbmjb_state : public driver_device { public: @@ -55,6 +64,7 @@ private: void tc0091lvc_map(address_map &map); }; + WRITE_LINE_MEMBER(sbmjb_state::screen_vblank) // TODO: copy-pasted from other drivers using same chip, to be verified { if (state) @@ -68,6 +78,10 @@ void sbmjb_state::main_map(address_map &map) { map(0x0000, 0x7fff).rom().region("maincpu", 0); map(0xc000, 0xdfff).ram(); + map(0xe000, 0xe0ff).ram().share("m66220fp0"); // TODO: really? + map(0xe100, 0xe7ff).ram(); + map(0xe800, 0xe8ff).ram().share("m66220fp1"); // TODO: really? + map(0xe900, 0xefff).ram(); map(0xf000, 0xf00f).rw("io", FUNC(te7751_device::read), FUNC(te7751_device::write)); } @@ -75,10 +89,15 @@ void sbmjb_state::sound_map(address_map &map) { map(0x0000, 0x7fff).rom().region("audiocpu", 0); map(0xc000, 0xdfff).ram(); + map(0xe000, 0xe0ff).ram().share("m66220fp1"); + map(0xf000, 0xf001).rw("opn", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); + map(0xf800, 0xf800).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); } void sbmjb_state::tc0091lvc_map(address_map &map) // TODO: copy-pasted from other drivers using same chip, to be verified { + map(0x8000, 0x9fff).ram(); + map(0xa000, 0xa0ff).ram().share("m66220fp0"); map(0xfe00, 0xfeff).rw(m_vdpcpu, FUNC(tc0091lvc_device::vregs_r), FUNC(tc0091lvc_device::vregs_w)); map(0xff00, 0xff02).rw(m_vdpcpu, FUNC(tc0091lvc_device::irq_vector_r), FUNC(tc0091lvc_device::irq_vector_w)); map(0xff03, 0xff03).rw(m_vdpcpu, FUNC(tc0091lvc_device::irq_enable_r), FUNC(tc0091lvc_device::irq_enable_w)); @@ -86,12 +105,27 @@ void sbmjb_state::tc0091lvc_map(address_map &map) // TODO: copy-pasted from othe map(0xff08, 0xff08).rw(m_vdpcpu, FUNC(tc0091lvc_device::rom_bank_r), FUNC(tc0091lvc_device::rom_bank_w)); } -static INPUT_PORTS_START( sbmjb ) + +static INPUT_PORTS_START( sbmjb ) // no dips on PCB, game options selectable in test mode PORT_START("IN0") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet 5") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Bet 3") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Bet 2") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Choki") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Guu") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // No effect in test mode + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // No effect in test mode + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Paa")// Also used to confirm in test mode PORT_START("IN1") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // Also used to select in test mode + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) // Hopper Sensor, active high or it will stop booting due to hopper related problems + PORT_SERVICE( 0x04, IP_ACTIVE_LOW ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("100 Yen Switch") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 ) // TODO: active high doesn't allow coining in but it also doesn't cause the medal in error + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 ) // TODO: active high doesn't allow coining in but it also doesn't cause the medal in error + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // No effect in test mode + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // No effect in test mode INPUT_PORTS_END @@ -101,25 +135,22 @@ TIMER_DEVICE_CALLBACK_MEMBER(sbmjb_state::scanline_callback) // TODO: copy-paste if (scanline == 240 && (m_vdpcpu->irq_enable() & 4)) { - m_vdpcpu->set_input_line_and_vector(0, HOLD_LINE, m_vdpcpu->irq_vector(2)); // TC0091LVC + m_vdpcpu->set_input_line_and_vector(0, HOLD_LINE, m_vdpcpu->irq_vector(2)); } if (scanline == 0 && (m_vdpcpu->irq_enable() & 2)) { - m_vdpcpu->set_input_line_and_vector(0, HOLD_LINE, m_vdpcpu->irq_vector(1)); // TC0091LVC - } - - if (scanline == 196 && (m_vdpcpu->irq_enable() & 1)) - { - //m_vdpcpu->set_input_line_and_vector(0, HOLD_LINE, m_vdpcpu->irq_vector(0)); // TC0091LVC + m_vdpcpu->set_input_line_and_vector(0, HOLD_LINE, m_vdpcpu->irq_vector(1)); } } + void sbmjb_state::sbmjb(machine_config &config) { // basic machine hardware Z80(config, m_maincpu, 8_MHz_XTAL / 2); // divider not verified m_maincpu->set_addrmap(AS_PROGRAM, &sbmjb_state::main_map); + m_maincpu->set_vblank_int("screen", FUNC(sbmjb_state::irq0_line_hold)); z80_device &audiocpu(Z80(config, "audiocpu", 8_MHz_XTAL / 2)); // divider not verified, but marked as 4MHz on PCB audiocpu.set_addrmap(AS_PROGRAM, &sbmjb_state::sound_map); @@ -129,7 +160,10 @@ void sbmjb_state::sbmjb(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(sbmjb_state::scanline_callback), "screen", 0, 1); - TE7751(config, "io"); + te7751_device & io(TE7751(config, "io")); + io.in_port1_cb().set_ioport("IN0"); + io.in_port2_cb().set_ioport("IN1"); + // TODO: rest of ports. port9 medal / hopper? // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // all wrong @@ -144,8 +178,7 @@ void sbmjb_state::sbmjb(machine_config &config) // sound hardware SPEAKER(config, "mono").front_center(); ym2203_device &opn(YM2203(config, "opn", 8_MHz_XTAL / 2)); // divider not verified - //opn.port_a_read_callback().set_ioport("IN0"); - //opn.port_b_read_callback().set_ioport("IN1"); + opn.irq_handler().set_inputline("audiocpu", 0); opn.add_route(ALL_OUTPUTS, "mono", 0.30); OKIM6295(config, "oki", 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // pin not verified @@ -153,13 +186,13 @@ void sbmjb_state::sbmjb(machine_config &config) ROM_START( sbmjb ) // all labels were peeled off / unreadable - ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_REGION( 0x10000, "maincpu", 0 ) // Main ver. 1.1 1998/08/25 ROM_LOAD( "mprog.ic12", 0x00000, 0x10000, CRC(d11f14eb) SHA1(29c4b8e3ebb9ff3c5630c7bb3c8224a2f57e8fe8) ) // 1xxxxxxxxxxxxxxx = 0xFF ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "sndprog.ic5", 0x00000, 0x10000, CRC(e41575f1) SHA1(66ab1b81a618fe5e676b4f8768a5bee8d189de58) ) // 1xxxxxxxxxxxxxxx = 0xFF - ROM_REGION( 0x80000, "vdpcpu", 0 ) + ROM_REGION( 0x80000, "vdpcpu", 0 ) // Video ver. 1.0 1998/06/01 ROM_LOAD( "videoprg.ic52", 0x00000, 0x80000, CRC(21ebc096) SHA1(12f0ad4530560782a5b7517557d68526a51091e1) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF ROM_REGION( 0x100000, "vdpcpu:gfx", 0 ) @@ -174,4 +207,7 @@ ROM_START( sbmjb ) // all labels were peeled off / unreadable ROM_LOAD( "e41-03.ic24", 0x200, 0x117, CRC(d906c8ea) SHA1(eae9c9c25b4affe4baf7ba034c61670d24f5c4d1) ) ROM_END -GAME( 1998, sbmjb, 0, sbmjb, sbmjb, sbmjb_state, empty_init, ROT0, "Taito", "Sonic Blast Man's Janken Battle", MACHINE_IS_SKELETON ) +} // Anonymous namespace + + +GAME( 1998, sbmjb, 0, sbmjb, sbmjb, sbmjb_state, empty_init, ROT0, "Taito", "Sonic Blast Man's Janken Battle (main ver. 1.1, video ver. 1.0)", MACHINE_NOT_WORKING ) -- cgit v1.2.3