From 7147a9a63d468cfa88740ed8269c954e441eeb77 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Sun, 5 Jul 2020 04:21:07 +1000 Subject: ondra: cleanup, added sound. --- scripts/target/mame/mess.lua | 1 - src/mame/drivers/ondra.cpp | 193 +++++++++++++++++++++++++------------------ src/mame/includes/ondra.h | 62 +++++++------- src/mame/machine/ondra.cpp | 131 ++++++++++++++++++----------- src/mame/video/ondra.cpp | 47 ----------- 5 files changed, 226 insertions(+), 208 deletions(-) delete mode 100644 src/mame/video/ondra.cpp diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 14e43e370ff..641676290a8 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -3776,7 +3776,6 @@ files { MAME_DIR .. "src/mame/drivers/ondra.cpp", MAME_DIR .. "src/mame/includes/ondra.h", MAME_DIR .. "src/mame/machine/ondra.cpp", - MAME_DIR .. "src/mame/video/ondra.cpp", MAME_DIR .. "src/mame/drivers/pmd85.cpp", MAME_DIR .. "src/mame/includes/pmd85.h", MAME_DIR .. "src/mame/machine/pmd85.cpp", diff --git a/src/mame/drivers/ondra.cpp b/src/mame/drivers/ondra.cpp index 4b24420ba71..b97086182c6 100644 --- a/src/mame/drivers/ondra.cpp +++ b/src/mame/drivers/ondra.cpp @@ -1,119 +1,153 @@ // license:BSD-3-Clause // copyright-holders:Miodrag Milanovic -/*************************************************************************** +/***************************************************************************** - Ondra driver by Miodrag Milanovic +Ondra driver by Miodrag Milanovic - 08/09/2008 Preliminary driver. +2008-09-08 Preliminary driver. -****************************************************************************/ +ToDo: +- Paste/Natural keyboard are useless because 3rd modifier key is not supported. +- Add 2x i8253 pits which are part of the video timing circuit. They are not + connected to the data bus, and are always selected. +- The video is somewhat similar to the standard super80, in that the CPU is + turned off by BUSRQ about half the time, so that the video can be drawn + without causing snow. The CPU can gain full control by disabling the video. +- Sound is a speaker connected to a multivibrator circuit. There are 3 diodes + from this circuit to allow a choice of 7 frequencies. We have used a buzzer + with selected arbitrary frequencies, not having any idea what they should be. +- Ondrav doesn't seem to accept any commands, only producing KOD 1 followed + by halt. You have to press Esc before trying again. +- Cassette not working. Doesn't load from softlist, and don't know how to save. + +******************************************************************************/ #include "emu.h" #include "includes/ondra.h" - #include "cpu/z80/z80.h" -#include "imagedev/cassette.h" -#include "machine/ram.h" #include "emupal.h" #include "screen.h" -#include "softlist.h" #include "speaker.h" /* Address maps */ -void ondra_state::ondra_mem(address_map &map) +void ondra_state::mem_map(address_map &map) { map(0x0000, 0x3fff).bankrw("bank1"); map(0x4000, 0xdfff).bankrw("bank2"); map(0xe000, 0xffff).bankrw("bank3"); } -void ondra_state::ondra_io(address_map &map) +void ondra_state::io_map(address_map &map) { - map.global_mask(0x0b); + //map.global_mask(0x0b); map.unmap_value_high(); - map(0x03, 0x03).w(FUNC(ondra_state::ondra_port_03_w)); - //map(0x09, 0x09).w(FUNC(ondra_state::ondra_port_09_w); - //map(0x0a, 0x0a).w(FUNC(ondra_state::ondra_port_0a_w); + map(0x03, 0x03).mirror(0xff00).w(FUNC(ondra_state::port03_w)); + //map(0x09, 0x09).mirror(0xff00).r(FUNC(ondra_state::port09_r)); + map(0x0a, 0x0a).mirror(0xff00).w(FUNC(ondra_state::port0a_w)); } /* Input ports */ static INPUT_PORTS_START( ondra ) PORT_START("LINE0") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) - PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R 4 $") PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r') PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E 3 #") PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e') PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W 2 \"") PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w') PORT_CHAR('2') PORT_CHAR('\"') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T 5 %") PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t') PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q 1 !") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q') PORT_CHAR('1') PORT_CHAR('!') PORT_START("LINE1") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) - PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F ^") PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f') PORT_CHAR('^') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D =") PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d') PORT_CHAR('=') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S +") PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s') PORT_CHAR('+') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G _") PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g') PORT_CHAR('_') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A -") PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a') PORT_CHAR('-') PORT_START("LINE2") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_RSHIFT) - PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C :") PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c') PORT_CHAR(':') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X /") PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x') PORT_CHAR('/') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z *") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z') PORT_CHAR('*') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V ;") PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v') PORT_CHAR(';') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_RSHIFT) //PORT_CHAR(UCHAR_SHIFT_3) not supported yet PORT_START("LINE3") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("LINE4") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0-9") PORT_CODE(KEYCODE_RALT) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0-9") PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_SHIFT_2) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CS") PORT_CODE(KEYCODE_LALT) PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("UpCase") PORT_CODE(KEYCODE_LSHIFT) - PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("UpCase") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) PORT_START("LINE5") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J >") PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j') PORT_CHAR('>') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K [") PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k') PORT_CHAR('[') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L ]") PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l') PORT_CHAR(']') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H <") PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h') PORT_CHAR('<') PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) - PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("LINE6") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) - PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U 7 \'") PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u') PORT_CHAR('7') PORT_CHAR('\'') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I 8 (") PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i') PORT_CHAR('8') PORT_CHAR('(') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O 9 )") PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o') PORT_CHAR('9') PORT_CHAR(')') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y 6 &") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y') PORT_CHAR('6') PORT_CHAR('&') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P 0 @") PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p') PORT_CHAR('0') PORT_CHAR('@') PORT_START("LINE7") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N ,") PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n') PORT_CHAR(',') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M .") PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m') PORT_CHAR('.') PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Up") PORT_CODE(KEYCODE_UP) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B ?") PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b') PORT_CHAR('?') PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) - PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("LINE8") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Down") PORT_CODE(KEYCODE_DOWN) PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) - PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("LINE9") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_CODE(KEYCODE_2_PAD) PORT_CODE(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(1) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_CODE(KEYCODE_4_PAD) PORT_CODE(JOYCODE_X_LEFT_SWITCH) PORT_PLAYER(1) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_CODE(KEYCODE_8_PAD) PORT_CODE(JOYCODE_Y_UP_SWITCH) PORT_PLAYER(1) PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_PLAYER(1) PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT)PORT_CODE(KEYCODE_6_PAD) PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) - PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("NMI") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("NMI") PORT_CODE(KEYCODE_ESC) + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("NMI") PORT_CODE(KEYCODE_ESC) PORT_CHANGED_MEMBER(DEVICE_SELF, ondra_state, nmi_button, 0) INPUT_PORTS_END +INPUT_CHANGED_MEMBER(ondra_state::nmi_button) +{ + m_maincpu->set_input_line(INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE); +} + +u32 ondra_state::screen_update_ondra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + u8 *r = m_ram->pointer(); + + u8 code1=0,code2=0; + int y, x, b; + int Vaddr = 0x2800; + + for (x = 0; x < 40; x++) + { + for (y = 127; y >=0; y--) + { + if (m_video_enable) + { + code1 = r[0xd700 + Vaddr + 0x80]; + code2 = r[0xd700 + Vaddr + 0x00]; + } + for (b = 0; b < 8; b++) + { + bitmap.pix16(2*y, x*8+b) = ((code1 << b) & 0x80) ? 1 : 0; + bitmap.pix16(2*y+1, x*8+b) = ((code2 << b) & 0x80) ? 1 : 0; + } + Vaddr++; + } + Vaddr = (Vaddr - 128) - 256; + } + return 0; +} + WRITE_LINE_MEMBER(ondra_state::vblank_irq) { if (state) @@ -124,9 +158,9 @@ WRITE_LINE_MEMBER(ondra_state::vblank_irq) void ondra_state::ondra(machine_config &config) { /* basic machine hardware */ - Z80(config, m_maincpu, 2000000); - m_maincpu->set_addrmap(AS_PROGRAM, &ondra_state::ondra_mem); - m_maincpu->set_addrmap(AS_IO, &ondra_state::ondra_io); + Z80(config, m_maincpu, 8_MHz_XTAL / 4); + m_maincpu->set_addrmap(AS_PROGRAM, &ondra_state::mem_map); + m_maincpu->set_addrmap(AS_IO, &ondra_state::io_map); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -140,12 +174,13 @@ void ondra_state::ondra(machine_config &config) PALETTE(config, "palette", palette_device::MONOCHROME); - // sound hardware SPEAKER(config, "mono").front_center(); + BEEP(config, m_beep, 950); // guess + m_beep->add_route(ALL_OUTPUTS, "mono", 0.25); CASSETTE(config, m_cassette); - m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED); + m_cassette->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED); m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); m_cassette->set_interface("ondra_cass"); @@ -158,31 +193,31 @@ void ondra_state::ondra(machine_config &config) /* ROM definition */ ROM_START( ondrat ) - ROM_REGION( 0x14000, "maincpu", ROMREGION_ERASEFF ) - ROM_LOAD( "tesla_a.rom", 0x10000, 0x0800, CRC(6d56b815) SHA1(7feb4071d5142e4c2f891747b75fa4d48ccad262) ) - ROM_COPY( "maincpu", 0x10000, 0x10800, 0x0800 ) - ROM_COPY( "maincpu", 0x10000, 0x11000, 0x0800 ) - ROM_COPY( "maincpu", 0x10000, 0x11800, 0x0800 ) - ROM_LOAD( "tesla_b.rom", 0x12000, 0x0800, CRC(5f145eaa) SHA1(c1eac68b13fedc4d0d6f98b15e2a5397f0139dc3) ) - ROM_COPY( "maincpu", 0x10000, 0x12800, 0x0800 ) - ROM_COPY( "maincpu", 0x10000, 0x13000, 0x0800 ) - ROM_COPY( "maincpu", 0x10000, 0x13800, 0x0800 ) + ROM_REGION( 0x4000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "tesla_a.d22", 0x0000, 0x0800, CRC(6d56b815) SHA1(7feb4071d5142e4c2f891747b75fa4d48ccad262) ) + ROM_LOAD( "tesla_b.d21", 0x2000, 0x0800, CRC(5f145eaa) SHA1(c1eac68b13fedc4d0d6f98b15e2a5397f0139dc3) ) + + ROM_REGION( 0x0040, "proms", 0 ) + ROM_LOAD( "mh74188.d27", 0x0000, 0x0040, CRC(7faceafe) SHA1(597f867e38b1c66d4622662cb01b3aefa680f234) ) ROM_END ROM_START( ondrav ) - ROM_REGION( 0x14000, "maincpu", ROMREGION_ERASEFF ) - ROM_LOAD( "vili_a.rom", 0x10000, 0x0800, CRC(76932657) SHA1(1f3700f670f158e4bed256aed751e2c1331a28e8) ) - ROM_COPY( "maincpu", 0x10000, 0x10800, 0x0800 ) - ROM_COPY( "maincpu", 0x10000, 0x11000, 0x0800 ) - ROM_COPY( "maincpu", 0x10000, 0x11800, 0x0800 ) - ROM_LOAD( "vili_b.rom", 0x12000, 0x0800, CRC(03a6073f) SHA1(66f198e63f473e09350bcdbb10fe0cf440111bec) ) - ROM_COPY( "maincpu", 0x10000, 0x12800, 0x0800 ) - ROM_COPY( "maincpu", 0x10000, 0x13000, 0x0800 ) - ROM_COPY( "maincpu", 0x10000, 0x13800, 0x0800 ) + ROM_REGION( 0x4000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "vili_a.d22", 0x0000, 0x0800, CRC(76932657) SHA1(1f3700f670f158e4bed256aed751e2c1331a28e8) ) + ROM_RELOAD(0x0800, 0x0800) + ROM_RELOAD(0x1000, 0x0800) + ROM_RELOAD(0x1800, 0x0800) + ROM_LOAD( "vili_b.d21", 0x2000, 0x0800, CRC(03a6073f) SHA1(66f198e63f473e09350bcdbb10fe0cf440111bec) ) + ROM_RELOAD(0x2800, 0x0800) + ROM_RELOAD(0x3000, 0x0800) + ROM_RELOAD(0x3800, 0x0800) + + ROM_REGION( 0x0040, "proms", 0 ) + ROM_LOAD( "mh74188.d27", 0x0000, 0x0040, CRC(7faceafe) SHA1(597f867e38b1c66d4622662cb01b3aefa680f234) ) ROM_END /* Driver */ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1989, ondrat, 0, 0, ondra, ondra, ondra_state, empty_init, "Tesla", "Ondra", 0 ) -COMP( 1989, ondrav, ondrat, 0, ondra, ondra, ondra_state, empty_init, "ViLi", "Ondra ViLi", 0 ) +COMP( 1989, ondrat, 0, 0, ondra, ondra, ondra_state, empty_init, "Tesla", "Ondra", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +COMP( 1989, ondrav, ondrat, 0, ondra, ondra, ondra_state, empty_init, "ViLi", "Ondra ViLi", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/ondra.h b/src/mame/includes/ondra.h index b1021b1f900..c3ec2d4a9b4 100644 --- a/src/mame/includes/ondra.h +++ b/src/mame/includes/ondra.h @@ -11,63 +11,57 @@ #pragma once #include "imagedev/cassette.h" +#include "sound/beep.h" #include "machine/ram.h" class ondra_state : public driver_device { public: - ondra_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_video_enable(0), - m_bank1_status(0), - m_bank2_status(0), - m_nmi_check_timer(nullptr), - m_maincpu(*this, "maincpu"), - m_cassette(*this, "cassette"), - m_ram(*this, RAM_TAG), - m_region_maincpu(*this, "maincpu"), - m_bank1(*this, "bank1"), - m_bank2(*this, "bank2"), - m_bank3(*this, "bank3"), - m_lines(*this, "LINE%u", 0), - m_nmi(*this, "NMI") - { - } + ondra_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_cassette(*this, "cassette") + , m_ram(*this, RAM_TAG) + , m_rom(*this, "maincpu") + , m_bank1(*this, "bank1") + , m_bank2(*this, "bank2") + , m_bank3(*this, "bank3") + , m_beep(*this, "beeper") + , m_io_keyboard(*this, "LINE%u", 0U) + { } void ondra(machine_config &config); + DECLARE_INPUT_CHANGED_MEMBER(nmi_button); private: - uint8_t ondra_keyboard_r(offs_t offset); - void ondra_port_03_w(uint8_t data); - void ondra_port_09_w(uint8_t data); - void ondra_port_0a_w(uint8_t data); - uint32_t screen_update_ondra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u8 keyboard_r(offs_t offset); + void port03_w(u8 data); + u8 port09_r(); + void port0a_w(u8 data); + u32 screen_update_ondra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(vblank_irq); - TIMER_CALLBACK_MEMBER(nmi_check_callback); - void ondra_io(address_map &map); - void ondra_mem(address_map &map); + void io_map(address_map &map); + void mem_map(address_map &map); virtual void machine_start() override; virtual void machine_reset() override; - virtual void video_start() override; - void ondra_update_banks(); + void update_banks(); - uint8_t m_video_enable; - uint8_t m_bank1_status; - uint8_t m_bank2_status; - emu_timer *m_nmi_check_timer; + bool m_video_enable; + u8 m_bank_status; + u8 m_bank_old; required_device m_maincpu; required_device m_cassette; required_device m_ram; - required_memory_region m_region_maincpu; + required_memory_region m_rom; required_memory_bank m_bank1; required_memory_bank m_bank2; required_memory_bank m_bank3; - required_ioport_array<10> m_lines; - required_ioport m_nmi; + required_device m_beep; + required_ioport_array<10> m_io_keyboard; }; #endif // MAME_INCLUDES_ONDRA_H diff --git a/src/mame/machine/ondra.cpp b/src/mame/machine/ondra.cpp index 35614a3f950..75c9875f9a5 100644 --- a/src/mame/machine/ondra.cpp +++ b/src/mame/machine/ondra.cpp @@ -12,81 +12,118 @@ #include "emu.h" #include "includes/ondra.h" -#include "cpu/z80/z80.h" - -uint8_t ondra_state::ondra_keyboard_r(offs_t offset) +u8 ondra_state::keyboard_r(offs_t offset) { - uint8_t retVal = 0x00; + u8 data = 0x60; + offset &= 15; - double const valcas = m_cassette->input(); - if (valcas < 0.00) - retVal |= 0x80; + data |= (m_cassette->input() < 0.00) ? 0x80: 0; - if ((offset & 0x0f) < m_lines.size()) - retVal |= m_lines[offset & 0x0f]->read(); + if (offset < m_io_keyboard.size()) + data |= (m_io_keyboard[offset]->read() & 0x1f); else - retVal |= 0x1f; + data |= 0x1f; - return retVal; + return data; } -void ondra_state::ondra_update_banks() +void ondra_state::update_banks() { address_space &space = m_maincpu->space(AS_PROGRAM); - uint8_t *mem = m_region_maincpu->base(); - - if (m_bank1_status==0) { - space.unmap_write(0x0000, 0x3fff); - m_bank1->set_base(mem + 0x010000); - } else { - space.install_write_bank(0x0000, 0x3fff, "bank1"); - m_bank1->set_base(m_ram->pointer() + 0x0000); + u8 *m = m_rom->base(); + u8 *r = m_ram->pointer(); + + if (BIT(m_bank_status, 0) != BIT(m_bank_old, 0)) + { + if (BIT(m_bank_status, 0)) + { + space.install_write_bank(0x0000, 0x3fff, "bank1"); + m_bank1->set_base(r); + } + else + { + space.unmap_write(0x0000, 0x3fff); + m_bank1->set_base(m); + } } - m_bank2->set_base(m_ram->pointer() + 0x4000); - if (m_bank2_status==0) { - space.install_readwrite_bank(0xe000, 0xffff, "bank3"); - m_bank3->set_base(m_ram->pointer() + 0xe000); - } else { - space.unmap_write(0xe000, 0xffff); - space.install_read_handler (0xe000, 0xffff, read8sm_delegate(*this, FUNC(ondra_state::ondra_keyboard_r))); + + if (BIT(m_bank_status, 1) != BIT(m_bank_old, 1)) + { + if (BIT(m_bank_status, 1)) + { + space.unmap_write(0xe000, 0xffff); + space.install_read_handler (0xe000, 0xffff, read8sm_delegate(*this, FUNC(ondra_state::keyboard_r))); + } + else + { + space.install_readwrite_bank(0xe000, 0xffff, "bank3"); + m_bank3->set_base(r + 0xe000); + } } -} -void ondra_state::ondra_port_03_w(uint8_t data) -{ - m_video_enable = data & 1; - m_bank1_status = (data >> 1) & 1; - m_bank2_status = (data >> 2) & 1; - ondra_update_banks(); - m_cassette->output(((data >> 3) & 1) ? -1.0 : +1.0); + m_bank_old = m_bank_status; } -void ondra_state::ondra_port_09_w(uint8_t data) +/* +0 - video on/off +1 - banking +2 - banking +3 - cassette out +4 - A0 on pits +5 - A1 on pits */ +void ondra_state::port03_w(u8 data) { + if (BIT(data, 1, 2) != m_bank_status) + { + m_bank_status = BIT(data, 1, 2); + update_banks(); + } + + m_video_enable = BIT(data, 0); + m_cassette->output(BIT(data, 3) ? -1.0 : +1.0); } -void ondra_state::ondra_port_0a_w(uint8_t data) + +// external connection +u8 ondra_state::port09_r() { + return 0xff; } -TIMER_CALLBACK_MEMBER(ondra_state::nmi_check_callback) +/* +0 - a LED next to keyboard +1 - a LED next to keyboard +2 - external +3 - external +4 - cassette relay +5 - speaker +6 - speaker +7 - speaker */ +void ondra_state::port0a_w(u8 data) { - if ((m_nmi->read() & 1) == 1) - { - m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); - } + static u16 tones[8] = { 0, 110, 156, 220, 311, 440, 622, 880 }; // a guess + + m_cassette->change_state(BIT(data,4) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); + u16 tone = tones[BIT(data, 5, 3)]; + m_beep->set_state(tone? 1 : 0); + if (tone) + m_beep->set_clock(tone); } void ondra_state::machine_reset() { - m_bank1_status = 0; - m_bank2_status = 0; - ondra_update_banks(); + m_beep->set_state(0); + m_video_enable = 0; + m_bank_status = 0; + m_bank_old = 0xff; + update_banks(); + m_bank2->set_base(m_ram->pointer() + 0x4000); } void ondra_state::machine_start() { - m_nmi_check_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ondra_state::nmi_check_callback), this)); - m_nmi_check_timer->adjust(attotime::from_hz(10), 0, attotime::from_hz(10)); + save_item(NAME(m_video_enable)); + save_item(NAME(m_bank_status)); + save_item(NAME(m_bank_old)); } diff --git a/src/mame/video/ondra.cpp b/src/mame/video/ondra.cpp deleted file mode 100644 index 92b56e0ba19..00000000000 --- a/src/mame/video/ondra.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Miodrag Milanovic -/*************************************************************************** - - Ondra driver by Miodrag Milanovic - - 08/09/2008 Preliminary driver. - -****************************************************************************/ - - -#include "emu.h" -#include "includes/ondra.h" -#include "machine/ram.h" - - - -void ondra_state::video_start() -{ - m_video_enable = 0; -} - -uint32_t ondra_state::screen_update_ondra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - uint8_t code1,code2; - int y, x, b; - int Vaddr = 0x2800; - - if (m_video_enable==1) { - for (x = 0; x < 40; x++) - { - for (y = 127; y >=0; y--) - { - code1 = m_ram->pointer()[0xd700 + Vaddr + 0x80]; - code2 = m_ram->pointer()[0xd700 + Vaddr + 0x00]; - for (b = 0; b < 8; b++) - { - bitmap.pix16(2*y, x*8+b) = ((code1 << b) & 0x80) ? 1 : 0; - bitmap.pix16(2*y+1, x*8+b) = ((code2 << b) & 0x80) ? 1 : 0; - } - Vaddr++; - } - Vaddr = (Vaddr - 128) - 256; - } - } - return 0; -} -- cgit v1.2.3 From 22bca00cef5dec3ded5fb0478747c5c5dde2c64c Mon Sep 17 00:00:00 2001 From: ClawGrip Date: Sat, 4 Jul 2020 20:42:13 +0200 Subject: New NOT_WORKING software list additions (mobigo_cart.xml) (#6902) --------------------------------------- Dreamworks Shrek - Forever After (US) [TeamEurope] Disney Princess (USA, alt) [TeamEurope] Sesame Street - Elmo and Abby - Nature Explorers (USA) [TeamEurope] Disney/Pixar Brave (USA) [TeamEurope] Disney Jake and the Neverland Pirates (USA, alt) [TeamEurope] * Also Fixed 'tbell' hash and sorted the list (nw) --- hash/mobigo_cart.xml | 120 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 90 insertions(+), 30 deletions(-) diff --git a/hash/mobigo_cart.xml b/hash/mobigo_cart.xml index 41d0920f36a..0adbeb5aeea 100644 --- a/hash/mobigo_cart.xml +++ b/hash/mobigo_cart.xml @@ -21,7 +21,19 @@ license:CC0 - + + Disney/Pixar Brave (USA) + 2012 + VTech + + + + + + + + + Disney/Pixar Merida - Legende der Highlands (Germany) 2012 VTech @@ -81,26 +93,14 @@ license:CC0 - - DreamWorks/Nickelodeon The Penguins of Madagascar - Mission Madness (USA) - 2010 - VTech - - - - - - - - - - DreamWorks/Nickelodeon Die Pinguine aus Madagascar - Operation Krone (Germany) + + Sesame Street - Elmo and Abby - Nature Explorers (USA) 2011 VTech - + - + @@ -129,6 +129,18 @@ license:CC0 + + Disney Princess (USA, alt) + 2010 + VTech + + + + + + + + Disney Princess (Germany) 2011 @@ -153,18 +165,6 @@ license:CC0 - - DreamWorks Für immer Shrek (Germany) - 201? - VTech - - - - - - - - Hello Kitty - Hello Kitty feiert Geburtstag! (Germany) 2012 @@ -189,6 +189,18 @@ license:CC0 + + Disney Jake and the Neverland Pirates (USA, alt) + 2012 + VTech + + + + + + + + Jake und die Nimmerland Piraten (Germany) 2012 @@ -260,6 +272,30 @@ license:CC0 + + DreamWorks/Nickelodeon The Penguins of Madagascar - Mission Madness (USA) + 2010 + VTech + + + + + + + + + + DreamWorks/Nickelodeon Die Pinguine aus Madagascar - Operation Krone (Germany) + 2011 + VTech + + + + + + + + Disney Planes (Germany) 2013 @@ -296,6 +332,30 @@ license:CC0 + + Dreamworks Shrek - Forever After (US) + 2010 + VTech + + + + + + + + + + DreamWorks Für immer Shrek (Germany) + 201? + VTech + + + + + + + + Sofia die Erste (Germany) 2013 @@ -410,7 +470,7 @@ license:CC0 - + -- cgit v1.2.3 From dc3dbe04578d4235090736925e7265d4af6be7cb Mon Sep 17 00:00:00 2001 From: ClawGrip Date: Sat, 4 Jul 2020 20:42:43 +0200 Subject: vsmilem_cart.xml: Add some serials, update notes, and rename a set to follow naming convention (nw) (#6900) --- hash/vsmilem_cart.xml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/hash/vsmilem_cart.xml b/hash/vsmilem_cart.xml index 51e0c85d971..5fa9bc90739 100644 --- a/hash/vsmilem_cart.xml +++ b/hash/vsmilem_cart.xml @@ -24,6 +24,7 @@ Language: *******?? = Finland +========+===================+===========================================================================================+ +| XX | 80-084000(US) | Action Mania | | XX | 80-084000(US) | Action Mania (Rev, 4?) | | XX | 80-084000(US) | Action Mania (Rev, 6?) | | | (IT) | ????? | @@ -68,7 +69,7 @@ Language: | XX | 80-084124(GE) | Kung Fu Panda - Der Weg des Panda | | XX | 80-084125(FR) | Kung Fu Panda - La mission de Po | +========+===================+===========================================================================================+ -| | 80-084140(US) | Spider-Man & Friends - Secret Missions (AKA Professor V's Secret Missions with diff label)| +| XX | 80-084140(US) | Spider-Man & Friends - Secret Missions (AKA Professor V's Secret Missions with diff label)| | | 80-084143(UK) | Spider-Man & Friends - Secret Missions | | XX | 80-084144(GE) | Spider-Man & Freunde - Geheime Missionen | | XX | 80-084145(FR) | Spider-Man & ses amis - Missions Secrètes | @@ -100,7 +101,7 @@ Language: +========+===================+===========================================================================================+ | XX | 80-084240(US) | Ni Hao Kai Lan | | XX | 80-084245(FR) | Ni Hao Kai Lan - Joyeux Nouvel an chinois! | -+========+===================+===========================================================================================+ ++========+===================+===========================================================================================+ | | 80-084260(US) | My Pet Puppy (unreleased in USA? UK version plays OK on NTSC console) | | XX | 80-084262(NL) | Mijn Puppy! | | | 80-084263(UK) | My Pet Puppy | @@ -114,7 +115,7 @@ Language: | | 80-084284(GE) | Dolphis Wasser-abenteuer | | XX | 80-084285(FR) | Martin le Dauphin | +========+===================+===========================================================================================+ -| | 80-084300(US) | Soccer Challenge | +| XX | 80-084300(US) | Soccer Challenge | | | 80-084303(UK) | Football Challenge | | XX | 80-084304(GE) | Fussball Meisterschaft | | XX | 80-084305(FR) | Football Challenge | @@ -161,7 +162,7 @@ Language: | | 80-084406(PT) | Cars - Aventura Em Radiator Springs (84416 on cart) | | XX | 80-084407(SP) | Cars - Acelera el Motor en Radiador Springs | +========+===================+===========================================================================================+ -| | 80-084420(US) | Toy Story 3 | +| XX | 80-084420(US) | Toy Story 3 | | | 80-084421(US) | Toy Story 3 (pocket version) | | | (IT) | Toy Story 3 (EAN 8033836704196, GP470419?) | | | 80-084422(NL) | Toy Story 3 | @@ -263,6 +264,7 @@ Language: Action Mania (USA) 201? VTech + @@ -1006,7 +1008,7 @@ Language: Soccer Challenge (USA) 200? VTech - + @@ -1042,12 +1044,11 @@ Language: - Marvel Spider-Man & Friends - Secret Missions (USA) 200? VTech - + @@ -1151,10 +1152,11 @@ Language: - + Toy Story 3 (USA) 2010 VTech + @@ -1162,7 +1164,7 @@ Language: - + Toy Story 3 (Germany) 2010 VTech @@ -1179,7 +1181,7 @@ Language: - + Toy Story 3 (France) 2010 VTech @@ -1192,7 +1194,7 @@ Language: - + Disney/Pixar Toy Story 3 (Spain) 2010 VTech -- cgit v1.2.3 From e4b7bb8c8842d6e24dba751740c9b56e771d2aa3 Mon Sep 17 00:00:00 2001 From: ClawGrip Date: Sat, 4 Jul 2020 20:43:35 +0200 Subject: New machines marked as NOT_WORKING (#6892) * New machines marked as NOT_WORKING ---------------------------------- Far West [Victor Fernandez (City Game), ClawGrip] * Add 'cfarwest' (nw) --- src/mame/drivers/microdar.cpp | 114 ++++++++++++++++++++++++++++++++++++++---- src/mame/mame.lst | 1 + 2 files changed, 106 insertions(+), 9 deletions(-) diff --git a/src/mame/drivers/microdar.cpp b/src/mame/drivers/microdar.cpp index 21bf927a6bb..287cef68e2c 100644 --- a/src/mame/drivers/microdar.cpp +++ b/src/mame/drivers/microdar.cpp @@ -59,15 +59,16 @@ IC10 = Hitachi HD74HC244P ************************************************************************** Known machines using this hardware: -___________________________________________________________________________________________________________ -|Dumped | Name | Manufacturer | Notes | -|-------|------------|--------------|---------------------------------------------------------------------| -| NO | Sagitario | CIC Play | CPU silkscreened "REF 0034 9115S", without manufacturer logos | -| YES | Unknown | Bifuca | Added as "microdar". Standard Microdar SPD with Philips REF34VA | -| NO | Party Darts| Compumatic | More info: http://www.recreativas.org/party-darts-4906-compumatic | -| NO | Diamant | Unknown | Newer PCB with Philips REF34VA and additional Compumatic custom ICs | -| NO | Tiger Dart | Unknown | Standard Microdar SPD with Philips REF34VA | -|_______|____________|______________|_____________________________________________________________________| +_______________________________________________________________________________________________________________________________________________ +|Dumped | Name | Manufacturer | Notes | Machine type | +|-------|------------|--------------|---------------------------------------------------------------------|------------------------------------| +| NO | Sagitario | CIC Play | CPU silkscreened "REF 0034 9115S", without manufacturer logos | Darts | +| YES | Unknown | Bifuca | Added as "microdar". Standard Microdar SPD with Philips REF34VA | Darts | +| NO | Party Darts| Compumatic | More info: http://www.recreativas.org/party-darts-4906-compumatic | Darts | +| NO | Diamant | Unknown | Newer PCB with Philips REF34VA and additional Compumatic custom ICs | Darts | +| NO | Tiger Dart | Unknown | Standard Microdar SPD with Philips REF34VA | Darts | +| YES | Far West | Compumatic | Standard Microdar SPD with Philips REF34VA | Electromechanical shooting machine | +|_______|____________|______________|_____________________________________________________________________|____________________________________| There's a later revision of the Compumatic Microdar PCB (V5), smaller, with a standard Atmel AT89S51 instead of the REF34 CPU. @@ -220,4 +221,99 @@ ROM_START(microdar) ROM_LOAD("24lc16b.ic8", 0x000, 0x800, CRC(1cae70db) SHA1(575d4c787fd65950417e85fdb34d2961fc327c74)) ROM_END +ROM_START(cfarwest) + ROM_REGION(0x1000, "maincpu", ROMREGION_ERASE00) + ROM_LOAD("ref34va_k8v2873_phr9920_0.ic12", 0x0000, 0x1000, NO_DUMP) + // Fills copied from 'microdar' without checking + ROM_FILL(0x0000, 1, 0x02) // temporary LJMP to external init code + ROM_FILL(0x0001, 1, 0x10) + ROM_FILL(0x0002, 1, 0x1b) + ROM_FILL(0x000b, 1, 0x02) // temporary LJMP to interrupt handler + ROM_FILL(0x000c, 1, 0x10) + ROM_FILL(0x000d, 1, 0x15) + ROM_FILL(0x001b, 1, 0x02) // temporary LJMP to interrupt handler + ROM_FILL(0x001c, 1, 0x10) + ROM_FILL(0x001d, 1, 0x18) + ROM_FILL(0x0058, 1, 0x32) // RETI stubs + ROM_FILL(0x00af, 1, 0x32) + ROM_FILL(0x00c9, 1, 0x02) // temporary LJMP to end of interrupt handler + ROM_FILL(0x00ca, 1, 0x12) + ROM_FILL(0x00cb, 1, 0xd1) + ROM_FILL(0x0135, 1, 0x22) // RET stubs + ROM_FILL(0x0163, 1, 0x22) + ROM_FILL(0x0185, 1, 0x22) + ROM_FILL(0x01cf, 1, 0x22) + ROM_FILL(0x02de, 1, 0x22) + ROM_FILL(0x02fa, 1, 0x22) + ROM_FILL(0x0308, 1, 0x22) + ROM_FILL(0x0313, 1, 0x22) + ROM_FILL(0x037d, 1, 0x22) + ROM_FILL(0x03be, 1, 0x22) + ROM_FILL(0x0496, 1, 0x22) + ROM_FILL(0x04ce, 1, 0x22) + ROM_FILL(0x0514, 1, 0x22) + ROM_FILL(0x0520, 1, 0x22) + ROM_FILL(0x0550, 1, 0x22) + ROM_FILL(0x0574, 1, 0x22) + ROM_FILL(0x05b4, 1, 0x22) + ROM_FILL(0x05bb, 1, 0x22) + ROM_FILL(0x05ca, 1, 0x22) + ROM_FILL(0x05d8, 1, 0x22) + ROM_FILL(0x0605, 1, 0x22) + ROM_FILL(0x0638, 1, 0x22) + ROM_FILL(0x068a, 1, 0x22) + ROM_FILL(0x06a2, 1, 0x22) + ROM_FILL(0x06bd, 1, 0x22) + ROM_FILL(0x06db, 1, 0x22) + ROM_FILL(0x0708, 1, 0x22) + ROM_FILL(0x0715, 1, 0x22) + ROM_FILL(0x072d, 1, 0x22) + ROM_FILL(0x0744, 1, 0x22) + ROM_FILL(0x0751, 1, 0x22) + ROM_FILL(0x0767, 1, 0x22) + ROM_FILL(0x0772, 1, 0x22) + ROM_FILL(0x077d, 1, 0x22) + ROM_FILL(0x07a4, 1, 0x22) + ROM_FILL(0x07c2, 1, 0x22) + ROM_FILL(0x0802, 1, 0x22) + ROM_FILL(0x0836, 1, 0x22) + ROM_FILL(0x087d, 1, 0x22) + ROM_FILL(0x0893, 1, 0x22) + ROM_FILL(0x0930, 1, 0x22) + ROM_FILL(0x094a, 1, 0x22) + ROM_FILL(0x095a, 1, 0x22) + ROM_FILL(0x096a, 1, 0x22) + ROM_FILL(0x097b, 1, 0x22) + ROM_FILL(0x098f, 1, 0x22) + ROM_FILL(0x09a3, 1, 0x22) + ROM_FILL(0x09c0, 1, 0x22) + ROM_FILL(0x0a21, 1, 0x22) + ROM_FILL(0x0a54, 1, 0x22) + ROM_FILL(0x0a63, 1, 0x22) + ROM_FILL(0x0a73, 1, 0x22) + ROM_FILL(0x0a90, 1, 0x22) + ROM_FILL(0x0ae8, 1, 0x22) + ROM_FILL(0x0abf, 1, 0x22) + ROM_FILL(0x0ac7, 1, 0x22) + ROM_FILL(0x0b11, 1, 0x22) + ROM_FILL(0x0b7f, 1, 0x22) + ROM_FILL(0x0bf1, 1, 0x22) + ROM_FILL(0x0bf6, 1, 0x22) + ROM_FILL(0x0c4a, 1, 0x22) + ROM_FILL(0x0c59, 1, 0x22) + ROM_FILL(0x0c64, 1, 0x22) + ROM_FILL(0x0c99, 1, 0x22) + ROM_FILL(0x0ca8, 1, 0x22) + ROM_FILL(0x0cbd, 1, 0x22) + ROM_FILL(0x0dac, 1, 0x22) + ROM_FILL(0x0dca, 1, 0x22) + ROM_FILL(0x0e6a, 1, 0x22) + + ROM_REGION(0x20000, "program", 0) + ROM_LOAD("farwest_pistola.ic3", 0x00000, 0x20000, CRC(ad68a0e8) SHA1(157a6a84f31e05d289e2fc67099fcff2887a84b9)) + + // No EEPROM on this PCB +ROM_END + GAME(199?, microdar, 0, microdar, microdar, microdar_state, empty_init, ROT0, "Compumatic / Bifuca", "Microdar SPD", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1997, cfarwest, 0, microdar, microdar, microdar_state, empty_init, ROT0, "Compumatic", "Far West", MACHINE_IS_SKELETON_MECHANICAL) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index bc784375bfb..f8db685be1c 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -22608,6 +22608,7 @@ dm3270 // @source:microdar.cpp microdar // +cfarwest // (c) 1997 Compumatic @source:microdec.cpp md2 // -- cgit v1.2.3 From f16e2ef835d7986f982c127efc45c238d1c7db2c Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sat, 4 Jul 2020 21:00:12 +0200 Subject: microdar.cpp: fixed validation error --- src/mame/drivers/microdar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/microdar.cpp b/src/mame/drivers/microdar.cpp index 287cef68e2c..b290dc6d996 100644 --- a/src/mame/drivers/microdar.cpp +++ b/src/mame/drivers/microdar.cpp @@ -315,5 +315,5 @@ ROM_START(cfarwest) // No EEPROM on this PCB ROM_END -GAME(199?, microdar, 0, microdar, microdar, microdar_state, empty_init, ROT0, "Compumatic / Bifuca", "Microdar SPD", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, cfarwest, 0, microdar, microdar, microdar_state, empty_init, ROT0, "Compumatic", "Far West", MACHINE_IS_SKELETON_MECHANICAL) +GAME(199?, microdar, 0, microdar, microdar, microdar_state, empty_init, ROT0, "Compumatic / Bifuca", "Microdar SPD", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1997, cfarwest, 0, microdar, microdar, microdar_state, empty_init, ROT0, "Compumatic", "Far West (Compumatic)", MACHINE_IS_SKELETON_MECHANICAL) -- cgit v1.2.3 From 9cd4f31d8f3d5cee3697b764d7b3eb4b343a9bf8 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sat, 4 Jul 2020 22:34:57 +0200 Subject: devices/machine/8042kbdc, mame/machine/s32comm: initialize variables which caused problems in debug devnoclear builds --- src/devices/machine/8042kbdc.cpp | 1 + src/mame/machine/s32comm.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/devices/machine/8042kbdc.cpp b/src/devices/machine/8042kbdc.cpp index 18338dd14d9..b2ce8b6743e 100644 --- a/src/devices/machine/8042kbdc.cpp +++ b/src/devices/machine/8042kbdc.cpp @@ -72,6 +72,7 @@ void kbdc8042_device::device_start() m_last_write_to_control = 0; m_status_read_mode = 0; m_speaker = 0; + m_offset1 = 0; m_update_timer = timer_alloc(TIMER_UPDATE); m_update_timer->adjust(attotime::never); diff --git a/src/mame/machine/s32comm.cpp b/src/mame/machine/s32comm.cpp index 26797685c55..b53448b46d3 100644 --- a/src/mame/machine/s32comm.cpp +++ b/src/mame/machine/s32comm.cpp @@ -133,6 +133,8 @@ void s32comm_device::device_reset() m_zfg = 0; m_cn = 0; m_fg = 0; + + std::fill(std::begin(m_shared), std::end(m_shared), 0); } uint8_t s32comm_device::zfg_r(offs_t offset) -- cgit v1.2.3 From a647659aa80d391cdc4d167d45bc0c6985273183 Mon Sep 17 00:00:00 2001 From: MASH Date: Sun, 5 Jul 2020 02:13:27 +0100 Subject: Fixed arcade build (#6910) * Fixed arcade build Added special_gambl.cpp to arcade.flt * Fixed arcade build Added audio\special.cpp/h to arcade.lua --- scripts/target/mame/arcade.lua | 2 ++ src/mame/arcade.flt | 1 + 2 files changed, 3 insertions(+) diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 194e14655b8..1fed9499742 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -4984,6 +4984,8 @@ files { MAME_DIR .. "src/mame/drivers/smsmcorp.cpp", MAME_DIR .. "src/mame/drivers/sothello.cpp", MAME_DIR .. "src/mame/drivers/special_gambl.cpp", + MAME_DIR .. "src/mame/audio/special.cpp", + MAME_DIR .. "src/mame/audio/special.h", MAME_DIR .. "src/mame/drivers/spool99.cpp", MAME_DIR .. "src/mame/drivers/sprcros2.cpp", MAME_DIR .. "src/mame/drivers/sshot.cpp", diff --git a/src/mame/arcade.flt b/src/mame/arcade.flt index 30bd4922eb0..5abdcf1ff85 100644 --- a/src/mame/arcade.flt +++ b/src/mame/arcade.flt @@ -1169,6 +1169,7 @@ spbactn.cpp spcforce.cpp spdheat.cpp spdodgeb.cpp +special_gambl.cpp spectra.cpp speedatk.cpp speedbal.cpp -- cgit v1.2.3 From 4f7c52ac1e7116ad2816d5ed541f3115c73eca1b Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Sat, 4 Jul 2020 20:11:53 -0700 Subject: sgi_mips_hdd: new software list additions (#6903) --- hash/sgi_mips_hdd.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hash/sgi_mips_hdd.xml b/hash/sgi_mips_hdd.xml index eab2f2065d6..f16a286c6bd 100644 --- a/hash/sgi_mips_hdd.xml +++ b/hash/sgi_mips_hdd.xml @@ -18,6 +18,17 @@ license:CC0 corresponding sgi_mips sets. --> + + IRIX 5.2 + 1994 + Silicon Graphics + + + + + + + IRIX 5.3 1994 -- cgit v1.2.3 From 2901f896ebf6e0a4bda7840fa79dddca95d3d9ca Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sun, 5 Jul 2020 08:18:44 +0200 Subject: bus/qbus/qbus.cpp: fixed missing initialization that was causing crashes in devnoclear debug builds --- src/devices/bus/qbus/qbus.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/devices/bus/qbus/qbus.cpp b/src/devices/bus/qbus/qbus.cpp index 293be5bcf27..8f00fb3e01e 100644 --- a/src/devices/bus/qbus/qbus.cpp +++ b/src/devices/bus/qbus/qbus.cpp @@ -57,6 +57,7 @@ qbus_slot_device::qbus_slot_device(const machine_config &mconfig, const char *ta m_write_birq6(*this), m_write_birq7(*this), m_write_bdmr(*this), + m_card(nullptr), m_bus(*this, DEVICE_SELF_OWNER) { } -- cgit v1.2.3 From ad6505ba636ecf8336eae91dce0b20bd5055b4ad Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sun, 5 Jul 2020 08:41:20 +0200 Subject: New clones marked as NOT_WORKING -------------------------------- Last Action Hero (1.04 France) [PinMAME] Added correct ROMs for pentacup2 [PinMAME] --- src/mame/drivers/de_3.cpp | 14 ++++++++++++++ src/mame/drivers/micropin.cpp | 8 ++++---- src/mame/mame.lst | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/mame/drivers/de_3.cpp b/src/mame/drivers/de_3.cpp index d91f3c9a3a0..0feaccdfea5 100644 --- a/src/mame/drivers/de_3.cpp +++ b/src/mame/drivers/de_3.cpp @@ -823,6 +823,19 @@ ROM_START(lah_107) ROM_LOAD("lahsnd.u21", 0x080000, 0x40000, CRC(4571dc2e) SHA1(a1068cb080c30dbc07d164eddfc5dfd0afd52d3b)) ROM_END +ROM_START(lah_f104) + ROM_REGION(0x10000, "maincpu", 0) + ROM_LOAD("lahcpua.104", 0x0000, 0x10000, CRC(49b9e5e9) SHA1(cf6198e4c93ce839dc6e5231090d4ca56e9bdea2)) + ROM_REGION(0x10000, "cpu3", ROMREGION_ERASEFF) + ROM_REGION(0x80000, "gfx3", 0) + ROM_LOAD("lahdispf.101", 0x00000, 0x80000, CRC(826a0a8b) SHA1(daad062edd8b6f468991d941e40d86711f8505df)) + ROM_REGION(0x010000, "soundcpu", 0) + ROM_LOAD("lahsnd.u7", 0x0000, 0x10000, CRC(0279c45b) SHA1(14daf6b711d1936352209e90240f51812ebe76e0)) + ROM_REGION(0x1000000, "bsmt", 0) + ROM_LOAD("lahsnd.u17", 0x000000, 0x80000, CRC(d0c15fa6) SHA1(5dcd13b578fa53c82353cda5aa774ca216c5ddfe)) + ROM_LOAD("lahsnd.u21", 0x080000, 0x40000, CRC(4571dc2e) SHA1(a1068cb080c30dbc07d164eddfc5dfd0afd52d3b)) +ROM_END + /*---------------------------------------------------------------- / Lethal Weapon 3 - CPU Rev 3 /DMD Type 2 512K Rom - 64K CPU Rom /---------------------------------------------------------------*/ @@ -1387,6 +1400,7 @@ GAME(1993, lah_l108, lah_112, de_3_dmd2, de_3, de_3_state, empty_init, ROT0, GAME(1993, lah_110, lah_112, de_3_dmd2, de_3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (1.10)", MACHINE_IS_SKELETON_MECHANICAL) GAME(1993, lah_106c, lah_112, de_3_dmd2, de_3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (1.06 Canada)", MACHINE_IS_SKELETON_MECHANICAL) GAME(1993, lah_107, lah_112, de_3_dmd2, de_3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (1.07)", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1993, lah_f104, lah_112, de_3_dmd2, de_3, de_3_state, empty_init, ROT0, "Data East", "Last Action Hero (1.04 France)", MACHINE_IS_SKELETON_MECHANICAL) GAME(1992, lw3_208, 0, de_3_dmd2, de_3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (2.08)", MACHINE_IS_SKELETON_MECHANICAL) GAME(1992, lw3_207, lw3_208, de_3_dmd2, de_3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (2.07)", MACHINE_IS_SKELETON_MECHANICAL) GAME(1992, lw3_207c, lw3_208, de_3_dmd2, de_3, de_3_state, empty_init, ROT0, "Data East", "Lethal Weapon 3 (2.07 Canada)", MACHINE_IS_SKELETON_MECHANICAL) diff --git a/src/mame/drivers/micropin.cpp b/src/mame/drivers/micropin.cpp index a4a08825974..d8dd1a32538 100644 --- a/src/mame/drivers/micropin.cpp +++ b/src/mame/drivers/micropin.cpp @@ -365,10 +365,10 @@ ROM_END ROM_START(pentacup2) ROM_REGION(0x2000, "v2cpu", 0) - ROM_LOAD("micro_1.bin", 0x0000, 0x0800, CRC(4d6dc218) SHA1(745c553f3a42124f925ca8f2e52fd08d05999594)) - ROM_LOAD("micro_2.bin", 0x0800, 0x0800, CRC(33cd226d) SHA1(d1dff8445a0f35da09d560a16038c969845ff21f)) - ROM_LOAD("micro_3.bin", 0x1000, 0x0800, CRC(997bde74) SHA1(c3ea33f7afbdc7f2a22798a13ec323d7c6628dd4)) - ROM_LOAD("micro_4.bin", 0x1800, 0x0800, CRC(a804e7d6) SHA1(f414d6a5308266744645849940c00cd422e920d2)) + ROM_LOAD("micro_1.bin", 0x0000, 0x0800, CRC(62d04111) SHA1(f0ce705c06a43a81293d8610394ce7c4143148e9)) + ROM_LOAD("micro_2.bin", 0x0800, 0x0800, CRC(832e4223) SHA1(1409b0c7de35012b9d0eba9bb73b52aecc93c0f2)) + ROM_LOAD("micro_3.bin", 0x1000, 0x0800, CRC(9d5d04d1) SHA1(1af32c418b73ee457f06ee9a8362cfec75e61f30)) + ROM_LOAD("micro_4.bin", 0x1800, 0x0800, CRC(358ffd6a) SHA1(f5299e39d991bf882f827a62a1d9bb18e46dbcfc)) // 2 undumped proms DMA-01, DMA-02 ROM_END diff --git a/src/mame/mame.lst b/src/mame/mame.lst index f8db685be1c..666639d2d80 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -11768,6 +11768,7 @@ lah_106c // lah_107 // lah_110 // lah_112 // +lah_f104 // lah_l104 // lah_l108 // lw3_200 // -- cgit v1.2.3 From 9e86f5e86612c4f61b27e5ada86ac9bdebcbc272 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 5 Jul 2020 11:40:22 +0200 Subject: netlist: Add basic unit testing support. * Add google test syntax compatible unit testing support. This is a very limited subset of the google test framework and not intended ever to be a replacement. Adding a dependency to google test for the functionality required was considered to be an overkill. * nltool -c tests runs unit tests if linked in. This is *not* the case for the version of nltool compiled with TOOLS=1. * Added unit tests for plib::pfunction. --- src/lib/netlist/build/makefile | 14 +++- src/lib/netlist/plib/ptests.h | 140 +++++++++++++++++++++++++++++++ src/lib/netlist/prg/nltool.cpp | 13 ++- src/lib/netlist/tests/test_pfunction.cpp | 43 ++++++++++ 4 files changed, 205 insertions(+), 5 deletions(-) create mode 100644 src/lib/netlist/plib/ptests.h create mode 100644 src/lib/netlist/tests/test_pfunction.cpp diff --git a/src/lib/netlist/build/makefile b/src/lib/netlist/build/makefile index 1d442953fb6..3591c5317b2 100644 --- a/src/lib/netlist/build/makefile +++ b/src/lib/netlist/build/makefile @@ -103,6 +103,7 @@ TARGETS = nltool$(EXESUFFIX) nlwav$(EXESUFFIX) NLOBJ = $(OBJ) POBJ = $(OBJ)/plib +TESTOBJ = $(OBJ)/tests DEPEND = $(OBJ)/.depend @@ -113,12 +114,13 @@ OBJDIRS = $(OBJ) \ $(OBJ)/plib \ $(OBJ)/devices \ $(OBJ)/macro \ + $(OBJ)/tests \ $(OBJ)/tools \ $(OBJ)/prg \ $(OBJ)/generated \ -OBJS = $(POBJS) $(NLOBJS) +OBJS = $(POBJS) $(NLOBJS) $(TESTOBJS) POBJS := \ $(POBJ)/pstring.o \ @@ -212,6 +214,9 @@ NLOBJS := \ $(NLOBJ)/macro/nlm_roms.o \ $(NLOBJ)/macro/nlm_ttl74xx.o \ +TESTOBJS := \ + $(TESTOBJ)/test_pfunction.o \ + VSBUILDS = \ $(VSBUILD/netlistlib.vcxproj) \ $(VSBUILD/netlistlib.vcxproj.user \ @@ -234,7 +239,7 @@ ALL_TIDY_FILES = $(ALL_OBJS:.o=.json) SOURCES = $(patsubst $(OBJ)%, $(SRC)%, $(ALL_OBJS:.o=.cpp)) ALLFILES = $(SOURCES) $(VSBUILDS) $(DOCS) -MAKEFILE_TARGETS_WITHOUT_INCLUDE := gcc9 clang clang-5 mingw doc native maketree tidy +MAKEFILE_TARGETS_WITHOUT_INCLUDE := gcc9 clang clang-5 mingw doc native maketree tidy runtests # git archive HEAD --prefix=project-name-version/ \ @@ -244,7 +249,7 @@ MAKEFILE_TARGETS_WITHOUT_INCLUDE := gcc9 clang clang-5 mingw doc native maketree # PHONY #------------------------------------------------- -.PHONY: all gcc9 clang clang-5 mingw doc native maketree $(DEPEND) depend +.PHONY: all gcc9 clang clang-5 mingw doc native maketree $(DEPEND) depend runtests #------------------------------------------------- # all @@ -328,6 +333,9 @@ nvcc: -Xcompiler -O6 -Xcompiler -march=native -ccbin g++-8 " \ DEPENDCC=g++ +runtests: + ./nltool$(EXESUFFIX) -c tests + tidy_db: compile_commands_prefix $(ALL_TIDY_FILES) compile_commands_postfix # diff --git a/src/lib/netlist/plib/ptests.h b/src/lib/netlist/plib/ptests.h new file mode 100644 index 00000000000..1f4bbd5e866 --- /dev/null +++ b/src/lib/netlist/plib/ptests.h @@ -0,0 +1,140 @@ +// license:GPL-2.0+ +// copyright-holders:Couriersud + +#ifndef PTESTS_H_ +#define PTESTS_H_ + +/// +/// \file ptests.h +/// +/// google tests compatible (hopefully) test macros. This is work in progress! +/// + +#include +#include +#include +#include + +#define EXPECT_EQ(exp1, exp2) PINT_EXPECT(eq, exp1, exp2) +#define EXPECT_NE(exp1, exp2) PINT_EXPECT(ne, exp1, exp2) +#define EXPECT_GT(exp1, exp2) PINT_EXPECT(gt, exp1, exp2) +#define EXPECT_LT(exp1, exp2) PINT_EXPECT(lt, exp1, exp2) +#define EXPECT_GE(exp1, exp2) PINT_EXPECT(ge, exp1, exp2) +#define EXPECT_LE(exp1, exp2) PINT_EXPECT(le, exp1, exp2) + +#define EXPECT_TRUE(exp1) PINT_EXPECT(eq, exp1, true) +#define EXPECT_FALSE(exp1) PINT_EXPECT(eq, exp1, false) + +#define TEST(name, desc) PINT_TEST(name, desc) +#define TEST_F(name, desc) PINT_TEST_F(name, desc, name) +#define RUN_ALL_TESTS() plib::testing::run_all_tests() + +#define PINT_TEST(name, desc) PINT_TEST_F(name, desc, plib::testing::Test) + +#define PINT_TEST_F(name, desc, base) \ + class name ## _ ## desc : public base \ + { public:\ + void desc (); \ + void run() override { desc (); } \ + }; \ + plib::testing::reg_entry name ## _ ## desc ## _reg(#name, #desc); \ + void name ## _ ## desc :: desc () + +#define PINT_EXPECT(comp, exp1, exp2) \ + if (!plib::testing::internal_assert(plib::testing::comp_ ## comp (), # exp1, # exp2, exp1, exp2)) \ + std::cout << __FILE__ << ":" << __LINE__ << ":1: error: test failed\n"; + +namespace plib +{ +namespace testing +{ + + class Test + { + public: + virtual ~Test() {} + virtual void run() {} + virtual void SetUp() {} + virtual void TearDown() {} + }; + + struct reg_entry_base + { + using list_t = std::vector; + reg_entry_base(const std::string &n, const std::string &d) + : name(n), desc(d) + { + registry().push_back(this); + } + virtual ~reg_entry_base() = default; + virtual Test *create() { return nullptr; } + + std::string name; + std::string desc; + public: + static list_t & registry() + { + static list_t prlist; + return prlist; + } + }; + + template + struct reg_entry : public reg_entry_base + { + using reg_entry_base::reg_entry_base; + + virtual Test *create() override { return new T(); } + }; + + template + bool internal_assert(C comp, + const char* exp1, const char* exp2, + const T1& val1, const T2& val2) + { + if (comp(val1, val2)) + { + std::cout << "\tOK: " << exp1 << " " << C::opstr() << " " << exp2 << "\n"; + return true; + } + std::cout << "\tFAIL: " << exp1 << " " << C::opstr() << " " << exp2 + << " <" << val1 << ">,<" << val2 << ">\n"; + return false; + } + + static inline int run_all_tests() + { + for (auto &e : reg_entry_base::registry()) + { + std::cout << e->name << "::" << e->desc << ":\n"; + Test *t = e->create(); + t->SetUp(); + t->run(); + t->TearDown(); + delete t; + } + return 0; + } + +#define DEF_COMP(name, op) \ + struct comp_ ## name \ + { \ + static const char * opstr() { return #op ; } \ + template \ + bool operator()(const T1 &v1, const T2 &v2) { return v1 op v2; } \ + }; \ + + DEF_COMP(eq, ==) + DEF_COMP(ne, !=) + DEF_COMP(gt, >) + DEF_COMP(lt, <) + DEF_COMP(ge, >=) + DEF_COMP(le, <=) + +#undef DEF_COMP + +} // namespace testing +} // namespace plib + + +#endif // PTESTS_H_ diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index e177b1e0429..d849e15c755 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -20,6 +20,8 @@ #include "netlist/solver/nld_solver.h" #include "netlist/tools/nl_convert.h" +#include "plib/ptests.h" + #include // scanf #include // scanf #include @@ -44,7 +46,7 @@ public: m_errors(0), opt_grp1(*this, "General options", "The following options apply to all commands."), - opt_cmd (*this, "c", "cmd", 0, std::vector({"run","validate","convert","listdevices","static","header","docheader"}), "run|validate|convert|listdevices|static|header|docheader"), + opt_cmd (*this, "c", "cmd", 0, std::vector({"run","validate","convert","listdevices","static","header","docheader","tests"}), "run|validate|convert|listdevices|static|header|docheader|tests"), opt_includes(*this, "I", "include", "Add the directory to the list of directories to be searched for header files. This option may be specified repeatedly."), opt_defines(*this, "D", "define", "predefine value as macro, e.g. -Dname=value. If '=value' is omitted predefine it as 1. This option may be specified repeatedly."), opt_rfolders(*this, "r", "rom", "where to look for data files"), @@ -94,7 +96,9 @@ public: opt_ex3(*this, "nltool --cmd=header --tab-width=8 --line-width=80", "Create the header file needed for including netlists as code."), opt_ex4(*this, "nltool --cmd static --output src/lib/netlist/generated/static_solvers.cpp src/mame/audio/nl_*.cpp src/mame/machine/nl_*.cpp", - "Create static solvers for the MAME project.") + "Create static solvers for the MAME project."), + opt_ex5(*this, "nltool --cmd tests", + "Run unit tests. In case the unit tests are not linked in, this will do nothing.") {} int execute() override; @@ -158,6 +162,7 @@ private: plib::option_example opt_ex2; plib::option_example opt_ex3; plib::option_example opt_ex4; + plib::option_example opt_ex5; struct compile_map_entry { @@ -1267,6 +1272,10 @@ int tool_app_t::execute() create_docheader(); else if (cmd == "convert") convert(); + else if (cmd == "tests") + { + return RUN_ALL_TESTS(); + } else { perr("Unknown command {}\n", cmd.c_str()); diff --git a/src/lib/netlist/tests/test_pfunction.cpp b/src/lib/netlist/tests/test_pfunction.cpp new file mode 100644 index 00000000000..847865b4a4f --- /dev/null +++ b/src/lib/netlist/tests/test_pfunction.cpp @@ -0,0 +1,43 @@ +// license:GPL-2.0+ +// copyright-holders:Couriersud + +/// +/// \file pfunction_test.cpp +/// +/// tests for pfunction +/// + +#include "plib/ptests.h" + +#include "plib/pfunction.h" + +#define PFUNCEXPECT(formula, val) \ + EXPECT_EQ(val, plib::pfunction(formula)()); + +TEST(pfunction, operators) +{ + PFUNCEXPECT("1==1", 1.0) + PFUNCEXPECT("1 *0 == 2-1-1", 1.0) + PFUNCEXPECT("0!=1", 1.0) + PFUNCEXPECT("0<1", 1.0) + PFUNCEXPECT("1>0", 1.0) + PFUNCEXPECT("0<=1", 1.0) + PFUNCEXPECT("1>=0", 1.0) + PFUNCEXPECT("1<=1", 1.0) + PFUNCEXPECT("1>=1", 1.0) + EXPECT_EQ(1.0, plib::pfunction("0!=a", {"a"})({1.0})); +} + +TEST(pfunction, func_if) +{ + PFUNCEXPECT("if(1>0, 2, 0)", 2.0) + PFUNCEXPECT("if(0>1, 2, 3)", 3.0) + PFUNCEXPECT("if(sin(1)>0, 2, 3)", 3.0) // fail + EXPECT_EQ( 1.0, plib::pfunction("if(A2>2.5, 0-A1, (0.07-(0.005*A1))*if(A0>2.5,1,0-1))", {"A0","A1","A2"})({1.0,-1.0,3.0})); + EXPECT_EQ(-0.065, plib::pfunction("if(A2>2.5, 0-A1, (0.07-(0.005*A1))*if(A0>2.5,1,0-1))", {"A0","A1","A2"})({1.0,1.0,1.0})); + EXPECT_EQ( 0.065, plib::pfunction("if(A2>2.5, 0-A1, (0.07-(0.005*A1))*if(A0>2.5,1,0-1))", {"A0","A1","A2"})({3.0,1.0,1.0})); + //EXPECT(plib::pfunction("if(A2>2.5, A1, if(A0>2.5,1,(0-1)))", {"A0","A1","A2"})({1.0,1.0,1.0}), -1.0) + //PFUNCEXPECT("-1>-2", 1.0) + EXPECT_TRUE(1.0 == plib::pfunction("0!=a", {"a"})({1.0})); +} + -- cgit v1.2.3 From e339a280f4292aa3dc74baffb0c8a22018a14711 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 5 Jul 2020 15:49:59 +0200 Subject: netlist: remove soft reset support. * Electronic circuits and base components like resistors or capacitors do not have a reset line. You can use them to create reset circuits. There is thus no point to support soft reset, the equivalent to pressing the reset button. * Fixed some bugs around reset and start up logic. * This also fixes the "scramble F3" crash. --- src/devices/machine/netlist.cpp | 22 ++++++++++++++++++---- src/devices/machine/netlist.h | 1 + src/devices/video/fixfreq.cpp | 4 ++-- src/devices/video/fixfreq.h | 15 ++++----------- src/lib/netlist/analog/nlid_twoterm.h | 9 +++++++++ src/lib/netlist/nl_base.cpp | 18 ++++++++++++++---- src/lib/netlist/nl_base.h | 23 ++++++++++++++++++----- src/lib/netlist/nl_interface.h | 9 ++++----- src/lib/netlist/prg/nltool.cpp | 2 ++ src/lib/netlist/solver/nld_matrix_solver.cpp | 2 +- 10 files changed, 73 insertions(+), 32 deletions(-) diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp index cf839c876ea..757d084c415 100644 --- a/src/devices/machine/netlist.cpp +++ b/src/devices/machine/netlist.cpp @@ -824,8 +824,10 @@ void netlist_mame_stream_output_device::device_start() void netlist_mame_stream_output_device::device_reset() { LOGDEVCALLS("reset %s\n", name()); +#if 0 m_cur = 0.0; m_last_buffer_time = netlist::netlist_time_ext::zero(); +#endif } void netlist_mame_stream_output_device::sound_update_fill(std::size_t samples, stream_sample_t *target) @@ -906,6 +908,7 @@ netlist_mame_device::netlist_mame_device(const machine_config &mconfig, device_t , m_attotime_per_clock(attotime::zero) , m_old(netlist::netlist_time_ext::zero()) , m_setup_func(nullptr) + , m_device_reset_called(false) { } @@ -1045,6 +1048,10 @@ void netlist_mame_device::device_start() m_old = netlist::netlist_time_ext::zero(); m_rem = netlist::netlist_time_ext::zero(); + m_cur_time = attotime::zero; + + m_device_reset_called = false; + LOGDEVCALLS("device_start exit\n"); } @@ -1061,10 +1068,17 @@ void netlist_mame_device::device_clock_changed() void netlist_mame_device::device_reset() { LOGDEVCALLS("device_reset\n"); - m_cur_time = attotime::zero; - m_old = netlist::netlist_time_ext::zero(); - m_rem = netlist::netlist_time_ext::zero(); - netlist().exec().reset(); + if (!m_device_reset_called) + { + // netlists don't have a reset line, doing a soft-reset is pointless + // the only reason we call these here once after device_start + // is that netlist input devices may be started after the netlist device + // and because the startup code may trigger actions which need all + // devices set up. + netlist().free_setup_resources(); + netlist().exec().reset(); + m_device_reset_called = true; + } } void netlist_mame_device::device_stop() diff --git a/src/devices/machine/netlist.h b/src/devices/machine/netlist.h index 4486eb729a6..22e3a185fe7 100644 --- a/src/devices/machine/netlist.h +++ b/src/devices/machine/netlist.h @@ -127,6 +127,7 @@ private: std::unique_ptr m_netlist; func_type m_setup_func; + bool m_device_reset_called; }; // ---------------------------------------------------------------------------------------- diff --git a/src/devices/video/fixfreq.cpp b/src/devices/video/fixfreq.cpp index 732a6994ae4..44c332c066e 100644 --- a/src/devices/video/fixfreq.cpp +++ b/src/devices/video/fixfreq.cpp @@ -119,7 +119,7 @@ void fixedfreq_monitor_state::update_sync_channel(const time_type &time, const d /* falling composite */ //LOG("HSYNC down %f %d %f\n", time * 1e6, m_last_x, m_sync_signal); } - m_last_sync = newval; + m_last_sync_val = newval; m_last_sync_time = time; } @@ -237,7 +237,7 @@ void fixedfreq_device::device_start() m_state.start(); // FIXME: will be done by netlist going forward - save_item(NAME(m_state.m_last_sync)); + save_item(NAME(m_state.m_last_sync_val)); save_item(NAME(m_state.m_last_x)); save_item(NAME(m_state.m_last_y)); save_item(NAME(m_state.m_last_sync_time)); diff --git a/src/devices/video/fixfreq.h b/src/devices/video/fixfreq.h index 6d1da4f22f7..6deeab2f639 100644 --- a/src/devices/video/fixfreq.h +++ b/src/devices/video/fixfreq.h @@ -123,7 +123,7 @@ struct fixedfreq_monitor_state fixedfreq_monitor_state(fixedfreq_monitor_desc &desc, fixedfreq_monitor_intf &intf) : m_desc(desc), m_intf(intf), - m_last_sync(0), + m_last_sync_val(0), m_col(0), m_last_x(0), m_last_y(0), @@ -145,7 +145,7 @@ struct fixedfreq_monitor_state // FIXME: once moved to netlist this may no longer be necessary. // Only copies constructor init - m_last_sync = 0.0; + m_last_sync_val = 0.0; m_col = rgb_t(0,0,0); m_last_x = 0; m_last_y = 0; @@ -177,18 +177,11 @@ struct fixedfreq_monitor_state void reset() { - m_last_sync = 0; + m_last_sync_val = 0; m_col = 0; m_last_x = 0; m_last_y = 0; - //m_last_sync_time = time_type(0); - //m_line_time = time_type(0); - //m_last_hsync_time = time_type(0); - //m_last_vsync_time = time_type(0); - //m_clock_period = time_type(0); m_vsync_filter = 0; - //m_vsync_threshold = 0; - //m_vsync_filter_timeconst = 0; m_sig_vsync = 0; m_sig_composite = 0; m_sig_field = 0; @@ -206,7 +199,7 @@ struct fixedfreq_monitor_state const fixedfreq_monitor_desc &m_desc; fixedfreq_monitor_intf &m_intf; - double m_last_sync; + double m_last_sync_val; uint32_t m_col; float m_last_x; int m_last_y; diff --git a/src/lib/netlist/analog/nlid_twoterm.h b/src/lib/netlist/analog/nlid_twoterm.h index de2a69a23f7..12a8ce3ffa1 100644 --- a/src/lib/netlist/analog/nlid_twoterm.h +++ b/src/lib/netlist/analog/nlid_twoterm.h @@ -126,6 +126,14 @@ namespace analog m_N.set_go_gt_I(a21, a22, rhs2); } + void clear_mat() const noexcept + { + const auto z = nlconst::zero(); + // GO, GT, I + m_P.set_go_gt_I(z, z, z); + m_N.set_go_gt_I(z, z, z); + } + /// \brief Get a const reference to the m_P terminal /// /// This is typically called during initialization to connect @@ -317,6 +325,7 @@ namespace analog NETLIB_RESETI() { m_cap.setparams(exec().gmin()); + clear_mat(); } /// \brief Set capacitance diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index f5e276c7601..f546056ec30 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -272,19 +272,24 @@ namespace netlist log().debug("Searching for solver\n"); m_solver = m_state.get_single_device("solver"); - m_time = netlist_time_ext::zero(); + // Don't reset time + //m_time = netlist_time_ext::zero(); m_queue.clear(); if (m_mainclock != nullptr) - m_mainclock->m_Q.net().set_next_scheduled_time(netlist_time_ext::zero()); + m_mainclock->m_Q.net().set_next_scheduled_time(m_time); //if (m_solver != nullptr) // m_solver->reset(); m_state.reset(); } - void netlist_state_t::reset() + void netlist_state_t::free_setup_resources() { m_setup = nullptr; + } + + void netlist_state_t::reset() + { // Reset all nets once ! log().verbose("Call reset on all nets:"); for (auto & n : nets()) @@ -637,7 +642,7 @@ namespace netlist void detail::net_t::reset() noexcept { - m_next_scheduled_time = netlist_time_ext::zero(); + m_next_scheduled_time = exec().time(); m_in_queue = queue_status::DELIVERED; m_new_Q = 0; @@ -680,6 +685,11 @@ namespace netlist { } + void analog_net_t::reset() noexcept + { + net_t::reset(); + m_cur_Analog = nlconst::zero(); + } // ---------------------------------------------------------------------------------------- // core_terminal_t // ---------------------------------------------------------------------------------------- diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index 4e2c84794dc..0891e81c6b4 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -691,7 +691,7 @@ namespace netlist virtual ~net_t() noexcept = default; - void reset() noexcept; + virtual void reset() noexcept; void toggle_new_Q() noexcept { m_new_Q = (m_cur_Q ^ 1); } @@ -952,6 +952,8 @@ namespace netlist analog_net_t(netlist_state_t &nl, const pstring &aname, detail::core_terminal_t *railterminal = nullptr); + void reset() noexcept override; + nl_fptype Q_Analog() const noexcept { return m_cur_Analog; } void set_Q_Analog(nl_fptype v) noexcept { m_cur_Analog = v; } // used by solver code ... @@ -1744,8 +1746,14 @@ namespace netlist /// void print_stats(stats_info &si) const; + /// \brief call reset on all netlist components + /// void reset(); + /// \brief prior to running free no longer needed resources + /// + void free_setup_resources(); + private: device_arena m_pool; // must be deleted last! @@ -1785,10 +1793,7 @@ namespace netlist m_inc = netlist_time::from_fp(plib::reciprocal(m_freq()*nlconst::two())); } - NETLIB_RESETI() - { - m_Q.net().set_next_scheduled_time(netlist_time_ext::zero()); - } + NETLIB_RESETI(); NETLIB_UPDATE_PARAMI() { @@ -2147,6 +2152,14 @@ namespace netlist analog_input_t m_GND; }; + namespace devices + { + inline NETLIB_RESET(mainclock) + { + m_Q.net().set_next_scheduled_time(exec().time()); + } + } // namespace devices + // ----------------------------------------------------------------------------- // Hot section // diff --git a/src/lib/netlist/nl_interface.h b/src/lib/netlist/nl_interface.h index dba7bd5248a..fc87855d014 100644 --- a/src/lib/netlist/nl_interface.h +++ b/src/lib/netlist/nl_interface.h @@ -149,14 +149,13 @@ namespace netlist , m_param_offsets(*this, 0, "OFFSET{}", 0.0) { connect(m_feedback, m_Q); + for (auto & elem : m_buffers) + elem = nullptr; } protected: NETLIB_RESETI() { - m_pos = 0; - for (auto & elem : m_buffers) - elem = nullptr; } NETLIB_UPDATEI() @@ -232,8 +231,8 @@ namespace netlist object_array_t m_param_names; object_array_t m_param_mults; object_array_t m_param_offsets; - std::array m_params; - std::array m_buffers; + std::array m_params; + std::array m_buffers; }; } // namespace interface diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index d849e15c755..a4946c00d3e 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -478,6 +478,7 @@ void tool_app_t::run() // Inputs must be read before reset -> will clear setup and parser inps = read_input(nt.setup(), opt_inp()); + nt.free_setup_resources(); nt.exec().reset(); ttr = netlist::netlist_time_ext::from_fp(opt_ttr()); @@ -608,6 +609,7 @@ void tool_app_t::compile_one_and_add_to_map(const pstring &file, // need to reset ... + nt.free_setup_resources(); nt.exec().reset(); auto mp(nt.exec().solver()->create_solver_code(target)); diff --git a/src/lib/netlist/solver/nld_matrix_solver.cpp b/src/lib/netlist/solver/nld_matrix_solver.cpp index ec457b934d3..10ce81754ec 100644 --- a/src/lib/netlist/solver/nld_matrix_solver.cpp +++ b/src/lib/netlist/solver/nld_matrix_solver.cpp @@ -428,7 +428,7 @@ namespace solver void matrix_solver_t::reset() { - m_last_step = netlist_time_ext::zero(); + //m_last_step = netlist_time_ext::zero(); } void matrix_solver_t::step(netlist_time delta) noexcept -- cgit v1.2.3 From 7c730c7be381a5c178f6b35f3e11cf8166342d24 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Mon, 6 Jul 2020 00:07:40 +1000 Subject: ondra: removed bank2 since it is just fixed ram --- src/mame/drivers/ondra.cpp | 2 +- src/mame/includes/ondra.h | 2 -- src/mame/machine/ondra.cpp | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/mame/drivers/ondra.cpp b/src/mame/drivers/ondra.cpp index b97086182c6..947043689ec 100644 --- a/src/mame/drivers/ondra.cpp +++ b/src/mame/drivers/ondra.cpp @@ -35,7 +35,7 @@ ToDo: void ondra_state::mem_map(address_map &map) { map(0x0000, 0x3fff).bankrw("bank1"); - map(0x4000, 0xdfff).bankrw("bank2"); + map(0x4000, 0xdfff).ram(); map(0xe000, 0xffff).bankrw("bank3"); } diff --git a/src/mame/includes/ondra.h b/src/mame/includes/ondra.h index c3ec2d4a9b4..cbd06467788 100644 --- a/src/mame/includes/ondra.h +++ b/src/mame/includes/ondra.h @@ -24,7 +24,6 @@ public: , m_ram(*this, RAM_TAG) , m_rom(*this, "maincpu") , m_bank1(*this, "bank1") - , m_bank2(*this, "bank2") , m_bank3(*this, "bank3") , m_beep(*this, "beeper") , m_io_keyboard(*this, "LINE%u", 0U) @@ -58,7 +57,6 @@ private: required_device m_ram; required_memory_region m_rom; required_memory_bank m_bank1; - required_memory_bank m_bank2; required_memory_bank m_bank3; required_device m_beep; required_ioport_array<10> m_io_keyboard; diff --git a/src/mame/machine/ondra.cpp b/src/mame/machine/ondra.cpp index 75c9875f9a5..a525537b609 100644 --- a/src/mame/machine/ondra.cpp +++ b/src/mame/machine/ondra.cpp @@ -118,7 +118,6 @@ void ondra_state::machine_reset() m_bank_status = 0; m_bank_old = 0xff; update_banks(); - m_bank2->set_base(m_ram->pointer() + 0x4000); } void ondra_state::machine_start() -- cgit v1.2.3 From 4ff68576b75afeecff27b184bb9bfcaec7dc2c58 Mon Sep 17 00:00:00 2001 From: Ryan Holtz Date: Sun, 5 Jul 2020 16:54:16 +0200 Subject: -m6809: Still perform an IRQ acknowledge cycle on software interrupts. Fixes Fairlight CMI IIx memory-map diagnostics. [Ryan Holtz] --- src/devices/cpu/m6809/base6x09.ops | 3 +++ src/devices/cpu/m6809/m6809.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/devices/cpu/m6809/base6x09.ops b/src/devices/cpu/m6809/base6x09.ops index d41df55ecef..7e29ba116e8 100644 --- a/src/devices/cpu/m6809/base6x09.ops +++ b/src/devices/cpu/m6809/base6x09.ops @@ -504,6 +504,7 @@ SWI: // doesn't use SOFTWARE_INTERRUPT label because SWI will // inhibit IRQ/FIRQ set_ea(VECTOR_SWI); + standard_irq_callback(M6809_SWI); m_cc |= CC_E; set_regop16(m_s); m_temp.w = entire_state_registers(); @@ -513,10 +514,12 @@ SWI: SWI2: set_ea(VECTOR_SWI2); + standard_irq_callback(M6809_SWI); goto SOFTWARE_INTERRUPT; SWI3: set_ea(VECTOR_SWI3); + standard_irq_callback(M6809_SWI); goto SOFTWARE_INTERRUPT; SOFTWARE_INTERRUPT: diff --git a/src/devices/cpu/m6809/m6809.h b/src/devices/cpu/m6809/m6809.h index 50ceef45615..de8e5988236 100644 --- a/src/devices/cpu/m6809/m6809.h +++ b/src/devices/cpu/m6809/m6809.h @@ -332,5 +332,6 @@ enum #define M6809_IRQ_LINE 0 /* IRQ line number */ #define M6809_FIRQ_LINE 1 /* FIRQ line number */ +#define M6809_SWI 2 /* Virtual SWI line to be used during SWI acknowledge cycle */ #endif // MAME_CPU_M6809_M6809_H -- cgit v1.2.3 From b154888e582742695d0bfa7c685ace30da4703b8 Mon Sep 17 00:00:00 2001 From: Ryan Holtz Date: Sun, 5 Jul 2020 16:54:37 +0200 Subject: -cmi01a: Initial framework for ticking envelope timer. [Ryan Holtz] --- src/mame/audio/cmi01a.cpp | 86 ++++++++++++++++++++++++++++++++++++----------- src/mame/audio/cmi01a.h | 10 ++++++ 2 files changed, 76 insertions(+), 20 deletions(-) diff --git a/src/mame/audio/cmi01a.cpp b/src/mame/audio/cmi01a.cpp index 37fa308d452..3fc6196addf 100644 --- a/src/mame/audio/cmi01a.cpp +++ b/src/mame/audio/cmi01a.cpp @@ -50,6 +50,8 @@ void cmi01a_device::device_add_mconfig(machine_config &config) PTM6840(config, m_ptm, DERIVED_CLOCK(1, 1)); // ptm_cmi01a_config m_ptm->o1_callback().set(FUNC(cmi01a_device::ptm_o1)); + m_ptm->o2_callback().set(FUNC(cmi01a_device::ptm_o2)); + m_ptm->o3_callback().set(FUNC(cmi01a_device::ptm_o3)); m_ptm->irq_callback().set(FUNC(cmi01a_device::ptm_irq)); INPUT_MERGER_ANY_HIGH(config, m_irq_merger).output_handler().set(FUNC(cmi01a_device::cmi01a_irq)); @@ -115,11 +117,15 @@ void cmi01a_device::device_reset() m_ws = 0; m_dir = 0; m_pia0_cb2_state = 1; + m_zx_flag = 0; m_freq = 0.0; m_status = 0; m_ptm_o1 = 0; + m_ptm_o2 = 0; + m_ptm_o3 = 0; + m_eclk = false; m_zx_timer->adjust(attotime::never); m_eosi_timer->adjust(attotime::never); @@ -186,35 +192,62 @@ void cmi01a_device::device_timer(emu_timer &timer, device_timer_id id, int param void cmi01a_device::eosi_timer_cb() { - m_pia[1]->cb1_w(0); + m_segment_cnt &= ~0x4000; // printf("End of sound\n"); } void cmi01a_device::zx_timer_cb() { - /* Set ZX */ - if (m_zx_flag == 0) - m_pia[1]->ca1_w(1); - else - m_pia[1]->ca1_w(0); - + // Toggle ZX m_zx_flag ^= 1; + // Update ZX input to PIA 1 + m_pia[1]->ca1_w(m_zx_flag); + + // 74LS74 A12 (1) is clocked by /ZX, so a 1->0 transition of the ZX flag is a positive clock transition if (m_zx_flag == 0) { - /* Low to high transition - clock flip flop */ - int op = m_ptm_o1; - - /* Set /ZCINT */ - if (op != m_zx_ff) + // Pulse /ZCINT if the O1 output of the PTM has changed + if (m_ptm_o1 != m_zx_ff) m_pia[0]->ca1_w(0); - m_zx_ff = op; + m_zx_ff = m_ptm_o1; m_pia[0]->ca1_w(1); + + // Update ECLK + bool eclk = (m_ptm_o2 && m_zx_ff) || (m_ptm_o3 && !m_zx_ff); + set_eclk(eclk); } } +void cmi01a_device::tick_ediv() +{ +} + +void cmi01a_device::set_eclk(bool eclk) +{ + bool old_eclk = m_eclk; + m_eclk = eclk; + + if (old_eclk == m_eclk) + return; + + tick_ediv(); + + // A B !(A && B) !A || !B + // 0 0 1 1 + // 0 1 1 1 + // 1 0 1 1 + // 1 1 0 0 + + //const bool load = (m_status & CHANNEL_STATUS_LOAD); + //const bool a = !load || !eclk; + //const bool b = load || m_ediv_out; + + //const bool div_clk = !a || !b; +} + void cmi01a_device::run_voice() { int val_a = m_pia[1]->a_output(); @@ -253,7 +286,8 @@ void cmi01a_device::run_voice() m_stream->set_sample_rate(cfreq); - // Set timers and things? + // Set timers and things + m_zx_flag = 0; attotime zx_period = attotime::from_ticks(64, cfreq); m_zx_timer->adjust(zx_period, 0, zx_period); @@ -324,17 +358,16 @@ void cmi01a_device::update_wave_addr(int inc) ++m_segment_cnt; /* Update end of sound interrupt flag */ - m_pia[1]->cb1_w((m_segment_cnt & 0x4000) >> 14); + //m_pia[1]->cb1_w((m_segment_cnt & 0x4000) >> 14); /* TODO Update zero crossing flag */ - m_pia[1]->ca1_w((m_segment_cnt & 0x40) >> 6); + //m_pia[1]->ca1_w((m_segment_cnt & 0x40) >> 6); /* Clock a latch on a transition */ if ((old_cnt & 0x40) && !(m_segment_cnt & 0x40)) { - // TODO: ECLK - m_pia[1]->ca2_w(1); - m_pia[1]->ca2_w(0); + //m_pia[1]->ca2_w(1); + //m_pia[1]->ca2_w(0); } /* Zero crossing interrupt is a pulse */ @@ -348,11 +381,24 @@ WRITE_LINE_MEMBER( cmi01a_device::ptm_irq ) WRITE_LINE_MEMBER( cmi01a_device::ptm_o1 ) { m_ptm_o1 = state; + // TODO: Update ECLK +} + +WRITE_LINE_MEMBER( cmi01a_device::ptm_o2 ) +{ + m_ptm_o2 = state; + // TODO: Update ECLK +} + +WRITE_LINE_MEMBER( cmi01a_device::ptm_o3 ) +{ + m_ptm_o3 = state; + // TODO: Update ECLK } READ_LINE_MEMBER( cmi01a_device::eosi_r ) { - return (m_segment_cnt & 0x4000) >> 14; + return BIT(m_segment_cnt, 14); } READ_LINE_MEMBER( cmi01a_device::zx_r ) diff --git a/src/mame/audio/cmi01a.h b/src/mame/audio/cmi01a.h index 6a11f655e63..60503cc90ff 100644 --- a/src/mame/audio/cmi01a.h +++ b/src/mame/audio/cmi01a.h @@ -57,6 +57,9 @@ protected: private: DECLARE_WRITE_LINE_MEMBER(cmi01a_irq); + void tick_ediv(); + void set_eclk(bool eclk); + void zx_timer_cb(); void eosi_timer_cb(); void run_voice(); @@ -84,6 +87,11 @@ private: uint8_t m_status; int m_ptm_o1; + int m_ptm_o2; + int m_ptm_o3; + + bool m_eclk; + bool m_ediv_out; devcb_write_line m_irq_cb; @@ -99,6 +107,8 @@ private: void pia_1_b_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER( ptm_o1 ); + DECLARE_WRITE_LINE_MEMBER( ptm_o2 ); + DECLARE_WRITE_LINE_MEMBER( ptm_o3 ); DECLARE_WRITE_LINE_MEMBER( ptm_irq ); }; -- cgit v1.2.3 From e91cc18ec033bf361fa4b118ea62b52ea9748a71 Mon Sep 17 00:00:00 2001 From: Ryan Holtz Date: Sun, 5 Jul 2020 16:55:01 +0200 Subject: -cmi2x: Completely reworked memory mapping. Performance no logner tanks during disk or screen accesses. [Ryan Holtz] --- src/mame/drivers/cmi.cpp | 573 +++++++++++++++++++++++++++++++---------------- 1 file changed, 376 insertions(+), 197 deletions(-) diff --git a/src/mame/drivers/cmi.cpp b/src/mame/drivers/cmi.cpp index 5da94aebe20..76f5435da7c 100644 --- a/src/mame/drivers/cmi.cpp +++ b/src/mame/drivers/cmi.cpp @@ -92,6 +92,7 @@ #include "machine/6850acia.h" #include "machine/6840ptm.h" #include "machine/7474.h" +#include "machine/bankdev.h" #include "machine/clock.h" #include "machine/i8214.h" #include "machine/input_merger.h" @@ -181,7 +182,6 @@ static const int ch_int_levels[8] = #define FDC_STATUS_INTERRUPT (1 << 6) #define FDC_STATUS_DRIVER_LOAD (1 << 7) - class cmi_state : public driver_device { public: @@ -219,6 +219,8 @@ public: , m_lp_y_port(*this, "LP_Y") , m_lp_touch_port(*this, "LP_TOUCH") , m_cmi07_ram(*this, "cmi07_ram") + , m_cpu1_periphs(*this, "cpu1_periphs") + , m_cpu2_periphs(*this, "cpu2_periphs") { } @@ -274,8 +276,19 @@ public: void video_w(offs_t offset, uint8_t data); void vscroll_w(uint8_t data); void video_attr_w(uint8_t data); + uint8_t vram_r(offs_t offset); void vram_w(offs_t offset, uint8_t data); + + template uint8_t ram_range_r(offs_t offset); + template void ram_range_w(offs_t offset, uint8_t data); + template uint8_t vram_range_r(offs_t offset); + template void vram_range_w(offs_t offset, uint8_t data); + template uint8_t cards_range_r(offs_t offset); + template void cards_range_w(offs_t offset, uint8_t data); + template uint8_t periphs_range_r(offs_t offset); + template void periphs_range_w(offs_t offset, uint8_t data); + uint8_t tvt_r(); void tvt_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER( pia_q219_irqa ); @@ -295,6 +308,10 @@ public: void mapsel_w(offs_t offset, uint8_t data); template uint8_t irq_ram_r(offs_t offset); template void irq_ram_w(offs_t offset, uint8_t data); + template uint8_t scratch_ram_r(offs_t offset); + template void scratch_ram_w(offs_t offset, uint8_t data); + template uint8_t scratch_ram_fa_r(offs_t offset); + template void scratch_ram_fa_w(offs_t offset, uint8_t data); // MIDI/SMPTE void midi_dma_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); @@ -336,6 +353,9 @@ public: void maincpu2_map(address_map &map); void midicpu_map(address_map &map); + void cpu1_periphs_map(address_map &map); + void cpu2_periphs_map(address_map &map); + protected: required_device m_maincpu1; required_device m_maincpu2; @@ -380,6 +400,9 @@ protected: required_shared_ptr m_cmi07_ram; + required_device m_cpu1_periphs; + required_device m_cpu2_periphs; + address_space *m_cpu1space; address_space *m_cpu2space; @@ -393,8 +416,6 @@ private: // Memory bool map_is_active(int cpunum, int map, uint8_t *map_info); void update_address_space(int cpunum, uint8_t mapinfo); - void install_video_ram(int cpunum); - void install_peripherals(int cpunum); // Video void hblank(); @@ -420,8 +441,9 @@ private: std::unique_ptr m_q256_ram[2]; uint8_t m_ram_indices[2][PAGE_COUNT]; uint8_t m_map_ram_latch; - int m_cpu_active_space[2]; // TODO: Make one register + int m_cpu_active_space[2]; int m_cpu_map_switch[2]; + uint8_t m_curr_mapinfo[2]; uint8_t m_irq_address[2][2]; int m_m6809_bs_hack_cnt[2]; @@ -435,21 +457,23 @@ private: /* QFC9 floppy disk controller card */ uint8_t * m_qfc9_region_ptr; - int m_fdc_drq; + int m_fdc_drq; uint8_t m_fdc_addr; uint8_t m_fdc_ctrl; uint8_t m_fdc_status; - PAIR m_fdc_dma_addr; - PAIR m_fdc_dma_cnt; + PAIR m_fdc_dma_addr; + PAIR m_fdc_dma_cnt; /* CMI-07 */ uint8_t m_cmi07_ctrl; + bool m_cmi07_base_enable[2]; + uint16_t m_cmi07_base_addr; uint8_t m_msm5832_addr; // Master card (CMI-02) - int m_cmi02_ptm_irq; - uint8_t m_cmi02_pia_chsel; + int m_cmi02_ptm_irq; + uint8_t m_cmi02_pia_chsel; }; /************************************** @@ -631,11 +655,6 @@ void cmi_state::video_attr_w(uint8_t data) // TODO } -void cmi_state::vram_w(offs_t offset, uint8_t data) -{ - m_video_ram[offset] = data; -} - void cmi_state::tvt_w(uint8_t data) { if ((data >= 0x20 && data <= 0x7e) || data == 0x0a || data == 0x0d) @@ -649,6 +668,11 @@ uint8_t cmi_state::tvt_r() return 0; } +void cmi_state::vram_w(offs_t offset, uint8_t data) +{ + m_video_ram[offset] = data; +} + uint8_t cmi_state::vram_r(offs_t offset) { if (machine().side_effects_disabled()) @@ -671,6 +695,220 @@ template uint8_t cmi_state::rom_r(offs_t offset) return *(((uint8_t *)m_q133_region->base()) + base + offset); } +template uint8_t cmi_state::perr_r(offs_t offset) +{ + m_maincpu2_irq0_merger->in_w<1>(1); + + const uint8_t page = offset >> 11; + const uint8_t mapinfo = m_curr_mapinfo[cpunum]; + const uint8_t page_info = m_map_ram[0][((mapinfo & 0x1f) << PAGE_SHIFT) + page]; + const uint8_t data = m_q256_ram[0][(page_info & 0x7f) * PAGE_SIZE + (offset & 0x7ff)]; + return data; +} + +template void cmi_state::perr_w(offs_t offset, uint8_t data) +{ + const uint8_t page = offset >> 11; + const uint8_t mapinfo = m_curr_mapinfo[cpunum]; + const uint8_t page_info = m_map_ram[0][((mapinfo & 0x1f) << PAGE_SHIFT) + page]; + m_q256_ram[0][(page_info & 0x7f) * PAGE_SIZE + (offset & 0x7ff)] = data; +} + +template uint8_t cmi_state::ram_range_r(offs_t offset) +{ + const uint16_t addr = base + offset; + const uint8_t mapinfo = m_curr_mapinfo[cpunum]; + const bool perr_en = BIT(mapinfo, 6); + const uint8_t page = addr >> 11; + const uint8_t page_info = m_map_ram[0][((mapinfo & 0x1f) << PAGE_SHIFT) + page]; + + if (m_cmi07_base_enable[cpunum] && (addr & 0xc000) == m_cmi07_base_addr) + { + return m_cmi07_ram[(page * PAGE_SIZE) & 0x3fff]; + } + + if (perr_en) + { + return perr_r(addr); + } + else if (BIT(page_info, 7)) + { + const uint32_t ram_base = (page_info & 0x7f) << 11; + return m_q256_ram[0][ram_base | (addr & 0x7ff)]; + } + + return 0x00; +} + +template void cmi_state::ram_range_w(offs_t offset, uint8_t data) +{ + const uint16_t addr = base + offset; + const uint8_t mapinfo = m_curr_mapinfo[cpunum]; + const bool perr_en = BIT(mapinfo, 6); + const uint8_t page = addr >> 11; + const uint8_t page_info = m_map_ram[0][((mapinfo & 0x1f) << PAGE_SHIFT) + page]; + + if (m_cmi07_base_enable[cpunum] && (addr & 0xc000) == m_cmi07_base_addr) + { + m_cmi07_ram[(page * PAGE_SIZE) & 0x3fff] = data; + return; + } + + if (perr_en) + { + perr_w(addr, data); + } + else if (BIT(page_info, 7)) + { + const uint32_t ram_base = (page_info & 0x7f) << 11; + m_q256_ram[0][ram_base | (addr & 0x7ff)] = data; + } +} + +template uint8_t cmi_state::vram_range_r(offs_t offset) +{ + const uint8_t mapinfo = m_curr_mapinfo[cpunum]; + if (!BIT(mapinfo, 5)) + { + return vram_r(offset); + } + else + { + const uint16_t address = 0x8000 + offset; + const uint8_t page = (offset >> 11) + 16; + const uint8_t page_info = m_map_ram[0][((mapinfo & 0x1f) << PAGE_SHIFT) + page]; + + if (m_cmi07_base_enable[cpunum] && (address & 0xc000) == m_cmi07_base_addr) + { + return m_cmi07_ram[(page * PAGE_SIZE) & 0x3fff]; + } + + if (BIT(page_info, 7)) + { + const uint32_t ram_base = (page_info & 0x7f) << 11; + return m_q256_ram[0][ram_base | (offset & 0x7ff)]; + } + } + + return 0x00; +} + +template void cmi_state::vram_range_w(offs_t offset, uint8_t data) +{ + const uint8_t mapinfo = m_curr_mapinfo[cpunum]; + if (!BIT(mapinfo, 5)) + { + vram_w(offset, data); + } + else + { + const uint16_t address = 0x8000 + offset; + const uint8_t page = (offset >> 11) + 16; + const uint8_t page_info = m_map_ram[0][((mapinfo & 0x1f) << PAGE_SHIFT) + page]; + + if (m_cmi07_base_enable[cpunum] && (address & 0xc000) == m_cmi07_base_addr) + { + m_cmi07_ram[(page * PAGE_SIZE) & 0x3fff] = data; + return; + } + + if (BIT(page_info, 7)) + { + const uint32_t ram_base = (page_info & 0x7f) << 11; + m_q256_ram[0][ram_base | (offset & 0x7ff)] = data; + } + } +} + +template uint8_t cmi_state::cards_range_r(offs_t offset) +{ + const uint8_t mapinfo = m_curr_mapinfo[cpunum]; + if (!BIT(mapinfo, 7) && offset < 0x40) + { + return cmi02_r(offset); + } + else + { + const uint8_t page = (offset >> 11) + 28; + const uint8_t page_info = m_map_ram[0][((mapinfo & 0x1f) << PAGE_SHIFT) + page]; + + if (BIT(page_info, 7)) + { + const uint32_t ram_base = (page_info & 0x7f) << 11; + return m_q256_ram[0][ram_base | (offset & 0x7ff)]; + } + } + return 0x00; +} + +template void cmi_state::cards_range_w(offs_t offset, uint8_t data) +{ + const uint8_t mapinfo = m_curr_mapinfo[cpunum]; + if (!BIT(mapinfo, 7) && offset < 0x40) + { + cmi02_w(offset, data); + } + else + { + const uint8_t page = (offset >> 11) + 28; + const uint8_t page_info = m_map_ram[0][((mapinfo & 0x1f) << PAGE_SHIFT) + page]; + + if (BIT(page_info, 7)) + { + const uint32_t ram_base = (page_info & 0x7f) << 11; + m_q256_ram[0][ram_base | (offset & 0x7ff)] = data; + } + } +} + +template uint8_t cmi_state::periphs_range_r(offs_t offset) +{ + const uint8_t mapinfo = m_curr_mapinfo[cpunum]; + if (!BIT(mapinfo, 7)) + { + if (cpunum) + return m_cpu2_periphs->read8(offset); + else + return m_cpu1_periphs->read8(offset); + } + else + { + const uint8_t page = (offset >> 11) + 30; + const uint8_t page_info = m_map_ram[0][((mapinfo & 0x1f) << PAGE_SHIFT) + page]; + + if (BIT(page_info, 7)) + { + const uint32_t ram_base = (page_info & 0x7f) << 11; + return m_q256_ram[0][ram_base | (offset & 0x7ff)]; + } + } + + return 0x00; +} + +template void cmi_state::periphs_range_w(offs_t offset, uint8_t data) +{ + const uint8_t mapinfo = m_curr_mapinfo[cpunum]; + if (!BIT(mapinfo, 7)) + { + if (cpunum) + m_cpu2_periphs->write8(offset, data); + else + m_cpu1_periphs->write8(offset, data); + } + else + { + const uint8_t page = (offset >> 11) + 30; + const uint8_t page_info = m_map_ram[0][((mapinfo & 0x1f) << PAGE_SHIFT) + page]; + + if (BIT(page_info, 7)) + { + const uint32_t ram_base = (page_info & 0x7f) << 11; + m_q256_ram[0][ram_base | (offset & 0x7ff)] = data; + } + } +} + void cmi_state::map_ram_w(offs_t offset, uint8_t data) { if ((offset & 1) == 0) @@ -679,21 +917,18 @@ void cmi_state::map_ram_w(offs_t offset, uint8_t data) } else { - for (int i = 0; i < NUM_Q256_CARDS; ++i) - { - uint8_t map_info; - int map = (offset >> 6); - int page_enable = ((m_map_ram_latch & 0x80) && (i == (m_map_ram_latch & 7))) ? 0x80 : 0; + uint8_t map_info; + int map = (offset >> 6); + int page_enable = ((m_map_ram_latch & 0x80) && (0 == (m_map_ram_latch & 7))) ? 0x80 : 0; - m_map_ram[i][offset >> 1] = page_enable | (data & 0x7f); + m_map_ram[0][offset >> 1] = page_enable | (data & 0x7f); - /* Determine if this map is in use by either CPU */ - if (map_is_active(CPU_1, map, &map_info)) - update_address_space(0, map_info); + /* Determine if this map is in use by either CPU */ + if (map_is_active(CPU_1, map, &map_info)) + update_address_space(0, map_info); - if (map_is_active(CPU_2, map, &map_info)) - update_address_space(1, map_info); - } + if (map_is_active(CPU_2, map, &map_info)) + update_address_space(1, map_info); } } @@ -790,7 +1025,7 @@ uint8_t cmi_state::parity_r(offs_t offset) { m_maincpu2_irq0_merger->in_w<1>(0); LOG("%s: parity_r %04x\n", machine().describe_context(), offset); - return 0x00; + return 0xff; } void cmi_state::mapsel_w(offs_t offset, uint8_t data) @@ -884,15 +1119,26 @@ void cmi_state::midi_latch_w(uint8_t data) } } -/* The maps are dynamically populated */ void cmi_state::maincpu1_map(address_map &map) { - map(0xfffe, 0xffff).r(FUNC(cmi_state::vector_r<0>)); + map(0x0000, 0x7fff).rw(&cmi_state::ram_range_r<0, 0x0000>, "cmi_state::ram_range_r<0, 0x0000>", + &cmi_state::ram_range_w<0, 0x0000>, "cmi_state::ram_range_w<0, 0x0000>"); + map(0x8000, 0xbfff).rw(FUNC(cmi_state::vram_range_r<0>), FUNC(cmi_state::vram_range_w<0>)); + map(0xc000, 0xdfff).rw(&cmi_state::ram_range_r<0, 0xc000>, "cmi_state::ram_range_r<0, 0xc000>", + &cmi_state::ram_range_w<0, 0xc000>, "cmi_state::ram_range_w<0, 0xc000>"); + map(0xe000, 0xefff).rw(FUNC(cmi_state::cards_range_r<0>), FUNC(cmi_state::cards_range_w<0>)); + map(0xf000, 0xffff).rw(FUNC(cmi_state::periphs_range_r<0>), FUNC(cmi_state::periphs_range_w<0>)); } void cmi_state::maincpu2_map(address_map &map) { - map(0xfffe, 0xffff).r(FUNC(cmi_state::vector_r<1>)); + map(0x0000, 0x7fff).rw(&cmi_state::ram_range_r<1, 0x0000>, "cmi_state::ram_range_r<1, 0x0000>", + &cmi_state::ram_range_w<1, 0x0000>, "cmi_state::ram_range_w<1, 0x0000>"); + map(0x8000, 0xbfff).rw(FUNC(cmi_state::vram_range_r<1>), FUNC(cmi_state::vram_range_w<1>)); + map(0xc000, 0xdfff).rw(&cmi_state::ram_range_r<1, 0xc000>, "cmi_state::ram_range_r<1, 0xc000>", + &cmi_state::ram_range_w<1, 0xc000>, "cmi_state::ram_range_w<1, 0xc000>"); + map(0xe000, 0xefff).rw(FUNC(cmi_state::cards_range_r<1>), FUNC(cmi_state::cards_range_w<1>)); + map(0xf000, 0xffff).rw(FUNC(cmi_state::periphs_range_r<1>), FUNC(cmi_state::periphs_range_w<1>)); } void cmi_state::midicpu_map(address_map &map) @@ -923,6 +1169,69 @@ void cmi_state::cmi07cpu_map(address_map &map) map(0xc000, 0xffff).ram().share("cmi07_ram"); } +void cmi_state::cpu1_periphs_map(address_map &map) +{ + map(0x0000, 0x07ff).rw(FUNC(cmi_state::rom_r<0>), FUNC(cmi_state::map_ram_w)); + map(0x0800, 0x0bff).rom().region("q133", 0x2800); + map(0x0c40, 0x0c4f).rw(FUNC(cmi_state::parity_r), FUNC(cmi_state::mapsel_w)); + map(0x0c5a, 0x0c5b).noprw(); // Q077 HDD controller - not installed + map(0x0c5e, 0x0c5e).rw(FUNC(cmi_state::atomic_r), FUNC(cmi_state::cpufunc_w)); + map(0x0c5f, 0x0c5f).rw(FUNC(cmi_state::map_r<0>), FUNC(cmi_state::map_w<0>)); + map(0x0c80, 0x0c83).rw(m_q133_acia[0], FUNC(mos6551_device::read), FUNC(mos6551_device::write)); + map(0x0c84, 0x0c87).rw(m_q133_acia[1], FUNC(mos6551_device::read), FUNC(mos6551_device::write)); + map(0x0c88, 0x0c8b).rw(m_q133_acia[2], FUNC(mos6551_device::read), FUNC(mos6551_device::write)); + map(0x0c8c, 0x0c8f).rw(m_q133_acia[3], FUNC(mos6551_device::read), FUNC(mos6551_device::write)); + map(0x0c90, 0x0c97).rw(m_q133_ptm, FUNC(ptm6840_device::read), FUNC(ptm6840_device::write)); + //map(0x0ca0, 0x0ca0).w(FUNC(cmi_state::midi_latch_w)); + map(0x0cbc, 0x0cbc).rw(FUNC(cmi_state::cmi07_r), FUNC(cmi_state::cmi07_w)); + map(0x0cc0, 0x0cc3).r(FUNC(cmi_state::lightpen_r)); + map(0x0cc4, 0x0cc7).rw(m_q219_pia, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0x0cc8, 0x0ccf).rw(m_q219_ptm, FUNC(ptm6840_device::read), FUNC(ptm6840_device::write)); + map(0x0cd0, 0x0cdc).rw(FUNC(cmi_state::video_r), FUNC(cmi_state::video_w)); + map(0x0ce0, 0x0ce1).rw(FUNC(cmi_state::fdc_r), FUNC(cmi_state::fdc_w)); + map(0x0ce2, 0x0cef).noprw(); // Monitor ROM will attempt to detect floppy disk controller cards in this entire range + map(0x0cf0, 0x0cf7).rw(m_q133_pia[0], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0x0cf8, 0x0cff).rw(m_q133_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0x0cfc, 0x0cfc).w(FUNC(cmi_state::i8214_cpu1_w)); + map(0x0cfd, 0x0cfd).w(FUNC(cmi_state::i8214_cpu2_w)); + map(0x0d00, 0x0eff).rw(FUNC(cmi_state::shared_ram_r), FUNC(cmi_state::shared_ram_w)); + map(0x0f00, 0x0ff7).rw(FUNC(cmi_state::scratch_ram_r<0>), FUNC(cmi_state::scratch_ram_w<0>)); + map(0x0ff8, 0x0ff9).rw(FUNC(cmi_state::irq_ram_r<0>), FUNC(cmi_state::irq_ram_w<0>)); + map(0x0ffa, 0x0ffd).rw(FUNC(cmi_state::scratch_ram_fa_r<0>), FUNC(cmi_state::scratch_ram_fa_w<0>)); + map(0x0ffe, 0x0fff).r(FUNC(cmi_state::vector_r<0>)); +} + +void cmi_state::cpu2_periphs_map(address_map &map) +{ + map(0x0000, 0x07ff).rw(FUNC(cmi_state::rom_r<1>), FUNC(cmi_state::map_ram_w)); + map(0x0800, 0x0bff).rom().region("q133", 0x1800); + map(0x0c40, 0x0c4f).rw(FUNC(cmi_state::parity_r), FUNC(cmi_state::mapsel_w)); + map(0x0c5a, 0x0c5b).noprw(); // Q077 HDD controller - not installed + map(0x0c5e, 0x0c5e).rw(FUNC(cmi_state::atomic_r), FUNC(cmi_state::cpufunc_w)); + map(0x0c5f, 0x0c5f).rw(FUNC(cmi_state::map_r<1>), FUNC(cmi_state::map_w<1>)); + map(0x0c80, 0x0c83).rw(m_q133_acia[0], FUNC(mos6551_device::read), FUNC(mos6551_device::write)); + map(0x0c84, 0x0c87).rw(m_q133_acia[1], FUNC(mos6551_device::read), FUNC(mos6551_device::write)); + map(0x0c88, 0x0c8b).rw(m_q133_acia[2], FUNC(mos6551_device::read), FUNC(mos6551_device::write)); + map(0x0c8c, 0x0c8f).rw(m_q133_acia[3], FUNC(mos6551_device::read), FUNC(mos6551_device::write)); + map(0x0c90, 0x0c97).rw(m_q133_ptm, FUNC(ptm6840_device::read), FUNC(ptm6840_device::write)); + //map(0x0ca0, 0x0ca0).w(FUNC(cmi_state::midi_latch_w)); + map(0x0cc0, 0x0cc3).r(FUNC(cmi_state::lightpen_r)); + map(0x0cc4, 0x0cc7).rw(m_q219_pia, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0x0cc8, 0x0ccf).rw(m_q219_ptm, FUNC(ptm6840_device::read), FUNC(ptm6840_device::write)); + map(0x0cd0, 0x0cdc).rw(FUNC(cmi_state::video_r), FUNC(cmi_state::video_w)); + map(0x0ce0, 0x0ce1).rw(FUNC(cmi_state::fdc_r), FUNC(cmi_state::fdc_w)); + map(0x0ce2, 0x0cef).noprw(); // Monitor ROM will attempt to detect floppy disk controller cards in this entire range + map(0x0cf0, 0x0cf7).rw(m_q133_pia[0], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0x0cf8, 0x0cff).rw(m_q133_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0x0cfc, 0x0cfc).w(FUNC(cmi_state::i8214_cpu1_w)); + map(0x0cfd, 0x0cfd).w(FUNC(cmi_state::i8214_cpu2_w)); + map(0x0d00, 0x0eff).rw(FUNC(cmi_state::shared_ram_r), FUNC(cmi_state::shared_ram_w)); + map(0x0f00, 0x0ff7).rw(FUNC(cmi_state::scratch_ram_r<1>), FUNC(cmi_state::scratch_ram_w<1>)); + map(0x0ff8, 0x0ff9).rw(FUNC(cmi_state::irq_ram_r<1>), FUNC(cmi_state::irq_ram_w<1>)); + map(0x0ffa, 0x0ffd).rw(FUNC(cmi_state::scratch_ram_fa_r<1>), FUNC(cmi_state::scratch_ram_fa_w<1>)); + map(0x0ffe, 0x0fff).r(FUNC(cmi_state::vector_r<1>)); +} + /* Input ports */ static INPUT_PORTS_START( cmi2x ) PORT_START("LP_X") @@ -935,6 +1244,26 @@ static INPUT_PORTS_START( cmi2x ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME ( "Lightpen Touch" ) PORT_CODE( MOUSECODE_BUTTON1 ) INPUT_PORTS_END +template uint8_t cmi_state::scratch_ram_r(offs_t offset) +{ + return m_scratch_ram[cpunum][offset]; +} + +template void cmi_state::scratch_ram_w(offs_t offset, uint8_t data) +{ + m_scratch_ram[cpunum][offset] = data; +} + +template uint8_t cmi_state::scratch_ram_fa_r(offs_t offset) +{ + return m_scratch_ram[cpunum][0xfa + offset]; +} + +template void cmi_state::scratch_ram_fa_w(offs_t offset, uint8_t data) +{ + m_scratch_ram[cpunum][0xfa + offset] = data; +} + bool cmi_state::map_is_active(int cpunum, int map, uint8_t *map_info) { if (m_cpu_active_space[cpunum] == MAPPING_A) @@ -957,85 +1286,7 @@ bool cmi_state::map_is_active(int cpunum, int map, uint8_t *map_info) void cmi_state::update_address_space(int cpunum, uint8_t mapinfo) { - int map = mapinfo & 0x1f; - bool vram_en = !BIT(mapinfo, 5); - bool perr_en = BIT(mapinfo, 6); - bool periph_en = !BIT(mapinfo, 7); - int i; - - address_space *space = (cpunum == 0 ? m_cpu1space : m_cpu2space); - - space->unmap_readwrite(0x0000, 0xffff); - - if (perr_en) - { - if (cpunum == CPU_1) - { - space->install_readwrite_handler(0x0000, 0xffff, read8sm_delegate(*this, FUNC(cmi_state::perr_r)), write8sm_delegate(*this, FUNC(cmi_state::perr_w))); - } - else - { - space->install_readwrite_handler(0x0000, 0xffff, read8sm_delegate(*this, FUNC(cmi_state::perr_r)), write8sm_delegate(*this, FUNC(cmi_state::perr_w))); - } - } - - /* Step through the map RAM assignments */ - for (int page = 0; page < PAGE_COUNT; ++page) - { - int address = page * PAGE_SIZE; - uint8_t page_info = 0; - - /* Scan through the cards */ - for (i = 0; i < NUM_Q256_CARDS; ++i) - { - page_info = m_map_ram[i][(map << PAGE_SHIFT) + page]; - - /* Page is enabled in this bank */ - if (page_info & 0x80) - break; - } - - if (BIT(m_cmi07_ctrl, 6)) - { - if ((cpunum == 0) || !BIT(m_cmi07_ctrl, 7)) - { - if ((m_cmi07_ctrl & 0x30) && (address & 0xc000) == ((m_cmi07_ctrl & 0x30) << 10)) - { - space->install_ram(address, address + PAGE_SIZE - 1, &m_cmi07_ram[(page * PAGE_SIZE) & 0x3fff]); - continue; - } - } - } - - /* No banks had this page enabled - skip */ - if ((page_info & 0x80) == 0) - continue; - - /* If Video RAM is enabled, don't install RAM here */ - if (vram_en && address >= 0x8000 && address <= 0xbfff) - continue; - - /* If peripherals are enabled, don't install RAM here */ - if (periph_en && address >= 0xf000 && address <= 0xffff) - continue; - - /* Now map the RAM page */ - if (perr_en) - { - m_ram_indices[cpunum][page] = (i << 7) | (page_info & 0x7f); - LOG("update_address_space: m_ram_indices[%d][%02x] = %02x\n", cpunum, page, m_ram_indices[cpunum][page]); - } - else - { - space->install_ram(address, address + PAGE_SIZE - 1, &m_q256_ram[i][(page_info & 0x7f) * PAGE_SIZE]); - } - } - - if (vram_en) - install_video_ram(cpunum); - - if (periph_en) - install_peripherals(cpunum); + m_curr_mapinfo[cpunum] = mapinfo; } void cmi_state::cmi07_w(uint8_t data) @@ -1050,6 +1301,10 @@ void cmi_state::cmi07_w(uint8_t data) const uint8_t prev = m_cmi07_ctrl; m_cmi07_ctrl = data; + m_cmi07_base_enable[0] = BIT(data, 6) && (data & 0x30); + m_cmi07_base_enable[1] = m_cmi07_base_enable[0] && !BIT(data, 7); + m_cmi07_base_addr = (data & 0x30) << 10; + m_cmi07cpu->set_input_line(INPUT_LINE_RESET, BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE); m_cmi07cpu->set_input_line(M6809_FIRQ_LINE, BIT(data, 1) ? CLEAR_LINE : ASSERT_LINE); m_cmi07cpu->set_input_line(INPUT_LINE_NMI, BIT(data, 2) ? CLEAR_LINE : ASSERT_LINE); @@ -1463,13 +1718,6 @@ WRITE_LINE_MEMBER(cmi_state::channel_irq) set_interrupt(CPU_1, ch_int_levels[Channel], state); } -void cmi_state::install_video_ram(int cpunum) -{ - address_space *space = (cpunum == CPU_1 ? m_cpu1space : m_cpu2space); - - space->install_readwrite_handler(0x8000, 0xbfff, read8sm_delegate(*this, FUNC(cmi_state::vram_r)), write8sm_delegate(*this, FUNC(cmi_state::vram_w))); -} - void cmi_state::i8214_cpu1_w(uint8_t data) { //LOG("%s: i8214_cpu1_w, clearing IRQ merger bit 0: %02x\n", machine().describe_context(), data); @@ -1488,21 +1736,6 @@ void cmi_state::i8214_cpu2_w(uint8_t data) m_i8214[1]->b_sgs_w(~(data & 0xf)); } -template uint8_t cmi_state::perr_r(offs_t offset) -{ - m_maincpu2_irq0_merger->in_w<1>(1); - const uint8_t ram_index = m_ram_indices[cpunum][offset / PAGE_SIZE]; - const uint8_t data = m_q256_ram[BIT(ram_index, 7)][(ram_index & 0x7f) * PAGE_SIZE + offset % PAGE_SIZE]; - LOG("%s: perr_r: offset %04x, RAM index %02x, value %02x\n", machine().describe_context(), offset, ram_index, data); - return data; -} - -template void cmi_state::perr_w(offs_t offset, uint8_t data) -{ - const uint8_t ram_index = m_ram_indices[cpunum][offset / PAGE_SIZE]; - m_q256_ram[BIT(ram_index, 7)][(ram_index & 0x7f) * PAGE_SIZE + offset % PAGE_SIZE] = data; -} - uint8_t cmi_state::shared_ram_r(offs_t offset) { return m_shared_ram[offset]; @@ -1562,68 +1795,6 @@ void cmi_state::aic_ad565_lsb_w(uint8_t data) m_aic_ad565_in[m_aic_mux_latch & 0x07] |= data; } -void cmi_state::install_peripherals(int cpunum) -{ - address_space *space = (cpunum == CPU_1 ? m_cpu1space : m_cpu2space); - - space->install_readwrite_handler(0xe000, 0xe03f, read8sm_delegate(*this, FUNC(cmi_state::cmi02_r)), write8sm_delegate(*this, FUNC(cmi_state::cmi02_w))); - - if (cpunum) - space->install_readwrite_handler(0xf000, 0xf7ff, read8sm_delegate(*this, FUNC(cmi_state::rom_r<1>)), write8sm_delegate(*this, FUNC(cmi_state::map_ram_w))); - else - space->install_readwrite_handler(0xf000, 0xf7ff, read8sm_delegate(*this, FUNC(cmi_state::rom_r<0>)), write8sm_delegate(*this, FUNC(cmi_state::map_ram_w))); - - space->install_rom(0xf800, 0xfbff, m_q133_rom + (cpunum == CPU_2 ? 0x1800 : 0x2800)); - - space->install_readwrite_handler(0xfc40, 0xfc4f, read8sm_delegate(*this, FUNC(cmi_state::parity_r)), write8sm_delegate(*this, FUNC(cmi_state::mapsel_w))); - space->nop_readwrite(0xfc5a, 0xfc5b); // Q077 HDD controller - not installed - space->install_readwrite_handler(0xfc5e, 0xfc5e, read8smo_delegate(*this, FUNC(cmi_state::atomic_r)), write8smo_delegate(*this, FUNC(cmi_state::cpufunc_w))); - if (cpunum) - space->install_readwrite_handler(0xfc5f, 0xfc5f, read8smo_delegate(*this, FUNC(cmi_state::map_r<1>)), write8smo_delegate(*this, FUNC(cmi_state::map_w<1>))); - else - space->install_readwrite_handler(0xfc5f, 0xfc5f, read8smo_delegate(*this, FUNC(cmi_state::map_r<0>)), write8smo_delegate(*this, FUNC(cmi_state::map_w<0>))); - - space->install_readwrite_handler(0xfc80, 0xfc83, read8sm_delegate(*m_q133_acia[0], FUNC(mos6551_device::read)), write8sm_delegate(*m_q133_acia[0], FUNC(mos6551_device::write))); - space->install_readwrite_handler(0xfc84, 0xfc87, read8sm_delegate(*m_q133_acia[1], FUNC(mos6551_device::read)), write8sm_delegate(*m_q133_acia[1], FUNC(mos6551_device::write))); - space->install_readwrite_handler(0xfc88, 0xfc8b, read8sm_delegate(*m_q133_acia[2], FUNC(mos6551_device::read)), write8sm_delegate(*m_q133_acia[2], FUNC(mos6551_device::write))); - space->install_readwrite_handler(0xfc8c, 0xfc8f, read8sm_delegate(*m_q133_acia[3], FUNC(mos6551_device::read)), write8sm_delegate(*m_q133_acia[3], FUNC(mos6551_device::write))); - space->install_readwrite_handler(0xfc90, 0xfc97, read8sm_delegate(*m_q133_ptm, FUNC(ptm6840_device::read)), write8sm_delegate(*m_q133_ptm, FUNC(ptm6840_device::write))); - - //space->install_write_handler(0xfca0, 0xfca0, write8smo_delegate(*this, FUNC(cmi_state::midi_latch_w))); - - space->install_readwrite_handler(0xfcbc, 0xfcbc, read8smo_delegate(*this, FUNC(cmi_state::cmi07_r)), write8smo_delegate(*this, FUNC(cmi_state::cmi07_w))); - - space->install_read_handler(0xfcc0, 0xfcc3, read8sm_delegate(*this, FUNC(cmi_state::lightpen_r))); - space->install_readwrite_handler(0xfcc4, 0xfcc7, read8sm_delegate(*m_q219_pia, FUNC(pia6821_device::read)), write8sm_delegate(*m_q219_pia, FUNC(pia6821_device::write))); - space->install_readwrite_handler(0xfcc8, 0xfccf, read8sm_delegate(*m_q219_ptm, FUNC(ptm6840_device::read)), write8sm_delegate(*m_q219_ptm, FUNC(ptm6840_device::write))); - space->install_readwrite_handler(0xfcd0, 0xfcdc, read8sm_delegate(*this, FUNC(cmi_state::video_r)), write8sm_delegate(*this, FUNC(cmi_state::video_w))); - space->install_readwrite_handler(0xfce0, 0xfce1, read8sm_delegate(*this, FUNC(cmi_state::fdc_r)), write8sm_delegate(*this, FUNC(cmi_state::fdc_w))); - space->nop_readwrite(0xfce2, 0xfcef); // Monitor ROM will attempt to detect floppy disk controller cards in this entire range - space->install_readwrite_handler(0xfcf0, 0xfcf7, read8sm_delegate(*m_q133_pia[0], FUNC(pia6821_device::read)), write8sm_delegate(*m_q133_pia[0], FUNC(pia6821_device::write))); - space->install_readwrite_handler(0xfcf8, 0xfcff, read8sm_delegate(*m_q133_pia[1], FUNC(pia6821_device::read)), write8sm_delegate(*m_q133_pia[1], FUNC(pia6821_device::write))); - - space->install_write_handler(0xfcfc, 0xfcfc, write8smo_delegate(*this, FUNC(cmi_state::i8214_cpu1_w))); - space->install_write_handler(0xfcfd, 0xfcfd, write8smo_delegate(*this, FUNC(cmi_state::i8214_cpu2_w))); - - space->install_readwrite_handler(0xfd00, 0xfeff, read8sm_delegate(*this, FUNC(cmi_state::shared_ram_r)), write8sm_delegate(*this, FUNC(cmi_state::shared_ram_w))); - - space->install_ram(0xff00, 0xfff7, &m_scratch_ram[cpunum][0]); - space->install_ram(0xfffa, 0xfffd, &m_scratch_ram[cpunum][0xfa]); - - if (cpunum) - { - space->install_readwrite_handler(0xfff8, 0xfff9, read8sm_delegate(*this, FUNC(cmi_state::irq_ram_r<1>)), write8sm_delegate(*this, FUNC(cmi_state::irq_ram_w<1>))); - space->install_read_handler(0xfffe, 0xffff, read8sm_delegate(*this, FUNC(cmi_state::vector_r<1>))); - } - else - { - space->install_readwrite_handler(0xd000, 0xdfff, read8smo_delegate(*this, FUNC(cmi_state::tvt_r)), write8smo_delegate(*this, FUNC(cmi_state::tvt_w))); - space->install_readwrite_handler(0xfff8, 0xfff9, read8sm_delegate(*this, FUNC(cmi_state::irq_ram_r<0>)), write8sm_delegate(*this, FUNC(cmi_state::irq_ram_w<0>))); - space->install_read_handler(0xfffe, 0xffff, read8sm_delegate(*this, FUNC(cmi_state::vector_r<0>))); - } -} - - /************************************* * * Interrupt Handling @@ -1850,13 +2021,9 @@ void cmi_state::machine_reset() { address_space *space = (cpunum == CPU_1 ? m_cpu1space : m_cpu2space); - space->unmap_readwrite(0x0000, 0xffff); - /* Select A (system) spaces */ m_cpu_active_space[cpunum] = MAPPING_A; - install_peripherals(cpunum); - m_irq_address[cpunum][0] = space->read_byte(0xfff8); m_irq_address[cpunum][1] = space->read_byte(0xfff9); } @@ -1866,6 +2033,9 @@ void cmi_state::machine_reset() /* CMI-07 */ m_cmi07_ctrl = 0; + m_cmi07_base_enable[0] = false; + m_cmi07_base_enable[1] = false; + m_cmi07_base_addr = 0; m_cmi07cpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); // SMIDI @@ -1886,6 +2056,9 @@ void cmi_state::machine_reset() m_q133_acia[i]->write_dsr(0); m_q133_acia[i]->write_dcd(0); } + + m_curr_mapinfo[0] = 0x00; + m_curr_mapinfo[1] = 0x00; } void cmi_state::machine_start() @@ -1952,6 +2125,12 @@ void cmi_state::cmi2x(machine_config &config) m_maincpu2->set_addrmap(AS_PROGRAM, &cmi_state::maincpu2_map); m_maincpu2->set_irq_acknowledge_callback(FUNC(cmi_state::cpu2_interrupt_callback)); + ADDRESS_MAP_BANK(config, m_cpu1_periphs).set_options(ENDIANNESS_BIG, 8, 16, 0x1000); + m_cpu1_periphs->set_addrmap(AS_PROGRAM, &cmi_state::cpu1_periphs_map); + + ADDRESS_MAP_BANK(config, m_cpu2_periphs).set_options(ENDIANNESS_BIG, 8, 16, 0x1000); + m_cpu2_periphs->set_addrmap(AS_PROGRAM, &cmi_state::cpu2_periphs_map); + M68000(config, m_midicpu, 20_MHz_XTAL / 2); m_midicpu->set_addrmap(AS_PROGRAM, &cmi_state::midicpu_map); -- cgit v1.2.3 From 625339d7ab035c452b346f8a69d156926ee8a40b Mon Sep 17 00:00:00 2001 From: fulivi Date: Sun, 5 Jul 2020 17:37:35 +0200 Subject: hp_ipc: fixed timer reloading in COP452 (#6914) --- src/devices/machine/cop452.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/devices/machine/cop452.cpp b/src/devices/machine/cop452.cpp index e70cf1db868..09e31df2c82 100644 --- a/src/devices/machine/cop452.cpp +++ b/src/devices/machine/cop452.cpp @@ -180,12 +180,9 @@ void cop452_device::device_reset() void cop452_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { - attotime target = attotime::never; - switch (m_mode) { case MODE_DUAL_FREQ: toggle_n_reload(id); - target = counts_to_attotime(m_cnt[ id ]); break; case MODE_TRIG_PULSE: @@ -195,7 +192,6 @@ void cop452_device::device_timer(emu_timer &timer, device_timer_id id, int param case MODE_NUMBER_PULSES: if (id == 0) { toggle_n_reload(0); - target = counts_to_attotime(m_cnt[ 0 ]); if (!m_out[ 0 ]) { // It seems that cnt B decrements each time OA goes low if (m_cnt[ 1 ] != 0) { @@ -204,7 +200,6 @@ void cop452_device::device_timer(emu_timer &timer, device_timer_id id, int param // End of pulse train toggle_n_reload(1); m_mode = MODE_RESET; - target = attotime::never; } } } @@ -256,7 +251,7 @@ void cop452_device::device_timer(emu_timer &timer, device_timer_id id, int param break; } - timer.adjust(target); + set_timer(id); } attotime cop452_device::counts_to_attotime(unsigned counts) const -- cgit v1.2.3 From 07e7e599a0414d549c8bdc1c1ca3fc09f6575fa9 Mon Sep 17 00:00:00 2001 From: David Haywood <28625134+DavidHaywood@users.noreply.github.com> Date: Sun, 5 Jul 2020 16:39:33 +0100 Subject: new WORKING machines (plug and play) (#6909) new WORKING machines --- Totally Spies! (France) [TeamEurope, David Haywood] PDC150 Tactile - Pocket Dream Console (VideoJet, France) [TeamEurope, David Haywood] PDC200 - Pocket Dream Console (VideoJet, France) [TeamEurope, David Haywood] Guitar Buster [Sean Riddle, David Haywood] new NOT WORKING machines --- Marvel Avengers TV Game Console (32-bit) (Lexibook) [TeamEurope, David Haywood] Wireless Duet Play Ping-Pong [Sean Riddle, David Haywood, Dave 'Foxhack' Silva] new NOT WORKING software list entries --- tvgogo.xml: Basketball (US) [Sean Riddle, David Haywood] --- hash/tvgogo.xml | 13 ++- src/mame/drivers/generalplus_gpl16250_nand.cpp | 2 +- src/mame/drivers/nes_vt.cpp | 80 +++++++++++++ src/mame/drivers/spg29x_lexibook_jg7425.cpp | 12 +- src/mame/drivers/spg2xx.cpp | 42 ++++++- src/mame/drivers/spg2xx_pdc.cpp | 154 +++++++++++++++++++++---- src/mame/drivers/spg2xx_wiwi.cpp | 137 ++++++++++++++++++++-- src/mame/includes/spg2xx.h | 4 +- src/mame/mame.lst | 6 + 9 files changed, 413 insertions(+), 37 deletions(-) diff --git a/hash/tvgogo.xml b/hash/tvgogo.xml index af2624f51c7..db1b18e9143 100644 --- a/hash/tvgogo.xml +++ b/hash/tvgogo.xml @@ -9,7 +9,7 @@ Dumped | Dumped | Name |Notes _(EU)__|__(US)__|____________|_____________________________________ Y* | Y | 4 in 1 |No controller Y | Y | Whac-A-Mole|Hammer-shaped IR motion controller - Y | - | Basketball |Ball-shaped motion controller + Y | Y | Basketball |Ball-shaped motion controller Y | | Tennis |Racquet-shaped IR motion controller | Y | Dodgeball |Motion controller | Y | Baseball |Baseball Bat shaped motion controller @@ -115,5 +115,16 @@ _(EU)__|__(US)__|____________|_____________________________________ + + + Basketball (US) + 2005 + Toyquest + + + + + + diff --git a/src/mame/drivers/generalplus_gpl16250_nand.cpp b/src/mame/drivers/generalplus_gpl16250_nand.cpp index e1eae87e606..11f3458faa4 100644 --- a/src/mame/drivers/generalplus_gpl16250_nand.cpp +++ b/src/mame/drivers/generalplus_gpl16250_nand.cpp @@ -840,7 +840,7 @@ void generalplus_gpac800_game_state::nand_beambox() // NAND dumps w/ internal bootstrap (and u'nSP 2.0 extended opcodes) (have gpnandnand strings) // the JAKKS ones seem to be known as 'Generalplus GPAC800' hardware -CONS(2010, wlsair60, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_wlsair60, "Jungle Soft / Kids Station Toys Inc", "Wireless Air 60", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(2010, wlsair60, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_wlsair60, "Jungle Soft / Kids Station Toys Inc", "Wireless Air 60", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) // some of th games seem to be based on ones found in the 'Millennium Arcade' multigames (WinFun related) so might have the same external timer check CONS(200?, beambox, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_beambox, "Hasbro", "Playskool Heroes Transformers Rescue Bots Beam Box (Spain)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) CONS(200?, mgtfit, 0, 0, generalplus_gpac800, jak_car2, generalplus_gpac800_game_state, nand_wlsair60, "MGT", "Fitness Konsole (NC1470)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) // probably has other names in English too? menus don't appear to be in German CONS(200?, vbaby, 0, 0, generalplus_gpac800_vbaby, jak_car2, generalplus_gpac800_vbaby_game_state, nand_vbaby, "VTech", "V.Baby", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) diff --git a/src/mame/drivers/nes_vt.cpp b/src/mame/drivers/nes_vt.cpp index 653ef17ac1c..ebfaf854049 100644 --- a/src/mame/drivers/nes_vt.cpp +++ b/src/mame/drivers/nes_vt.cpp @@ -176,6 +176,24 @@ public: void nes_vt_waixing_alt_pal_8mb(machine_config& config); }; +class nes_vt_waixing_alt_duetpp_state : public nes_vt_waixing_alt_state +{ +public: + nes_vt_waixing_alt_duetpp_state(const machine_config& mconfig, device_type type, const char* tag) : + nes_vt_waixing_alt_state(mconfig, type, tag) + { } + + void nes_vt_waixing_alt_4mb_duetpp(machine_config& config); + +private: + uint8_t in1_r() override + { + uint8_t i = machine().rand() & 0x18; + uint8_t ret = m_io1->read() & ~0x18; + return i | ret; + } +}; + class nes_vt_timetp36_state : public nes_vt_state { @@ -356,6 +374,8 @@ public: m_ablpinb_in0_val(0), m_plunger(*this, "PLUNGER") { } + + void nes_vt_waixing_alt_4mb_duetpp(machine_config& config); protected: virtual void machine_start() override; @@ -881,6 +901,19 @@ void nes_vt_waixing_alt_state::nes_vt_waixing_alt_pal_8mb(machine_config &config m_soc->set_8000_scramble(0x5, 0x4, 0x3, 0x2, 0x7, 0x6, 0x7, 0x8); } +void nes_vt_waixing_alt_duetpp_state::nes_vt_waixing_alt_4mb_duetpp(machine_config& config) +{ + NES_VT_SOC(config, m_soc, NTSC_APU_CLOCK); + configure_soc(m_soc); + + m_soc->set_addrmap(AS_PROGRAM, &nes_vt_ablping_state::vt_external_space_map_4mbyte); + m_soc->set_201x_descramble(0x3, 0x2, 0x7, 0x6, 0x5, 0x4); + m_soc->set_8000_scramble(0x5, 0x4, 0x3, 0x2, 0x7, 0x6, 0x7, 0x8); + + GFXDECODE(config, "gfxdecode", "soc:ppu", vt03_gfx_helper); +} + + void nes_vt_hum_state::nes_vt_hummer_2mb(machine_config& config) { NES_VT_SOC(config, m_soc, NTSC_APU_CLOCK); @@ -1364,6 +1397,46 @@ static INPUT_PORTS_START( ablpinb ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("NUDGE" ) INPUT_PORTS_END + +static INPUT_PORTS_START( duetpp ) + PORT_START("IO0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY + + PORT_START("IO1") + PORT_DIPNAME( 0x0001, 0x0001, "P2:0001" ) + PORT_DIPSETTING( 0x0000, "0000" ) + PORT_DIPSETTING( 0x0001, "0001" ) + PORT_DIPNAME( 0x0002, 0x0002, "P2:0002" ) + PORT_DIPSETTING( 0x0000, "0000" ) + PORT_DIPSETTING( 0x0002, "0002" ) + PORT_DIPNAME( 0x0004, 0x0004, "P2:0004" ) + PORT_DIPSETTING( 0x0000, "0000" ) + PORT_DIPSETTING( 0x0004, "0004" ) + PORT_DIPNAME( 0x0008, 0x0008, "P2:0008" ) + PORT_DIPSETTING( 0x0000, "0000" ) + PORT_DIPSETTING( 0x0008, "0008" ) + PORT_DIPNAME( 0x0010, 0x0010, "P2:0010" ) + PORT_DIPSETTING( 0x0000, "0000" ) + PORT_DIPSETTING( 0x0010, "0010" ) + PORT_DIPNAME( 0x0020, 0x0020, "P2:0020" ) + PORT_DIPSETTING( 0x0000, "0000" ) + PORT_DIPSETTING( 0x0020, "0020" ) + PORT_DIPNAME( 0x0040, 0x0040, "P2:0040" ) + PORT_DIPSETTING( 0x0000, "0000" ) + PORT_DIPSETTING( 0x0040, "0040" ) + PORT_DIPNAME( 0x0080, 0x0080, "P2:0080" ) + PORT_DIPSETTING( 0x0000, "0000" ) + PORT_DIPSETTING( 0x0080, "0080" ) +INPUT_PORTS_END + + static INPUT_PORTS_START( sudoku ) PORT_INCLUDE(nes_vt) INPUT_PORTS_END @@ -1637,6 +1710,11 @@ ROM_START( silv35 ) ROM_LOAD( "silverlit35.bin", 0x00000, 0x400000, CRC(7540e350) SHA1(a0cb456136560fa4d8a365dd44d815ec0e9fc2e7) ) ROM_END +ROM_START( duetpp ) + ROM_REGION( 0x400000, "mainrom", 0 ) + ROM_LOAD( "gamesporzduetpingpong.bin", 0x00000, 0x400000, CRC(96af199b) SHA1(c14ff15683545c1edf03376cebcee7ac408da733) ) +ROM_END + ROM_START( lpgm240 ) ROM_REGION( 0x800000, "mainrom", 0 ) ROM_LOAD( "w25q64jv.u1", 0x00000, 0x800000, CRC(b973e65b) SHA1(36ff137068ea56b4679c2db386ac0067de0a9eaf) ) @@ -1957,6 +2035,8 @@ CONS( 200?, vtboxing, 0, 0, nes_vt_512kb, nes_vt, nes_vt_state, empty_init // 050329 (29th March 2005) date on PCB CONS( 2005, ablpinb, 0, 0, nes_vt_pal_2mb, ablpinb, nes_vt_ablpinb_state, empty_init, "Advance Bright Ltd", "Pinball (P8002, ABL TV Game)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +// need to map 2 player controls for Ping Pong, 'Eat-Bean' (the PacMan hack) gets stuck during intermission? +CONS( 200?, duetpp, 0, 0, nes_vt_waixing_alt_4mb_duetpp, duetpp, nes_vt_waixing_alt_duetpp_state, empty_init, "Game Sporz", "Wireless Duet Play Ping-Pong", MACHINE_NOT_WORKING ) // Black pad marked 'SUDOKU' with tails on the S and U characters looping over the logo. Box says "Plug and Play Sudoku" // Has 2 sets of 4 buttons in circular 'direction pad' layouts (on the left for directions, on the right for functions) and 9 red numbered buttons with red power LED on left of them, and reset button on right diff --git a/src/mame/drivers/spg29x_lexibook_jg7425.cpp b/src/mame/drivers/spg29x_lexibook_jg7425.cpp index c8fecbcb964..24efca6eed2 100644 --- a/src/mame/drivers/spg29x_lexibook_jg7425.cpp +++ b/src/mame/drivers/spg29x_lexibook_jg7425.cpp @@ -12,7 +12,7 @@ compressed with "chdman createhd -i 4GBSD.img -o lexibook_jg7425_4gbsd.chd" (is TODO: is there an internal ROM / bootstrap area, or does this SunPlus core use vectors in a different way to the one in hyperscan.cpp? -If SPG290, should probably be merged with hyperscan.cpp +If SPG290, should probably be merged with hyperscan.cpp (it is) (only noteworthy features of PCB are ROM + RAM + Cpu Glob) @@ -106,4 +106,14 @@ ROM_START( lx_jg7425 ) DISK_IMAGE( "lexibook_jg7425_4gbsd", 0, SHA1(dc0985103edec3992efdd493feef6185daedb3fd) ) ROM_END +ROM_START( lx_aven ) + ROM_REGION( 0x200000, "maincpu", ROMREGION_32BIT | ROMREGION_LE ) + ROM_LOAD32_DWORD( "29lv800.bin", 0x000000, 0x100000, CRC(7b107f6c) SHA1(3a8e37e51dab5cab9977261e0ac17ba5194a9370) ) + + DISK_REGION( "ata:0:hdd:image" ) /* 4GB SD Card */ + DISK_IMAGE( "sd-card", 0, SHA1(911da7bf7dac391e3329e17e3f411caafac52f0f) ) +ROM_END + + CONS( 2015, lx_jg7425, 0, 0, lexibook_jg7425, lexibook_jg7425, lexibook_jg7425_state, empty_init, "Lexibook", "Lexibook JG7425 221-in-1", MACHINE_IS_SKELETON ) +CONS( 201?, lx_aven, 0, 0, lexibook_jg7425, lexibook_jg7425, lexibook_jg7425_state, empty_init, "Lexibook", "Marvel Avengers TV Game Console (32-bit) (Lexibook)", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/spg2xx.cpp b/src/mame/drivers/spg2xx.cpp index da737f067dd..0c94f913a2d 100644 --- a/src/mame/drivers/spg2xx.cpp +++ b/src/mame/drivers/spg2xx.cpp @@ -662,6 +662,30 @@ static INPUT_PORTS_START( fordrace ) PORT_BIT(0x1fff, 0x0000, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_MINMAX(0x00,0x1fff) PORT_NAME("Wheel") INPUT_PORTS_END +static INPUT_PORTS_START( totspies ) + PORT_INCLUDE( spg2xx ) + + PORT_MODIFY("P1") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("B") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("A") + PORT_BIT( 0xff80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_MODIFY("P2") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + // unit also has a 'select' button next to 'OK' and while test mode shows it onscreen too, it doesn't get tested, so probably isn't connected to anything? + PORT_MODIFY("P3") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("OK") + PORT_BIT( 0xfffe, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + + + CUSTOM_INPUT_MEMBER(spg2xx_game_fordrace_state::wheel_r) { return ioport("WHEEL_REAL")->read() >> 1; @@ -1025,6 +1049,13 @@ void spg2xx_game_state::spg2xx(machine_config &config) m_maincpu->portc_in().set(FUNC(spg2xx_game_state::base_portc_r)); } +void spg2xx_game_state::spg2xx_pal(machine_config& config) +{ + spg2xx(config); + + m_maincpu->set_pal(true); + m_screen->set_refresh_hz(50); +} void spg2xx_game_fordrace_state::fordrace(machine_config &config) { @@ -1481,6 +1512,11 @@ ROM_START( abltenni ) ROM_LOAD16_WORD_SWAP( "ablpnpwirelesstennis.bin", 0x000000, 0x400000, CRC(66bd8ef1) SHA1(a83640d5d9e84e10d29a065a61e0d7bbec16c6e4) ) ROM_END +ROM_START( totspies ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "w321tg.u2", 0x000000, 0x400000, CRC(76152ad7) SHA1(b37ea950670eb927f3f0ab5e38d0e2a5f3ca7904) ) +ROM_END + ROM_START( ablkickb ) ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "ablkickboxing.bin", 0x000000, 0x800000, CRC(61394c45) SHA1(291d28a39edcb32a8f5d776a5e5c05e6fd0abece) ) @@ -1657,11 +1693,13 @@ CONS( 2006, rad_crik, 0, 0, rad_crik, rad_crik, spg2xx_game_state, CONS( 2007, rad_fb2, 0, 0, rad_skat, rad_fb2, spg2xx_game_state, init_crc, "Radica", "Play TV Football 2", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // offers a 2 player option in menus, but seems to have only been programmed for, and released as, a single player unit, P2 controls appear unfinished. // ABL TV Games -CONS( 2006, abltenni, 0, 0, spg2xx, abltenni, spg2xx_game_state, empty_init, "f / V-Tac Technology Co Ltd.", "Wireless Tennis (WT2000, ABL TV Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2006, abltenni, 0, 0, spg2xx, abltenni, spg2xx_game_state, empty_init, "Advance Bright Ltd / V-Tac Technology Co Ltd.", "Wireless Tennis (WT2000, ABL TV Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) CONS( 2006, ablkickb, 0, 0, ablkickb, ablkickb, spg2xx_game_albkickb_state, init_ablkickb, "Advance Bright Ltd / Coleco / V-Tac Technology Co Ltd.", "Kick Boxing (BJ8888, ABL TV Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // 4 motion sensors, one for each limb -CONS( 2007, lxspidaj, 0, 0, spg2xx, lxspidaj, spg2xx_game_albkickb_state, init_ablkickb, "Lexibook", "Spider-Man Super TV Air Jet (Lexibook Junior, JG6000SP)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2007, lxspidaj, 0, 0, spg2xx_pal,lxspidaj, spg2xx_game_albkickb_state, init_ablkickb, "Lexibook", "Spider-Man Super TV Air Jet (Lexibook Junior, JG6000SP)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + +CONS( 2006, totspies, 0, 0, spg2xx_pal,totspies, spg2xx_game_state, empty_init, "Senario / Marathon - Mystery Animation Inc.", "Totally Spies! (France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) CONS( 2006, fordrace, 0, 0, fordrace, fordrace, spg2xx_game_fordrace_state, empty_init, "Excalibur Electronics", "Ford Racing", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/spg2xx_pdc.cpp b/src/mame/drivers/spg2xx_pdc.cpp index 04f17451600..431a4dd9deb 100644 --- a/src/mame/drivers/spg2xx_pdc.cpp +++ b/src/mame/drivers/spg2xx_pdc.cpp @@ -5,10 +5,10 @@ #include "includes/spg2xx.h" -class spg2xx_pdc100_game_state : public spg2xx_game_state +class spg2xx_pdc_game_state : public spg2xx_game_state { public: - spg2xx_pdc100_game_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_pdc_game_state(const machine_config &mconfig, device_type type, const char *tag) : spg2xx_game_state(mconfig, type, tag), m_numbanks(-1) { } @@ -17,6 +17,8 @@ public: void pdc_tactile(machine_config& config); void init_pdc40t(); + void init_pdc150t(); + void init_pdc200(); protected: virtual void machine_start() override; @@ -36,10 +38,30 @@ protected: return ret; } -private: int m_numbanks; }; +class spg2xx_pdc150t_game_state : public spg2xx_pdc_game_state +{ +public: + spg2xx_pdc150t_game_state(const machine_config& mconfig, device_type type, const char* tag) : + spg2xx_pdc_game_state(mconfig, type, tag) + { } + +protected: + virtual void porta_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0) override; +}; + +class spg2xx_pdc200_game_state : public spg2xx_pdc_game_state +{ +public: + spg2xx_pdc200_game_state(const machine_config& mconfig, device_type type, const char* tag) : + spg2xx_pdc_game_state(mconfig, type, tag) + { } + +protected: + virtual void porta_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0) override; +}; static INPUT_PORTS_START( pdc100 ) PORT_START("P1") @@ -123,39 +145,66 @@ static INPUT_PORTS_START( vjpp2 ) PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) INPUT_PORTS_END -void spg2xx_pdc100_game_state::machine_start() +void spg2xx_pdc_game_state::machine_start() { spg2xx_game_state::machine_start(); m_numbanks = memregion("maincpu")->bytes() / 0x800000; } -void spg2xx_pdc100_game_state::machine_reset() +void spg2xx_pdc_game_state::machine_reset() { m_current_bank = -1; switch_bank(m_numbanks - 1); // pdc100 must boot from upper bank m_maincpu->reset(); } -void spg2xx_pdc100_game_state::porta_w(offs_t offset, uint16_t data, uint16_t mem_mask) +// pdc100 simply writes 0000 at times during bootup while initializing stuff, which causes an invalid bankswitch mid-code execution +// pdc200 does similar +// direction bits don't appear to be being set correctly on port writes (similar issue to many other systems) + +void spg2xx_pdc_game_state::porta_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + if ((m_maincpu->pc() < 0x2800) && (data & 0xff00)) + { + int bank = data & 0x7; + bank &= (m_numbanks - 1); + switch_bank(bank); + } +} + +void spg2xx_pdc150t_game_state::porta_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + if ((m_maincpu->pc() < 0x2800) && (data & 0xff00)) + { + int bank = data & 0x7; + bank |= (data & 0x0100) ? 8 : 0; + bank &= (m_numbanks - 1); + switch_bank(bank); + } +} + +void spg2xx_pdc200_game_state::porta_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - // pdc100 simply writes 0000 at times during bootup while initializing stuff, which causes an invalid bankswitch mid-code execution - if (data & 0xff00) + if ((m_maincpu->pc() < 0x2800) && (data & 0xff00)) { - switch_bank(data & (m_numbanks - 1)); + int bank = data & 0x7; + bank |= (data & 0x8000) ? 8 : 0; + bank &= (m_numbanks - 1); + switch_bank(bank); } } -void spg2xx_pdc100_game_state::pdc100(machine_config &config) +void spg2xx_pdc_game_state::pdc100(machine_config &config) { non_spg_base(config); - m_maincpu->porta_out().set(FUNC(spg2xx_pdc100_game_state::porta_w)); + m_maincpu->porta_out().set(FUNC(spg2xx_pdc_game_state::porta_w)); m_maincpu->porta_in().set_ioport("P1"); m_maincpu->portb_in().set_ioport("P2"); m_maincpu->portc_in().set_ioport("P3"); // not used? } -void spg2xx_pdc100_game_state::pdc_tactile(machine_config& config) +void spg2xx_pdc_game_state::pdc_tactile(machine_config& config) { pdc100(config); @@ -163,13 +212,13 @@ void spg2xx_pdc100_game_state::pdc_tactile(machine_config& config) m_maincpu->portb_in().set_ioport("P2"); m_maincpu->portc_in().set_ioport("P3"); - m_maincpu->adc_in<0>().set(FUNC(spg2xx_pdc100_game_state::touch_xpos_r)); - m_maincpu->adc_in<1>().set(FUNC(spg2xx_pdc100_game_state::touch_ypos_r)); + m_maincpu->adc_in<0>().set(FUNC(spg2xx_pdc_game_state::touch_xpos_r)); + m_maincpu->adc_in<1>().set(FUNC(spg2xx_pdc_game_state::touch_ypos_r)); m_maincpu->adc_in<2>().set_ioport("AD3"); } -void spg2xx_pdc100_game_state::init_pdc40t() +void spg2xx_pdc_game_state::init_pdc40t() { uint8_t *src = memregion("maincpu")->base(); int len = memregion("maincpu")->bytes(); @@ -184,6 +233,51 @@ void spg2xx_pdc100_game_state::init_pdc40t() } +void spg2xx_pdc_game_state::init_pdc150t() +{ + uint16_t *src = (uint16_t*)memregion("maincpu")->base(); + int len = memregion("maincpu")->bytes(); + + for (int i = 0; i < len/2; i++) + { + src[i] = bitswap<16>(src[i], 3^8,11^8,2^8,10^8,1^8,9^8,0^8,8^8, 12^8,4^8,13^8,5^8,14^8,6^8,15^8,7^8 ); + } + +#if 0 + { + for (int bank = 0; bank < 16; bank++) + { + const int length = 0x800000 - 0x10; + const int start = (0x800000 * bank) + 0x10; + const uint8_t* rom = memregion("maincpu")->base(); + + uint32_t checksum = 0x00000000; + // the first 0x10 bytes are where the "chksum:xxxxxxxx " string is listed, so skip over them + for (int i = start; i < start + length; i++) + { + checksum += rom[i]; + } + + printf("Calculated Byte Sum of bytes is %08x)\n", checksum); + + + FILE *fp; + char filename[256]; + sprintf(filename,"decrypted_%s_%d", machine().system().name, bank); + fp=fopen(filename, "w+b"); + if (fp) + { + fwrite(&rom[0x800000*bank], 0x800000, 1, fp); + fclose(fp); + } + } + } +#endif +} + + + + ROM_START( pdc100 ) ROM_REGION( 0x4000000, "maincpu", ROMREGION_ERASE00 ) // only 1st half of this is used "Jumper resistor (0 ohm) that short A25 to ground" @@ -200,13 +294,22 @@ ROM_START( pdc50 ) ROM_RELOAD(0x3000000,0x1000000) ROM_END - +ROM_START( pdc200 ) + ROM_REGION( 0x8000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "pdc200.bin", 0x000000, 0x8000000, CRC(9da99f0f) SHA1(0dda8a3deb794e493685d3d41790ee371f9b736e) ) +ROM_END ROM_START( pdc40t ) ROM_REGION( 0x4000000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "pdc_5060.bin", 0x000000, 0x4000000, CRC(28e0c16e) SHA1(fef4af00c737fab2716eef550badbbe0628f26a8) ) ROM_END +ROM_START( pdc150t ) + ROM_REGION( 0x8000000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "pdc5070.bin", 0x000000, 0x8000000, CRC(b10e9f29) SHA1(551d62a9ffc18159f7ace12e4363223e0c5cf3c8) ) +ROM_END + + ROM_START( tmntpdc ) ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "pdc_turtles.bin", 0x000000, 0x800000, CRC(ee9e70a3) SHA1(7620f1b7aeaec8032faa8eb7552f775e8d6d14ba) ) @@ -228,18 +331,23 @@ ROM_END // Other known units // PDC 30 // PDC 40 -// PDC 200 +// PDC 20 Sports +// + more // This was dumped from an Anncia branded unit, although there's no ingame branding, so ROM is probably the same for all PDC100 units -CONS( 2008, pdc100, 0, 0, pdc100, pdc100, spg2xx_pdc100_game_state, empty_init, "Conny / Anncia", "PDC100 - Pocket Dream Console (Anncia, US)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2008, pdc100, 0, 0, pdc100, pdc100, spg2xx_pdc_game_state, empty_init, "Conny / Anncia", "PDC100 - Pocket Dream Console (Anncia, US)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // interestingly this is newer than the PDC100 above, despite containing fewer games -CONS( 2010, pdc50, 0, 0, pdc100, pdc100, spg2xx_pdc100_game_state, empty_init , "Conny / VideoJet", "PDC50 - Pocket Dream Console (VideoJet, France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2010, pdc50, 0, 0, pdc100, pdc100, spg2xx_pdc_game_state, empty_init, "Conny / VideoJet", "PDC50 - Pocket Dream Console (VideoJet, France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + +CONS( 2012, pdc200, 0, 0, pdc100, pdc100, spg2xx_pdc200_game_state, init_pdc150t, "Conny / VideoJet", "PDC200 - Pocket Dream Console (VideoJet, France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + +CONS( 2011, pdc40t, 0, 0, pdc_tactile, pdc_tactile, spg2xx_pdc_game_state, init_pdc40t, "Conny / VideoJet", "PDC40 Tactile - Pocket Dream Console (VideoJet, France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // needs touch input -CONS( 2011, pdc40t, 0, 0, pdc_tactile, pdc_tactile, spg2xx_pdc100_game_state, init_pdc40t, "Conny / VideoJet", "PDC40 Tactile - Pocket Dream Console (VideoJet, France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // needs touch input +CONS( 2011, pdc150t, 0, 0, pdc_tactile, pdc_tactile, spg2xx_pdc150t_game_state, init_pdc150t, "Conny / VideoJet", "PDC150 Tactile - Pocket Dream Console (VideoJet, France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // needs touch input -CONS( 2013, tmntpdc, 0, 0, pdc100, pdc100, spg2xx_pdc100_game_state, empty_init, "Conny / VideoJet", "Teenage Mutant Ninja Turtles - Pocket Dream Console (VideoJet, France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2013, tmntpdc, 0, 0, pdc100, pdc100, spg2xx_pdc_game_state, empty_init, "Conny / VideoJet", "Teenage Mutant Ninja Turtles - Pocket Dream Console (VideoJet, France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2013, dorapdc, 0, 0, pdc100, pdc100, spg2xx_pdc100_game_state, empty_init, "Conny / VideoJet", "Dora l'exploratrice - Pocket Dream Console (VideoJet, France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2013, dorapdc, 0, 0, pdc100, pdc100, spg2xx_pdc_game_state, empty_init, "Conny / VideoJet", "Dora l'exploratrice - Pocket Dream Console (VideoJet, France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 200?, vjpp2, 0, 0, pdc100, vjpp2, spg2xx_pdc100_game_state, empty_init, "Conny / VideoJet", "Plug Play TV Games 2 (4-in-1) (VideoJet, France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 200?, vjpp2, 0, 0, pdc100, vjpp2, spg2xx_pdc_game_state, empty_init, "Conny / VideoJet", "Plug Play TV Games 2 (4-in-1) (VideoJet, France)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/spg2xx_wiwi.cpp b/src/mame/drivers/spg2xx_wiwi.cpp index 7d3836ec0a2..afcc1124f9f 100644 --- a/src/mame/drivers/spg2xx_wiwi.cpp +++ b/src/mame/drivers/spg2xx_wiwi.cpp @@ -30,13 +30,12 @@ public: spg2xx_game_marc101_state(const machine_config &mconfig, device_type type, const char *tag) : spg2xx_game_state(mconfig, type, tag), m_prev_porta(0), + m_prev_portb(0), m_toggle(false) { } void marc101(machine_config &config); - void init_m489(); - protected: void machine_start() override; void machine_reset() override; @@ -48,6 +47,7 @@ protected: virtual void portb_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0) override; uint16_t m_prev_porta; + uint16_t m_prev_portb; bool m_toggle; emu_timer *m_pulse_timer; @@ -55,6 +55,22 @@ private: }; +class spg2xx_game_guitrbus_state : public spg2xx_game_marc101_state +{ +public: + spg2xx_game_guitrbus_state(const machine_config &mconfig, device_type type, const char *tag) : + spg2xx_game_marc101_state(mconfig, type, tag) + { } + + void guitrbus(machine_config &config); + +protected: + + virtual uint16_t portb_r(); + virtual void porta_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0) override; + virtual void portb_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0) override; +}; + class spg2xx_game_marc250_state : public spg2xx_game_marc101_state { public: @@ -121,6 +137,7 @@ void spg2xx_game_marc101_state::machine_reset() spg2xx_game_state::machine_reset(); m_pulse_timer->adjust(attotime::never); m_prev_porta = 0; + m_prev_portb = 0; m_toggle = false; } @@ -157,6 +174,15 @@ void spg2xx_game_marc101_state::marc101(machine_config &config) m_maincpu->porta_out().set(FUNC(spg2xx_game_marc101_state::porta_w)); } +void spg2xx_game_guitrbus_state::guitrbus(machine_config &config) +{ + spg2xx(config); + + m_maincpu->portb_in().set(FUNC(spg2xx_game_guitrbus_state::portb_r)); + m_maincpu->porta_out().set(FUNC(spg2xx_game_guitrbus_state::porta_w)); + m_maincpu->portb_out().set(FUNC(spg2xx_game_guitrbus_state::portb_w)); +} + // are these Port A behaviors related to IO A Special mode on the SoC? // the bits being tested do seem to be 'ExtClk2 / ExtClk1' @@ -170,6 +196,72 @@ uint16_t spg2xx_game_marc101_state::porta_r() return ret; } +uint16_t spg2xx_game_guitrbus_state::portb_r() +{ + uint16_t ret = m_io_p2->read() &~ 0x0008; + + ret |= m_toggle ? 0x0000 : 0x0008; + + return ret; +} + +void spg2xx_game_guitrbus_state::porta_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + logerror("%s: porta_w %04x (%04x) %c %c %c %c | %c %c %c %c | %c %c %c %c | %c %c %c %c \n", machine().describe_context(), data, mem_mask, + (mem_mask & 0x8000) ? ((data & 0x8000) ? '1' : '0') : 'x', + (mem_mask & 0x4000) ? ((data & 0x4000) ? '1' : '0') : 'x', + (mem_mask & 0x2000) ? ((data & 0x2000) ? '1' : '0') : 'x', + (mem_mask & 0x1000) ? ((data & 0x1000) ? '1' : '0') : 'x', + (mem_mask & 0x0800) ? ((data & 0x0800) ? '1' : '0') : 'x', + (mem_mask & 0x0400) ? ((data & 0x0400) ? '1' : '0') : 'x', + (mem_mask & 0x0200) ? ((data & 0x0200) ? '1' : '0') : 'x', + (mem_mask & 0x0100) ? ((data & 0x0100) ? '1' : '0') : 'x', + (mem_mask & 0x0080) ? ((data & 0x0080) ? '1' : '0') : 'x', + (mem_mask & 0x0040) ? ((data & 0x0040) ? '1' : '0') : 'x', + (mem_mask & 0x0020) ? ((data & 0x0020) ? '1' : '0') : 'x', + (mem_mask & 0x0010) ? ((data & 0x0010) ? '1' : '0') : 'x', + (mem_mask & 0x0008) ? ((data & 0x0008) ? '1' : '0') : 'x', + (mem_mask & 0x0004) ? ((data & 0x0004) ? '1' : '0') : 'x', + (mem_mask & 0x0002) ? ((data & 0x0002) ? '1' : '0') : 'x', + (mem_mask & 0x0001) ? ((data & 0x0001) ? '1' : '0') : 'x'); + + m_prev_porta = data; +} + +void spg2xx_game_guitrbus_state::portb_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + logerror("%s: portb_w %04x (%04x) %c %c %c %c | %c %c %c %c | %c %c %c %c | %c %c %c %c \n", machine().describe_context(), data, mem_mask, + (mem_mask & 0x8000) ? ((data & 0x8000) ? '1' : '0') : 'x', + (mem_mask & 0x4000) ? ((data & 0x4000) ? '1' : '0') : 'x', + (mem_mask & 0x2000) ? ((data & 0x2000) ? '1' : '0') : 'x', + (mem_mask & 0x1000) ? ((data & 0x1000) ? '1' : '0') : 'x', + (mem_mask & 0x0800) ? ((data & 0x0800) ? '1' : '0') : 'x', + (mem_mask & 0x0400) ? ((data & 0x0400) ? '1' : '0') : 'x', + (mem_mask & 0x0200) ? ((data & 0x0200) ? '1' : '0') : 'x', + (mem_mask & 0x0100) ? ((data & 0x0100) ? '1' : '0') : 'x', + (mem_mask & 0x0080) ? ((data & 0x0080) ? '1' : '0') : 'x', + (mem_mask & 0x0040) ? ((data & 0x0040) ? '1' : '0') : 'x', + (mem_mask & 0x0020) ? ((data & 0x0020) ? '1' : '0') : 'x', + (mem_mask & 0x0010) ? ((data & 0x0010) ? '1' : '0') : 'x', + (mem_mask & 0x0008) ? ((data & 0x0008) ? '1' : '0') : 'x', + (mem_mask & 0x0004) ? ((data & 0x0004) ? '1' : '0') : 'x', + (mem_mask & 0x0002) ? ((data & 0x0002) ? '1' : '0') : 'x', + (mem_mask & 0x0001) ? ((data & 0x0001) ? '1' : '0') : 'x'); + + if ((data & 0x0002) != (m_prev_portb & 0x0002)) + { + if ((data & 0x0002)) + { + logerror("ext timer reset\n"); + m_pulse_timer->adjust(attotime::from_hz(32), 0, attotime::from_hz(32)); + } + } + + m_prev_portb = data; +} + + + void spg2xx_game_marc101_state::porta_w(offs_t offset, uint16_t data, uint16_t mem_mask) { @@ -499,6 +591,28 @@ static INPUT_PORTS_START( m489 ) PORT_BIT( 0xfffc, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END +static INPUT_PORTS_START( guitrbus ) + PORT_START("P1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Red / Do") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Yellow / Re") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Purple / Mi") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Green / Fa") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Menu") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Start") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Blue / Sol") + + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Logo (either WinFun or no logo) + + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Whammy Bar") + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("Strum") + + PORT_START("P2") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P3") + PORT_BIT( 0xffff, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + void spg2xx_game_wiwi18_state::init_wiwi18() { @@ -542,9 +656,7 @@ void spg2xx_game_wiwi18_state::portb_w(offs_t offset, uint16_t data, uint16_t me } } -void spg2xx_game_marc101_state::init_m489() -{ -} + void spg2xx_game_marc101_state::portb_w(offs_t offset, uint16_t data, uint16_t mem_mask) { @@ -750,7 +862,6 @@ void spg2xx_game_marc250_state::portb_w(offs_t offset, uint16_t data, uint16_t m } } - ROM_START( foxsport ) ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "foxsports.bin", 0x000000, 0x1000000, CRC(a5092f49) SHA1(feb4d432486b17d6cd2aed8cefd3d084f77c1733) ) // only a tiny amount of data in the 2nd half, what's it used for (if anything) @@ -775,7 +886,12 @@ ROM_END ROM_START( marc250 ) ROM_REGION( 0x10000000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_WORD_SWAP( "m527.u6", 0x0000000, 0x10000000, CRC(4b856cab) SHA1(41c66bbdb0bb1442d7e11da18e9e6b20048445ba) ) -ROM_END +ROM_END + +ROM_START( guitrbus ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "winfunguitar.bin", 0x000000, 0x400000, CRC(17419a27) SHA1(19377fcd18b08d3ae8e20de0244b3aaef1b5a66a) ) +ROM_END // box marked 'Wireless game console' 'Drahtlose Spielekonsole' 87 Sports games included : 18 hyper sports games, 69 arcade games. // Unit marked 'Hamy System' 'WiWi' @@ -788,6 +904,11 @@ CONS( 200?, foxsport, 0, 0, rad_skat, wiwi18, spg2xx_game_wiwi18_state, // thtere is another 'Drahtlose Spielekonsole 48-in-1' with '11 hyper sports games' (including Running) which are clearly SunPlus and would fit here, with the 37 non-hyper sports games presumably again being a NES/Famiclone cart -CONS( 2014, marc101, 0, 0, marc101, m489, spg2xx_game_marc101_state, init_m489, "Millennium 2000 GmbH", "Millennium Arcade 101 (M489) (Game Station 2 101-in-1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2014, marc101, 0, 0, marc101, m489, spg2xx_game_marc101_state, empty_init, "Millennium 2000 GmbH", "Millennium Arcade 101 (M489) (Game Station 2 101-in-1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) CONS( 2015, marc250, 0, 0, marc101, m489, spg2xx_game_marc250_state, init_m527, "Millennium 2000 GmbH", "Millennium Arcade 250 (M527)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) + +// has the following strings at the start of the ROM +// "Copyright(C) 2009-2012 ShenZhen Multi-Content Software CO., LTD" +// "LisencedTo: MCS" +CONS( 2012, guitrbus, 0, 0, guitrbus, guitrbus, spg2xx_game_guitrbus_state, empty_init, "WinFun", "Guitar Buster", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/includes/spg2xx.h b/src/mame/includes/spg2xx.h index ba46e8f0e5b..43d9477952f 100644 --- a/src/mame/includes/spg2xx.h +++ b/src/mame/includes/spg2xx.h @@ -34,12 +34,14 @@ public: { } void spg2xx_base(machine_config &config); + void spg2xx(machine_config &config); + void spg2xx_pal(machine_config &config); + void rad_skat(machine_config &config); void rad_skatp(machine_config &config); void rad_sktv(machine_config &config); void rad_crik(machine_config &config); void non_spg_base(machine_config &config); - void spg2xx(machine_config &config); void comil(machine_config &config); void tvsprt10(machine_config &config); void guitarfv(machine_config &config); diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 666639d2d80..d5da00f4a7f 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -31760,6 +31760,7 @@ zdog otrail denv150 techni4 +duetpp ablmini senwld @@ -37542,6 +37543,7 @@ zone3d @source:spg29x_lexibook_jg7425.cpp lx_jg7425 +lx_aven @source:spg2xx.cpp rad_skat // @@ -37551,6 +37553,7 @@ rad_fb2 // mattelcs // comil // abltenni // +totspies fordrace tvsprt10 // decathln @@ -37634,7 +37637,9 @@ mgt20in1 @source:spg2xx_pdc.cpp pdc100 pdc50 +pdc200 pdc40t +pdc150t tmntpdc dorapdc vjpp2 @@ -37681,6 +37686,7 @@ foxsport lexifit marc101 marc250 +guitrbus @source:spg2xx_zone.cpp wirels60 // Wireless 60 -- cgit v1.2.3 From a633e603cd1bc18131e25a0b65b693a3efcce480 Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 5 Jul 2020 18:21:26 +0200 Subject: taitogn: sianniv doesn't have zsg2 sound --- src/devices/cpu/m6809/m6809.cpp | 2 +- src/mame/drivers/simpsons.cpp | 2 +- src/mame/drivers/taitogn.cpp | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/devices/cpu/m6809/m6809.cpp b/src/devices/cpu/m6809/m6809.cpp index e2a83a17e00..39ba49cda10 100644 --- a/src/devices/cpu/m6809/m6809.cpp +++ b/src/devices/cpu/m6809/m6809.cpp @@ -616,7 +616,7 @@ mc6809_device::mc6809_device(const machine_config &mconfig, const char *tag, dev //------------------------------------------------- mc6809e_device::mc6809e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : m6809_base_device(mconfig, tag, owner, clock, MC6809E, 1) + : m6809_base_device(mconfig, tag, owner, clock, MC6809E, 1) { } diff --git a/src/mame/drivers/simpsons.cpp b/src/mame/drivers/simpsons.cpp index 1af75d6c70f..c95545fb141 100644 --- a/src/mame/drivers/simpsons.cpp +++ b/src/mame/drivers/simpsons.cpp @@ -569,7 +569,7 @@ ROM_START( simpsons2pa ) /* Asia 2 Player */ ROM_REGION( 0x80000, "maincpu", 0 ) /* code + banked roms */ ROM_LOAD( "072-g02.16c", 0x00000, 0x20000, CRC(580ce1d6) SHA1(5b07fb8e8041e1663980aa35d853fdc13b22dac5) ) /* Same as both world 2p sets */ ROM_LOAD( "072-p01.17c", 0x20000, 0x20000, CRC(07ceeaea) SHA1(c18255ae1d578c2d53de80d6323cdf41cbe47b57) ) /* Same as both world 2p sets */ - ROM_LOAD( "072-113.13c", 0x40000, 0x20000, CRC(8781105a) SHA1(ef2f16f7a56d3715536511c674df4b3aab1be2bd) ) /* Same as world set simpsn2p */ + ROM_LOAD( "072-113.13c", 0x40000, 0x20000, CRC(8781105a) SHA1(ef2f16f7a56d3715536511c674df4b3aab1be2bd) ) /* Same as world set simpsons2p */ ROM_LOAD( "072-112.15c", 0x60000, 0x20000, CRC(3bd69404) SHA1(e055fed7e9bde8315ae2f9b2d35bc05fece6b80b) ) ROM_REGION( 0x28000, "audiocpu", 0 ) /* Z80 code + banks */ diff --git a/src/mame/drivers/taitogn.cpp b/src/mame/drivers/taitogn.cpp index 8f39e83094f..0e60a2a9ae5 100644 --- a/src/mame/drivers/taitogn.cpp +++ b/src/mame/drivers/taitogn.cpp @@ -357,7 +357,7 @@ public: { } - void init_coh3002t_nz(); + void init_nozoom(); void base_config(machine_config &config); void coh3002t_t2_mp(machine_config &config); @@ -569,7 +569,7 @@ void taitogn_state::machine_reset() m_flashbank->set_bank(m_jp1->read() << 1); } -void taitogn_state::init_coh3002t_nz() +void taitogn_state::init_nozoom() { m_has_zoom = false; } @@ -1095,18 +1095,18 @@ GAME( 1999, rcdego, gobyrc, coh3002t_t1, gobyrc, taitogn_state, em GAME( 1999, flipmaze, coh3002t, coh3002t_t1, coh3002t, taitogn_state, empty_init, ROT0, "MOSS / Taito", "Flip Maze (V2.04J 1999/09/02 20:00)", MACHINE_IMPERFECT_SOUND ) GAME( 2001, shikigam, coh3002t, coh3002t_t1, coh3002t, taitogn_state, empty_init, ROT270, "Alfa System / Taito", "Shikigami no Shiro (V2.03J 2001/08/07 18:11)", MACHINE_IMPERFECT_SOUND ) GAME( 2001, shikigama, coh3002t, coh3002t_t1, coh3002t, taitogn_state, empty_init, ROT270, "Alfa System / Taito", "Shikigami no Shiro - internal build (V1.02J 2001/09/27 18:45)", MACHINE_IMPERFECT_SOUND ) -GAME( 2003, sianniv, coh3002t, coh3002t_t1, coh3002t, taitogn_state, empty_init, ROT270, "Taito", "Space Invaders Anniversary (V2.02J)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // IRQ at the wrong time +GAME( 2003, sianniv, coh3002t, coh3002t_t1, coh3002t, taitogn_state, init_nozoom,ROT270, "Taito", "Space Invaders Anniversary (V2.02J)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // IRQ at the wrong time GAME( 2003, kollon, coh3002t, coh3002t_t1, coh3002t, taitogn_state, empty_init, ROT0, "Taito", "Kollon (V2.04JA 2003/11/01 12:00)", MACHINE_IMPERFECT_SOUND ) GAME( 2003, kollonc, kollon, coh3002t_cf, coh3002t_jp1, taitogn_state, empty_init, ROT0, "Taito", "Kollon (V2.04JC 2003/11/01 12:00)", MACHINE_IMPERFECT_SOUND ) /* Success */ -GAME( 1999, otenamih, coh3002t, coh3002t_t1, coh3002t, taitogn_state, init_coh3002t_nz, ROT0, "Success", "Otenami Haiken (V2.04J 1999/02/01 18:00:00)", 0 ) -GAME( 2000, psyvaria, coh3002t, coh3002t_t1, coh3002t, taitogn_state, empty_init, ROT270, "Success", "Psyvariar -Medium Unit- (V2.02O 2000/02/22 13:00)", MACHINE_IMPERFECT_SOUND ) -GAME( 2000, psyvarij, psyvaria, coh3002t_t1, coh3002t, taitogn_state, empty_init, ROT270, "Success", "Psyvariar -Medium Unit- (V2.04J 2000/02/15 11:00)", MACHINE_IMPERFECT_SOUND ) -GAME( 2000, psyvarrv, coh3002t, coh3002t_t1, coh3002t, taitogn_state, empty_init, ROT270, "Success", "Psyvariar -Revision- (V2.04J 2000/08/11 22:00)", MACHINE_IMPERFECT_SOUND ) -GAME( 2001, zokuoten, coh3002t, coh3002t_t1, coh3002t, taitogn_state, init_coh3002t_nz, ROT0, "Success", "Zoku Otenamihaiken (V2.03J 2001/02/16 16:00)", 0 ) // boots the soundcpu without any valid code, causing an infinite NMI loop (currently circumvented) -GAME( 2004, zooo, coh3002t, coh3002t_t1, coh3002t, taitogn_state, init_coh3002t_nz, ROT0, "Success", "Zooo (V2.01JA 2004/04/13 12:00)", 0 ) -GAME( 2005, otenamhf, coh3002t, coh3002t_cf, coh3002t_jp1, taitogn_state, init_coh3002t_nz, ROT0, "Success / Warashi", "Otenami Haiken Final (V2.07JC 2005/04/20 15:36)", 0 ) +GAME( 1999, otenamih, coh3002t, coh3002t_t1, coh3002t, taitogn_state, init_nozoom,ROT0, "Success", "Otenami Haiken (V2.04J 1999/02/01 18:00:00)", 0 ) +GAME( 2000, psyvaria, coh3002t, coh3002t_t1, coh3002t, taitogn_state, empty_init, ROT270, "Success", "Psyvariar -Medium Unit- (V2.02O 2000/02/22 13:00)", MACHINE_IMPERFECT_SOUND ) +GAME( 2000, psyvarij, psyvaria, coh3002t_t1, coh3002t, taitogn_state, empty_init, ROT270, "Success", "Psyvariar -Medium Unit- (V2.04J 2000/02/15 11:00)", MACHINE_IMPERFECT_SOUND ) +GAME( 2000, psyvarrv, coh3002t, coh3002t_t1, coh3002t, taitogn_state, empty_init, ROT270, "Success", "Psyvariar -Revision- (V2.04J 2000/08/11 22:00)", MACHINE_IMPERFECT_SOUND ) +GAME( 2001, zokuoten, coh3002t, coh3002t_t1, coh3002t, taitogn_state, init_nozoom,ROT0, "Success", "Zoku Otenamihaiken (V2.03J 2001/02/16 16:00)", 0 ) // boots the soundcpu without any valid code, causing an infinite NMI loop (currently circumvented) +GAME( 2004, zooo, coh3002t, coh3002t_t1, coh3002t, taitogn_state, init_nozoom,ROT0, "Success", "Zooo (V2.01JA 2004/04/13 12:00)", 0 ) +GAME( 2005, otenamhf, coh3002t, coh3002t_cf, coh3002t_jp1, taitogn_state, init_nozoom,ROT0, "Success / Warashi", "Otenami Haiken Final (V2.07JC 2005/04/20 15:36)", 0 ) /* Takumi */ GAME( 2001, nightrai, coh3002t, coh3002t_t1, coh3002t, taitogn_state, empty_init, ROT0, "Takumi", "Night Raid (V2.03J 2001/02/26 17:00)", MACHINE_IMPERFECT_SOUND ) -- cgit v1.2.3