diff options
-rw-r--r-- | src/mame/drivers/39in1.cpp | 38 | ||||
-rw-r--r-- | src/mame/drivers/galaxian.cpp | 263 | ||||
-rw-r--r-- | src/mame/drivers/rgum.cpp | 147 | ||||
-rw-r--r-- | src/mame/includes/galaxian.h | 48 | ||||
-rw-r--r-- | src/mame/mame.lst | 2 | ||||
-rw-r--r-- | src/mame/video/galaxian.cpp | 25 |
6 files changed, 338 insertions, 185 deletions
diff --git a/src/mame/drivers/39in1.cpp b/src/mame/drivers/39in1.cpp index 691526f5cf4..30b55fe05ac 100644 --- a/src/mame/drivers/39in1.cpp +++ b/src/mame/drivers/39in1.cpp @@ -23,7 +23,7 @@ * 'Hardware Check' with an error * - rodent should be correctly decrypted but expects something different from the CPLD (probably) - * - 19in1, 48in1, 48in1a, 48in1b, 60in1 have more conditional XORs, + * - 19in1, 48in1, 48in1a, 48in1b, 48in1c,60in1 have more conditional XORs, * encryption isn't completely beaten yet * * 39in1 notes: @@ -63,6 +63,7 @@ public: void init_39in1(); void init_48in1(); void init_48in1a(); + void init_48in1c(); void init_60in1(); void init_rodent(); @@ -341,6 +342,7 @@ void _39in1_state::init_4in1b() { driver_init(); decrypt(0x43, 0x80, 0x04, 0x40 void _39in1_state::init_19in1() { driver_init(); decrypt(0x00, 0x04, 0x01, 0x80, 0x40, 2, 1, 7, 4, 5, 0, 6, 3); further_decrypt(0x00, 0x01, 0x00, 0x10, 0x00, 0x00); m_mcu_ipt_pc = 0x00000; } // TODO: 0x4000, 0x8000, 0x10000, 0x20000, 0x40000 conditional XORs? void _39in1_state::init_48in1() { driver_init(); decrypt(0x00, 0x01, 0x40, 0x00, 0x20, 5, 3, 2, 1, 4, 6, 0, 7); further_decrypt(0x00, 0x01, 0x20, 0x10, 0x00, 0x00); m_mcu_ipt_pc = 0x00000; } // applies to both 48in1 and 48in1b, same main CPU ROM. TODO: see above void _39in1_state::init_48in1a() { init_48in1(); m_mcu_ipt_pc = 0x00000; } // same encryption as 48in1 +void _39in1_state::init_48in1c() { init_48in1(); m_mcu_ipt_pc = 0x00000; } // same encryption as 48in1 void _39in1_state::init_rodent() { init_4in1b(); /*m_mcu_ipt_pc = 0x?????;*/ } // same encryption as 4in1b, thus good, but doesn't boot because of different CPLD calls void _39in1_state::init_60in1() { driver_init(); decrypt(0x00, 0x40, 0x10, 0x80, 0x20, 5, 1, 4, 2, 0, 7, 6, 3); further_decrypt(0x00, 0x01, 0x00, 0x10, 0x00, 0x00); m_mcu_ipt_pc = 0x00000; } // TODO: see 19in1 @@ -416,6 +418,21 @@ ROM_START( 48in1a ) ROM_END +ROM_START( 48in1c ) + // main program, encrypted + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD( "48in1_hph_ver308.u2", 0x000000, 0x080000, CRC(5d42beb0) SHA1(f21d1923b588cca1a6cd48a8ea6f3b5b996ebc1a) ) + + // data ROM - contains a filesystem with ROMs, fonts, graphics, etc. in an unknown compressed format + ROM_REGION32_LE( 0x200000, "data", 0 ) + ROM_LOAD( "16mflash.bin", 0x000000, 0x200000, CRC(a089f0f8) SHA1(e975eadd9176a8b9e416229589dfe3158cba22cb) ) + + // EEPROM - contains security data + ROM_REGION16_BE( 0x200, "eeprom", 0 ) + ROM_LOAD16_WORD_SWAP( "48in1_93c66_eeprom.bin", 0x000, 0x200, NO_DUMP ) +ROM_END + + ROM_START( 60in1 ) // main program, encrypted ROM_REGION( 0x80000, "maincpu", 0 ) @@ -485,12 +502,13 @@ ROM_START( rodent ) ROM_LOAD( "93c66.u32", 0x000, 0x200, CRC(c311c7bc) SHA1(8328002b7f6a8b7a3ffca079b7960bc990211d7b) ) ROM_END -GAME(2004, 4in1a, 39in1, _39in1, 39in1, _39in1_state, init_4in1a, ROT90, "bootleg", "4 in 1 MAME bootleg (set 1, ver 3.00, PLZ-V014)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) -GAME(2004, 4in1b, 39in1, _39in1, 39in1, _39in1_state, init_4in1b, ROT90, "bootleg", "4 in 1 MAME bootleg (set 2, PLZ-V001)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) -GAME(2004, 19in1, 39in1, _39in1, 39in1, _39in1_state, init_19in1, ROT90, "bootleg", "19 in 1 MAME bootleg (BAR-V000)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) -GAME(2004, 39in1, 0, _39in1, 39in1, _39in1_state, init_39in1, ROT90, "bootleg", "39 in 1 MAME bootleg (GNO-V000)", MACHINE_IMPERFECT_SOUND) -GAME(2004, 48in1, 39in1, _39in1, 39in1, _39in1_state, init_48in1, ROT90, "bootleg", "48 in 1 MAME bootleg (set 1, ver 3.09, HPH-V000)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) -GAME(2004, 48in1b, 39in1, _39in1, 39in1, _39in1_state, init_48in1, ROT90, "bootleg", "48 in 1 MAME bootleg (set 2, ver 3.09, HPH-V000, alt flash)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) -GAME(2004, 48in1a, 39in1, _39in1, 39in1, _39in1_state, init_48in1a, ROT90, "bootleg", "48 in 1 MAME bootleg (set 3, ver 3.02, HPH-V000)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) -GAME(2004, 60in1, 39in1, _39in1, 39in1, _39in1_state, init_60in1, ROT90, "bootleg", "60 in 1 MAME bootleg (ver 3.00, ICD-V000)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) -GAME(2005, rodent, 0, _39in1, 39in1, _39in1_state, init_rodent, ROT0, "The Game Room", "Rodent Exterminator", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) +GAME(2004, 4in1a, 39in1, _39in1, 39in1, _39in1_state, init_4in1a, ROT90, "bootleg", "4 in 1 MAME bootleg (ver 3.00, PLZ-V014)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) +GAME(2004, 4in1b, 39in1, _39in1, 39in1, _39in1_state, init_4in1b, ROT90, "bootleg", "4 in 1 MAME bootleg (PLZ-V001)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) +GAME(2004, 19in1, 39in1, _39in1, 39in1, _39in1_state, init_19in1, ROT90, "bootleg", "19 in 1 MAME bootleg (BAR-V000)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) +GAME(2004, 39in1, 0, _39in1, 39in1, _39in1_state, init_39in1, ROT90, "bootleg", "39 in 1 MAME bootleg (GNO-V000)", MACHINE_IMPERFECT_SOUND) +GAME(2004, 48in1, 39in1, _39in1, 39in1, _39in1_state, init_48in1, ROT90, "bootleg", "48 in 1 MAME bootleg (ver 3.09, HPH-V000)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) +GAME(2004, 48in1b, 39in1, _39in1, 39in1, _39in1_state, init_48in1, ROT90, "bootleg", "48 in 1 MAME bootleg (ver 3.09, HPH-V000, alt flash)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) +GAME(2004, 48in1a, 39in1, _39in1, 39in1, _39in1_state, init_48in1a, ROT90, "bootleg", "48 in 1 MAME bootleg (ver 3.02, HPH-V000)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) +GAME(2004, 48in1c, 39in1, _39in1, 39in1, _39in1_state, init_48in1c, ROT90, "bootleg", "48 in 1 MAME bootleg (ver 3.08, HPH-V000)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) +GAME(2004, 60in1, 39in1, _39in1, 39in1, _39in1_state, init_60in1, ROT90, "bootleg", "60 in 1 MAME bootleg (ver 3.00, ICD-V000)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) +GAME(2005, rodent, 0, _39in1, 39in1, _39in1_state, init_rodent, ROT0, "The Game Room", "Rodent Exterminator", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND) diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp index 6747efeb852..cb0ef2cd7fc 100644 --- a/src/mame/drivers/galaxian.cpp +++ b/src/mame/drivers/galaxian.cpp @@ -685,6 +685,7 @@ TODO: - streakng/ghostmun: $4800-4bff - smooncrs : fix read/writes at/to unmapped memory (when player 2, "cocktail" mode) + fix the ?#! bug with "bullets" (when player 2, "cocktail" mode) - timefgtr : missing player bullets, sprite ROM extend(see later levels), sound is too slow, some sprites missing +- monsterz : galaxian_state::sprites_draw "the first three sprites match against y-1", it looks like y+1 for this game (probably also applies to sfx) - zigzag : full Dip Switches and Inputs - zigzag2 : full Dip Switches and Inputs - jumpbug : full Dip Switches and Inputs - missing possible discrete sounds @@ -1014,7 +1015,7 @@ uint8_t galaxian_state::explorer_sound_latch_r() * *************************************/ -void taiyo_sfx_state::machine_start() +void nihon_sfx_state::machine_start() { galaxian_state::machine_start(); @@ -1024,7 +1025,7 @@ void taiyo_sfx_state::machine_start() } -uint8_t taiyo_sfx_state::sample_io_r(offs_t offset) +uint8_t nihon_sfx_state::sample_io_r(offs_t offset) { // the decoding here is very simplistic, and you can address both simultaneously uint8_t result = 0xff; @@ -1033,7 +1034,7 @@ uint8_t taiyo_sfx_state::sample_io_r(offs_t offset) } -void taiyo_sfx_state::sample_io_w(offs_t offset, uint8_t data) +void nihon_sfx_state::sample_io_w(offs_t offset, uint8_t data) { // the decoding here is very simplistic, and you can address both simultaneously if (offset & 0x04) m_ppi8255[2]->write(offset & 3, data); @@ -1041,7 +1042,7 @@ void taiyo_sfx_state::sample_io_w(offs_t offset, uint8_t data) } -void taiyo_sfx_state::sample_control_w(uint8_t data) +void nihon_sfx_state::sample_control_w(uint8_t data) { uint8_t old = m_sample_control; m_sample_control = data; @@ -1059,56 +1060,27 @@ void taiyo_sfx_state::sample_control_w(uint8_t data) * *************************************/ -/* Preliminary protection notes (based on z80 disasm): - - The initial protection routine is on the maincpu at $c591-$c676. - It accesses the 8255, expects an irq, and reads $d800 256 times which is xored against data - starting at $0100 to confirm a checksum stored in $0011-$0019. Then it reads the (presumably)same - block to store it in RAM at $3800-$3fff. 9 blocks in total. - It is presumed that this data comes from another ROM, and scrambled/encrypted a bit. - The data(code) in the extra RAM is later jumped/called to in many parts of the game. -*/ - -uint8_t taiyo_sfx_state::monsterz_protection_r() +void monsterz_state::monsterz_ay8910_w(offs_t offset, uint8_t data) { - return m_protection_result; + if (offset & 0x04) m_dac2->write(data); + galaxian_state::konami_ay8910_w(offset, data); } - -void taiyo_sfx_state::monsterz_set_latch() +void monsterz_state::machine_start() { - // read from a rom (which one?? "a-3e.k3" from audiocpu ($2700-$2fff) looks very suspicious) - uint8_t *rom = memregion("audiocpu")->base(); - m_protection_result = rom[0x2000 | (m_protection_state & 0x1fff)]; // probably needs a bitswap<8> - - // and an irq on the main z80 afterwards - m_maincpu->set_input_line(0, HOLD_LINE ); -} + nihon_sfx_state::machine_start(); + m_monsterz_shift = 0x00; + m_monsterz_shift2 = 0x00; + m_monsterz_audio_portb = 0xff; + m_monsterz_sample_portc = 0xff; -void taiyo_sfx_state::monsterz_porta_1_w(uint8_t data) -{ - // d7 high: set latch + advance address high bits (and reset low bits?) - if (data & 0x80) - { - monsterz_set_latch(); - m_protection_state = (m_protection_state + 0x100) & 0xff00; - } -} - -void taiyo_sfx_state::monsterz_portb_1_w(uint8_t data) -{ - // d3 high: set latch + advance address low bits - if (data & 0x08) - { - monsterz_set_latch(); - m_protection_state = ((m_protection_state + 1) & 0x00ff) | (m_protection_state & 0xff00); - } + save_item(NAME(m_monsterz_shift)); + save_item(NAME(m_monsterz_shift2)); + save_item(NAME(m_monsterz_audio_portb)); + save_item(NAME(m_monsterz_sample_portc)); } -void taiyo_sfx_state::monsterz_portc_1_w(uint8_t data) -{ -} /************************************* * @@ -2372,44 +2344,45 @@ void galaxian_state::turpins_map(address_map &map) // this is the same as theend, except for separate RGB background controls and some extra ROM space at $7000 and $C000 -void taiyo_sfx_state::sfx_map(address_map &map) +void nihon_sfx_state::sfx_map(address_map &map) { map(0x0000, 0x3fff).rom(); map(0x4000, 0x47ff).ram(); - map(0x4800, 0x4bff).mirror(0x0400).ram().w(FUNC(taiyo_sfx_state::galaxian_videoram_w)).share("videoram"); - map(0x5000, 0x50ff).mirror(0x0700).ram().w(FUNC(taiyo_sfx_state::galaxian_objram_w)).share("spriteram"); - map(0x6800, 0x6800).mirror(0x07f8).w(FUNC(taiyo_sfx_state::scramble_background_red_w)); - map(0x6801, 0x6801).mirror(0x07f8).w(FUNC(taiyo_sfx_state::irq_enable_w)); - map(0x6802, 0x6802).mirror(0x07f8).w(FUNC(taiyo_sfx_state::coin_count_0_w)); - map(0x6803, 0x6803).mirror(0x07f8).w(FUNC(taiyo_sfx_state::scramble_background_blue_w)); - map(0x6804, 0x6804).mirror(0x07f8).w(FUNC(taiyo_sfx_state::galaxian_stars_enable_w)); - map(0x6805, 0x6805).mirror(0x07f8).w(FUNC(taiyo_sfx_state::scramble_background_green_w)); - map(0x6806, 0x6806).mirror(0x07f8).w(FUNC(taiyo_sfx_state::galaxian_flip_screen_x_w)); - map(0x6807, 0x6807).mirror(0x07f8).w(FUNC(taiyo_sfx_state::galaxian_flip_screen_y_w)); + map(0x4800, 0x4bff).mirror(0x0400).ram().w(FUNC(nihon_sfx_state::galaxian_videoram_w)).share("videoram"); + map(0x5000, 0x50ff).mirror(0x0700).ram().w(FUNC(nihon_sfx_state::galaxian_objram_w)).share("spriteram"); + map(0x6800, 0x6800).mirror(0x07f8).w(FUNC(nihon_sfx_state::scramble_background_red_w)); + map(0x6801, 0x6801).mirror(0x07f8).w(FUNC(nihon_sfx_state::irq_enable_w)); + map(0x6802, 0x6802).mirror(0x07f8).w(FUNC(nihon_sfx_state::coin_count_0_w)); + map(0x6803, 0x6803).mirror(0x07f8).w(FUNC(nihon_sfx_state::scramble_background_blue_w)); + map(0x6804, 0x6804).mirror(0x07f8).w(FUNC(nihon_sfx_state::galaxian_stars_enable_w)); + map(0x6805, 0x6805).mirror(0x07f8).w(FUNC(nihon_sfx_state::scramble_background_green_w)); + map(0x6806, 0x6806).mirror(0x07f8).w(FUNC(nihon_sfx_state::galaxian_flip_screen_x_w)); + map(0x6807, 0x6807).mirror(0x07f8).w(FUNC(nihon_sfx_state::galaxian_flip_screen_y_w)); map(0x7000, 0x7fff).rom(); - map(0x8000, 0xbfff).rw(FUNC(taiyo_sfx_state::theend_ppi8255_r), FUNC(taiyo_sfx_state::theend_ppi8255_w)); + map(0x8000, 0xbfff).rw(FUNC(nihon_sfx_state::theend_ppi8255_r), FUNC(nihon_sfx_state::theend_ppi8255_w)); map(0xc000, 0xefff).rom(); } -void taiyo_sfx_state::monsterz_map(address_map &map) +void monsterz_state::monsterz_map(address_map &map) { map(0x0000, 0x37ff).rom(); map(0x3800, 0x3fff).ram(); // extra RAM used by protection map(0x4000, 0x47ff).ram(); - map(0x4800, 0x4bff).mirror(0x0400).ram().w(FUNC(taiyo_sfx_state::galaxian_videoram_w)).share("videoram"); - map(0x5000, 0x50ff).mirror(0x0700).ram().w(FUNC(taiyo_sfx_state::galaxian_objram_w)).share("spriteram"); - map(0x6800, 0x6800).mirror(0x07f8).w(FUNC(taiyo_sfx_state::scramble_background_red_w)); - map(0x6801, 0x6801).mirror(0x07f8).w(FUNC(taiyo_sfx_state::irq_enable_w)); - map(0x6802, 0x6802).mirror(0x07f8).w(FUNC(taiyo_sfx_state::coin_count_0_w)); - map(0x6803, 0x6803).mirror(0x07f8).w(FUNC(taiyo_sfx_state::scramble_background_blue_w)); - map(0x6804, 0x6804).mirror(0x07f8).w(FUNC(taiyo_sfx_state::galaxian_stars_enable_w)); - map(0x6805, 0x6805).mirror(0x07f8).w(FUNC(taiyo_sfx_state::scramble_background_green_w)); - map(0x6806, 0x6806).mirror(0x07f8).w(FUNC(taiyo_sfx_state::galaxian_flip_screen_x_w)); - map(0x6807, 0x6807).mirror(0x07f8).w(FUNC(taiyo_sfx_state::galaxian_flip_screen_y_w)); - map(0x8000, 0xbfff).rw(FUNC(taiyo_sfx_state::theend_ppi8255_r), FUNC(taiyo_sfx_state::theend_ppi8255_w)); + map(0x4800, 0x4bff).mirror(0x0400).ram().w(FUNC(nihon_sfx_state::galaxian_videoram_w)).share("videoram"); + map(0x5000, 0x50ff).mirror(0x0700).ram().w(FUNC(nihon_sfx_state::galaxian_objram_w)).share("spriteram"); + map(0x6800, 0x6800).mirror(0x07f8).w(FUNC(nihon_sfx_state::scramble_background_red_w)); + map(0x6801, 0x6801).mirror(0x07f8).w(FUNC(nihon_sfx_state::irq_enable_w)); + map(0x6802, 0x6802).mirror(0x07f8).w(FUNC(nihon_sfx_state::coin_count_0_w)); + map(0x6803, 0x6803).mirror(0x07f8).w(FUNC(nihon_sfx_state::scramble_background_blue_w)); + map(0x6804, 0x6804).mirror(0x07f8).w(FUNC(nihon_sfx_state::galaxian_stars_enable_w)); + map(0x6805, 0x6805).mirror(0x07f8).w(FUNC(nihon_sfx_state::scramble_background_green_w)); + map(0x6806, 0x6806).mirror(0x07f8).w(FUNC(nihon_sfx_state::galaxian_flip_screen_x_w)); + map(0x6807, 0x6807).mirror(0x07f8).w(FUNC(nihon_sfx_state::galaxian_flip_screen_y_w)); + map(0x7000, 0x7000).nopr(); // watchdog? + map(0x8000, 0xbfff).rw(FUNC(nihon_sfx_state::theend_ppi8255_r), FUNC(nihon_sfx_state::theend_ppi8255_w)); map(0xc000, 0xd7ff).rom(); - map(0xd800, 0xd800).r(FUNC(taiyo_sfx_state::monsterz_protection_r)); + map(0xd800, 0xdfff).lr8(NAME([this]() { return bitswap<8>(m_monsterz_shift ^ 0x40050, 7, 18, 0, 1, 4, 6, 5, 3); })); } @@ -2719,12 +2692,26 @@ void galaxian_state::konami_sound_portmap(address_map &map) map(0x00, 0xff).rw(FUNC(galaxian_state::konami_ay8910_r), FUNC(galaxian_state::konami_ay8910_w)); } -void taiyo_sfx_state::monsterz_sound_map(address_map &map) +void monsterz_state::monsterz_sound_map(address_map &map) { konami_sound_map(map); - map(0x0000, 0x3fff).rom().region("audiocpu", 0); // sound board has space for extra ROM + map(0x0000, 0x4fff).rom().region("audiocpu", 0); // sound board has space for extra ROM + map(0xd000, 0xd000).lr8(NAME([this]() { return bitswap<8>(m_monsterz_shift2 ^ 0x188, 14, 5, 8, 3, 7, 4, 2, 1); })); + map(0xd000, 0xd000).lw8(NAME([this](uint8_t data) { m_monsterz_shift = (m_monsterz_shift << 8) | data; })); } +void monsterz_state::monsterz_sound_portmap(address_map& map) +{ + map.global_mask(0xff); + map(0x00, 0xff).rw(FUNC(galaxian_state::konami_ay8910_r), FUNC(monsterz_state::monsterz_ay8910_w)); +} + +void monsterz_state::monsterz_sample_map(address_map& map) +{ + sfx_sample_map(map); + map(0x4000, 0x5fff).unmaprw(); + map(0x4000, 0x4000).lw8(NAME([this](uint8_t data) { m_monsterz_shift2 = (m_monsterz_shift2 << 8) | data; })); +} // Checkman with 1 x AY-8910A @@ -2820,16 +2807,16 @@ void kingball_state::kingball_sound_portmap(address_map &map) // SF-X sample player -void taiyo_sfx_state::sfx_sample_map(address_map &map) +void nihon_sfx_state::sfx_sample_map(address_map &map) { map(0x0000, 0x5fff).rom(); map(0x8000, 0x83ff).mirror(0x6c00).ram(); } -void taiyo_sfx_state::sfx_sample_portmap(address_map &map) +void nihon_sfx_state::sfx_sample_portmap(address_map &map) { map.global_mask(0xff); - map(0x00, 0xff).rw(FUNC(taiyo_sfx_state::sample_io_r), FUNC(taiyo_sfx_state::sample_io_w)); + map(0x00, 0xff).rw(FUNC(nihon_sfx_state::sample_io_r), FUNC(nihon_sfx_state::sample_io_w)); } void galaxian_state::turpins_sound_map(address_map &map) @@ -6267,6 +6254,18 @@ static INPUT_PORTS_START( sfx ) PORT_BIT( 0xff, 0x00, IPT_UNUSED ) INPUT_PORTS_END +static INPUT_PORTS_START( monsterz ) + PORT_INCLUDE(sfx) + + PORT_MODIFY("IN0") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + + PORT_MODIFY("IN1") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) +INPUT_PORTS_END + /* verified from Z80 code */ static INPUT_PORTS_START( scobra ) @@ -7859,19 +7858,19 @@ void galaxian_state::ckongs(machine_config &config) } -void taiyo_sfx_state::sfx(machine_config &config) +void nihon_sfx_state::sfx(machine_config &config) { scramble_base(config); config.device_remove("watchdog"); // alternate memory map - m_maincpu->set_addrmap(AS_PROGRAM, &taiyo_sfx_state::sfx_map); + m_maincpu->set_addrmap(AS_PROGRAM, &nihon_sfx_state::sfx_map); /* 3rd CPU for the sample player */ Z80(config, m_audio2, KONAMI_SOUND_CLOCK/8); - m_audio2->set_addrmap(AS_PROGRAM, &taiyo_sfx_state::sfx_sample_map); - m_audio2->set_addrmap(AS_IO, &taiyo_sfx_state::sfx_sample_portmap); + m_audio2->set_addrmap(AS_PROGRAM, &nihon_sfx_state::sfx_sample_map); + m_audio2->set_addrmap(AS_IO, &nihon_sfx_state::sfx_sample_portmap); I8255A(config, m_ppi8255[2]); m_ppi8255[2]->in_pa_callback().set("soundlatch2", FUNC(generic_latch_8_device::read)); @@ -7880,26 +7879,48 @@ void taiyo_sfx_state::sfx(machine_config &config) /* port on 2nd 8910 is used for communication */ m_ay8910[1]->port_a_write_callback().set("soundlatch2", FUNC(generic_latch_8_device::write)); - m_ay8910[1]->port_b_write_callback().set(FUNC(taiyo_sfx_state::sample_control_w)); + m_ay8910[1]->port_b_write_callback().set(FUNC(nihon_sfx_state::sample_control_w)); + + // cut screen edges + m_screen->set_raw(GALAXIAN_PIXEL_CLOCK, GALAXIAN_HTOTAL, GALAXIAN_HBEND + 3 * 8 * GALAXIAN_XSCALE, GALAXIAN_HBSTART - 2 * 8 * GALAXIAN_XSCALE, GALAXIAN_VTOTAL, GALAXIAN_VBEND, GALAXIAN_VBSTART); /* DAC for the sample player */ DAC_8BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 1.0); // 16-pin IC (not identified by schematics) } -void taiyo_sfx_state::monsterz(machine_config &config) +void monsterz_state::monsterz(machine_config &config) { sfx(config); // alternate memory map - m_maincpu->set_addrmap(AS_PROGRAM, &taiyo_sfx_state::monsterz_map); - m_audiocpu->set_addrmap(AS_PROGRAM, &taiyo_sfx_state::monsterz_sound_map); + m_maincpu->set_addrmap(AS_PROGRAM, &monsterz_state::monsterz_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &monsterz_state::monsterz_sound_map); + m_audiocpu->set_addrmap(AS_IO, &monsterz_state::monsterz_sound_portmap); + m_audio2->set_addrmap(AS_PROGRAM, &monsterz_state::monsterz_sample_map); - m_ppi8255[1]->out_pa_callback().set(FUNC(taiyo_sfx_state::monsterz_porta_1_w)); - m_ppi8255[1]->out_pb_callback().set(FUNC(taiyo_sfx_state::monsterz_portb_1_w)); - m_ppi8255[1]->out_pc_callback().set(FUNC(taiyo_sfx_state::monsterz_portc_1_w)); + m_ay8910[0]->port_b_write_callback().set([this](uint8_t data) + { + if ((m_monsterz_audio_portb & 0x01) && !(data & 0x01)) + { + machine().scheduler().boost_interleave(m_screen->scan_period(), attotime(0, m_screen->refresh_attoseconds())); + m_maincpu->set_input_line(0, HOLD_LINE); + } + m_monsterz_audio_portb = data; + }); - // there are likely other differences too, but those can wait until after protection is sorted out + m_ppi8255[2]->out_pc_callback().set([this](uint8_t data) + { + if ((m_monsterz_sample_portc & 0x01) && !(data & 0x01)) + { + machine().scheduler().boost_interleave(m_screen->scan_period(), attotime(0, m_screen->refresh_attoseconds())); + m_audiocpu->set_input_line(0, HOLD_LINE); + } + m_monsterz_sample_portc = data; + }); + + /* DAC for the sample player */ + DAC_8BIT_R2R(config, m_dac2, 0).add_route(ALL_OUTPUTS, "speaker", 1.0); // TODO: check dac type } @@ -8856,14 +8877,21 @@ void galaxian_state::init_mandinga() space.unmap_read(0x7000, 0x7000, 0x7ff); } -void taiyo_sfx_state::init_sfx() +void nihon_sfx_state::init_sfx() { // basic configuration - common_init(&galaxian_state::scramble_draw_bullet, nullptr, &galaxian_state::upper_extend_tile_info, nullptr); - m_draw_background_ptr = draw_background_delegate(&taiyo_sfx_state::sfx_draw_background, this); + common_init(nullptr, nullptr, &galaxian_state::upper_extend_tile_info, nullptr); + m_draw_background_ptr = draw_background_delegate(&nihon_sfx_state::sfx_draw_background, this); + m_draw_bullet_ptr = draw_bullet_delegate(&nihon_sfx_state::sfx_draw_bullet, this); m_sfx_tilemap = true; } +void monsterz_state::init_monsterz() +{ + init_sfx(); + m_draw_background_ptr = draw_background_delegate(&galaxian_state::galaxian_draw_background, this); +} + void galaxian_state::init_atlantis() { @@ -14317,19 +14345,18 @@ ROM_START( monsterz ) ROM_LOAD( "b-6e.h1", 0xd000, 0x1000, CRC(77d7aa8d) SHA1(62aaf582ba55f7b21f6cf13b4fb6c2c54bb729f5) ) ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "a-5e.k5", 0x0000, 0x1000, CRC(b5bcdb4e) SHA1(db0965e5636e0f4e9cd4f4a7d808c413ecf733db) ) + ROM_LOAD( "a-6.k6", 0x1000, 0x1000, CRC(24832b2e) SHA1(2a67888e86ce1a3182303e841513ba2a07977359) ) + ROM_LOAD( "a-7e.k7", 0x2000, 0x1000, CRC(20ebea81) SHA1(473c688365b256d8593663ff95768f4a5bb1289d) ) + ROM_LOAD( "a-8.k8", 0x3000, 0x1000, CRC(b833a15b) SHA1(0d21aaa0ca5ccba89118b205a6b3b36b15663c47) ) + ROM_LOAD( "a-9.k9", 0x4000, 0x1000, CRC(cbd76ec2) SHA1(9434350ee93ca71efe78018b69913386353306ff) ) + + ROM_REGION( 0x10000, "audio2", 0 ) ROM_LOAD( "a-1e.k1", 0x0000, 0x1000, CRC(b88ba44e) SHA1(85c141fb411d541b1e20412f5fefd18395f635ae) ) ROM_LOAD( "a-2.k2", 0x1000, 0x1000, CRC(8913c94e) SHA1(6c4fe065217a234d45761f8ad4d2c4e7078a0abd) ) ROM_LOAD( "a-3e.k3", 0x2000, 0x1000, CRC(a8fa5095) SHA1(5cabe5497a79a0c43e78a84ae87c824af60a2a3f) ) ROM_LOAD( "a-4.k4", 0x3000, 0x1000, CRC(93f81317) SHA1(167708be94cb9a47290067a20bc5ff6f018b93b6) ) - ROM_REGION( 0x10000, "audio2", 0 ) - ROM_LOAD( "a-5e.k5", 0x0000, 0x1000, CRC(b5bcdb4e) SHA1(db0965e5636e0f4e9cd4f4a7d808c413ecf733db) ) - ROM_LOAD( "a-6.k6", 0x1000, 0x1000, CRC(24832b2e) SHA1(2a67888e86ce1a3182303e841513ba2a07977359) ) - ROM_LOAD( "a-7e.k7", 0x2000, 0x1000, CRC(20ebea81) SHA1(473c688365b256d8593663ff95768f4a5bb1289d) ) - // 0x3000 empty ? - ROM_LOAD( "a-8.k8", 0x4000, 0x1000, CRC(b833a15b) SHA1(0d21aaa0ca5ccba89118b205a6b3b36b15663c47) ) - ROM_LOAD( "a-9.k9", 0x5000, 0x1000, CRC(cbd76ec2) SHA1(9434350ee93ca71efe78018b69913386353306ff) ) - ROM_REGION( 0x2000, "gfx1", 0 ) ROM_LOAD( "b-7e.a5", 0x0000, 0x1000, CRC(ddd4158d) SHA1(9701e2d8a0226455dfbed650e58bb4be05918fe8) ) ROM_LOAD( "b-8e.c5", 0x1000, 0x1000, CRC(b1331b4c) SHA1(fa1af406ecd6919b4846aea68d3edb70106f9273) ) @@ -14339,6 +14366,37 @@ ROM_START( monsterz ) ROM_END +ROM_START( monsterza ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "b-1.a1", 0x0000, 0x1000, CRC(97886542) SHA1(01f4f9bd55f9eae28162cbb22a26f7cda22cd3f3) ) + ROM_LOAD( "b-2.b1", 0x1000, 0x1000, CRC(184ffcb4) SHA1(829d6ca13773aba7c3a81e122171befbe3666110) ) + ROM_LOAD( "b-3.c1", 0x2000, 0x1000, CRC(b7b10ac7) SHA1(51d544d4db456df756a95d7f1853fffed9259647) ) + ROM_LOAD( "b-4.e1", 0x3000, 0x1000, CRC(fb02c736) SHA1(24466116dd07b856b1afff62b8312c67ff466b95) ) + ROM_LOAD( "b-5.f1", 0xc000, 0x1000, CRC(43be6f5b) SHA1(18fe89839187de7aa76597d391677b45521d679d) ) + ROM_LOAD( "b-6.k1", 0xd000, 0x1000, CRC(a21ae2f6) SHA1(71695265de1fcb635d4260ccb129b652f003a7d2) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "a-5.kj5", 0x0000, 0x1000, CRC(b5bcdb4e) SHA1(db0965e5636e0f4e9cd4f4a7d808c413ecf733db) ) + ROM_LOAD( "a-6.kj6", 0x1000, 0x1000, CRC(24832b2e) SHA1(2a67888e86ce1a3182303e841513ba2a07977359) ) + ROM_LOAD( "a-7.kj7", 0x2000, 0x1000, CRC(20ebea81) SHA1(473c688365b256d8593663ff95768f4a5bb1289d) ) + ROM_LOAD( "a-8.kj8", 0x3000, 0x1000, CRC(b833a15b) SHA1(0d21aaa0ca5ccba89118b205a6b3b36b15663c47) ) + ROM_LOAD( "a-9.kj9", 0x4000, 0x1000, CRC(cbd76ec2) SHA1(9434350ee93ca71efe78018b69913386353306ff) ) + + ROM_REGION( 0x10000, "audio2", 0 ) + ROM_LOAD( "a-1.kj1", 0x0000, 0x1000, CRC(b88ba44e) SHA1(85c141fb411d541b1e20412f5fefd18395f635ae) ) + ROM_LOAD( "a-2.kj2", 0x1000, 0x1000, CRC(8913c94e) SHA1(6c4fe065217a234d45761f8ad4d2c4e7078a0abd) ) + ROM_LOAD( "a-3.kj3", 0x2000, 0x1000, CRC(a8fa5095) SHA1(5cabe5497a79a0c43e78a84ae87c824af60a2a3f) ) + ROM_LOAD( "a-4.kj4", 0x3000, 0x1000, CRC(93f81317) SHA1(167708be94cb9a47290067a20bc5ff6f018b93b6) ) + + ROM_REGION( 0x2000, "gfx1", 0 ) + ROM_LOAD( "b-7.a5", 0x0000, 0x1000, CRC(ddd4158d) SHA1(9701e2d8a0226455dfbed650e58bb4be05918fe8) ) + ROM_LOAD( "b-8.b5", 0x1000, 0x1000, CRC(b1331b4c) SHA1(fa1af406ecd6919b4846aea68d3edb70106f9273) ) + + ROM_REGION( 0x0020, "proms", 0 ) + ROM_LOAD( "prom.g9", 0x0000, 0x0020, CRC(b7ea00d7) SHA1(f658c6ac8123ae1e6b68ae513cc02c4d9d2b4e47) ) +ROM_END + + ROM_START( scobra ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "epr1265.2c", 0x0000, 0x1000, CRC(a0744b3f) SHA1(8949298a04f8ba8a82d5d84a7b012a0e7cff11df) ) @@ -15469,9 +15527,10 @@ GAME( 19??, scorpionmc, scorpion, scorpnmc, scorpnmc, galaxian_state, i GAME( 19??, aracnis, scorpion, scorpnmc, aracnis, galaxian_state, init_batman2, ROT90, "bootleg", "Aracnis (bootleg of Scorpion on Moon Cresta hardware)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) // SF-X hardware; based on Scramble with extra Z80 and 8255 driving a DAC-based sample player -GAME( 1983, sfx, 0, sfx, sfx, taiyo_sfx_state, init_sfx, ORIENTATION_FLIP_X, "Taiyo System (Nichibutsu license)", "SF-X", MACHINE_SUPPORTS_SAVE ) -GAME( 1983, skelagon, sfx, sfx, sfx, taiyo_sfx_state, init_sfx, ORIENTATION_FLIP_X, "Taiyo System (Nichibutsu USA license)", "Skelagon", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE) -GAME( 1982, monsterz, 0, monsterz, sfx, taiyo_sfx_state, init_sfx, ORIENTATION_FLIP_X, "Taiyo System", "Monster Zero", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) +GAME( 1983, sfx, 0, sfx, sfx, nihon_sfx_state, init_sfx, ORIENTATION_FLIP_X, "Nihon Game (Nichibutsu license)", "SF-X", MACHINE_SUPPORTS_SAVE ) +GAME( 1983, skelagon, sfx, sfx, sfx, nihon_sfx_state, init_sfx, ORIENTATION_FLIP_X, "Nihon Game (Nichibutsu USA license)", "Skelagon", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE) +GAME( 1982, monsterz, 0, monsterz, monsterz, monsterz_state, init_monsterz, ORIENTATION_FLIP_X, "Nihon Game", "Monster Zero (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, monsterza, monsterz, monsterz, monsterz, monsterz_state, init_monsterz, ORIENTATION_FLIP_X, "Nihon Game", "Monster Zero (set 2)", MACHINE_SUPPORTS_SAVE ) /* diff --git a/src/mame/drivers/rgum.cpp b/src/mame/drivers/rgum.cpp index 7a1adea5261..af66510e4f9 100644 --- a/src/mame/drivers/rgum.cpp +++ b/src/mame/drivers/rgum.cpp @@ -43,6 +43,8 @@ public: m_vram(*this, "vram"), m_cram(*this, "cram"), m_maincpu(*this, "maincpu"), + m_aysnd(*this, "aysnd"), + m_upd(*this, "upd"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } @@ -52,14 +54,26 @@ public: protected: virtual void video_start() override; + virtual void machine_reset() override; private: required_shared_ptr<uint8_t> m_vram; required_shared_ptr<uint8_t> m_cram; required_device<cpu_device> m_maincpu; + required_device<ay8910_device> m_aysnd; + required_device<upd7759_device> m_upd; required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; uint8_t m_hbeat; + bool m_aysnd_data_next; + bool m_aysnd_toggle_enabled; + + void aysnd_2000_w(uint8_t data); + void aysnd_2002_w(uint8_t data); + void upd_data_w(uint8_t data); + uint8_t upd_ready_r(); + uint8_t upd_busy_r(); + uint8_t upd_reset_r(); uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void main_map(address_map &map); @@ -71,6 +85,14 @@ void rgum_state::video_start() m_hbeat = 0; save_item(NAME(m_hbeat)); + save_item(NAME(m_aysnd_data_next)); + save_item(NAME(m_aysnd_toggle_enabled)); +} + +void rgum_state::machine_reset() +{ + m_aysnd_data_next = false; + m_aysnd_toggle_enabled = false; } uint32_t rgum_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) @@ -94,6 +116,51 @@ uint32_t rgum_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, return 0; } +void rgum_state::aysnd_2000_w(uint8_t data) +{ + m_aysnd_toggle_enabled = true; +} + +void rgum_state::aysnd_2002_w(uint8_t data) +{ + // AY-3-8910 interface is bizarre. Address is written to $2000 and then $2002 with successive instructions, then data is written to both $2000 and $2002. + // Sound data contains many pairs where the address byte is $50. Do these control some other device? + m_aysnd->address_data_w(m_aysnd_data_next, data); + if (m_aysnd_toggle_enabled) + { + m_aysnd_data_next = !m_aysnd_data_next; + m_aysnd_toggle_enabled = false; + } +} + +void rgum_state::upd_data_w(u8 data) +{ + m_upd->port_w(data); + m_upd->start_w(1); +} + +uint8_t rgum_state::upd_ready_r() +{ + if (!machine().side_effects_disabled()) + { + m_upd->reset_w(1); + m_upd->start_w(0); + } + return 0; +} + +uint8_t rgum_state::upd_busy_r() +{ + return m_upd->busy_r() ? 0x80 : 0; +} + +uint8_t rgum_state::upd_reset_r() +{ + if (!machine().side_effects_disabled()) + m_upd->reset_w(0); + return 0; +} + void rgum_state::main_map(address_map &map) // TODO: map MK48Z08B-10, second 8255, UPD7759 { map(0x0000, 0x07ff).ram(); // not all of it? @@ -101,14 +168,15 @@ void rgum_state::main_map(address_map &map) // TODO: map MK48Z08B-10, second 825 map(0x0800, 0x0800).w("crtc", FUNC(mc6845_device::address_w)); map(0x0801, 0x0801).rw("crtc", FUNC(mc6845_device::register_r), FUNC(mc6845_device::register_w)); - map(0x2000, 0x2000).w("aysnd", FUNC(ay8910_device::data_w)); - map(0x2002, 0x2002).rw("aysnd", FUNC(ay8910_device::data_r), FUNC(ay8910_device::address_w)); + map(0x2000, 0x2000).w(FUNC(rgum_state::aysnd_2000_w)); + map(0x2002, 0x2002).r("aysnd", FUNC(ay8910_device::data_r)).w(FUNC(rgum_state::aysnd_2002_w)); - map(0x2801, 0x2801).nopr(); // read but value discarded? - map(0x2802, 0x2802).nopr(); - map(0x2803, 0x2803).nopr(); + map(0x2800, 0x2800).w(FUNC(rgum_state::upd_data_w)); + map(0x2801, 0x2801).r(FUNC(rgum_state::upd_ready_r)); + map(0x2802, 0x2802).r(FUNC(rgum_state::upd_busy_r)); + map(0x2803, 0x2803).r(FUNC(rgum_state::upd_reset_r)); - // map(0x2c00, 0x2c03).w(); // ? + map(0x2c00, 0x2c03).w("ppi8255_1", FUNC(i8255_device::write)); map(0x3000, 0x3003).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); @@ -121,47 +189,25 @@ void rgum_state::main_map(address_map &map) // TODO: map MK48Z08B-10, second 825 READ_LINE_MEMBER(rgum_state::heartbeat_r) { - m_hbeat ^= 1; - return m_hbeat; } static INPUT_PORTS_START( rgum ) PORT_START("IN0") - PORT_DIPNAME( 0x01, 0x01, "IN0" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // "PIN'S SW." PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(rgum_state, heartbeat_r) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Stop Reel 5") PORT_CODE(KEYCODE_N) PORT_START("IN1") - PORT_DIPNAME( 0x01, 0x01, "IN1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // "GUM SW." + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // "PAY LOT" PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -178,16 +224,10 @@ static INPUT_PORTS_START( rgum ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_START("IN2") - PORT_DIPNAME( 0x01, 0x01, "IN2" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_START("COIN") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) // "COIN SERV" + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -200,9 +240,7 @@ static INPUT_PORTS_START( rgum ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) // TODO: should be 1 8-dip bank and 1 4-dip bank @@ -289,6 +327,7 @@ void rgum_state::rgum(machine_config &config) ppi.in_pa_callback().set_ioport("IN0"); ppi.in_pb_callback().set_ioport("DSW1"); ppi.in_pc_callback().set_ioport("DSW2"); + ppi.out_pc_callback().set([this](uint8_t data) { m_hbeat = BIT(data, 0); }); I8255A(config, "ppi8255_1"); @@ -313,8 +352,8 @@ void rgum_state::rgum(machine_config &config) ay8910_device &aysnd(AY8910(config, "aysnd", 24_MHz_XTAL / 16)); aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); // guessed to use the same xtal as the crtc - aysnd.port_a_read_callback().set([this](){ return machine().rand() & 0x01; }); // TODO: hack! Otherwise it flashes 'RAM ERROR 0', then black screen - aysnd.port_b_read_callback().set_constant(0x00); // 'micro palline err.' (microballs err.) if bit 0 is set + aysnd.port_a_read_callback().set_ioport("COIN"); + aysnd.port_b_read_callback().set_ioport("IN1"); UPD7759(config, "upd").add_route(ALL_OUTPUTS, "mono", 0.50); } @@ -350,4 +389,4 @@ ROM_END } // Anonymous namespace -GAME( 199?, rgum, 0, rgum, rgum, rgum_state, empty_init, ROT0, "<unknown>", "Royal Gum (Italy)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +GAME( 1993, rgum, 0, rgum, rgum, rgum_state, empty_init, ROT0, "<unknown>", "Royal Gum (Italy)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h index 081921da51c..f78bf776ae4 100644 --- a/src/mame/includes/galaxian.h +++ b/src/mame/includes/galaxian.h @@ -210,6 +210,7 @@ public: void stars_update_origin(); void stars_draw_row(bitmap_rgb32 &bitmap, int maxx, int y, uint32_t star_offs, uint8_t starmask); void null_draw_background(bitmap_rgb32 &bitmap, const rectangle &cliprect); + void galaxian_draw_stars(bitmap_rgb32 &bitmap, const rectangle &cliprect, int maxx); void galaxian_draw_background(bitmap_rgb32 &bitmap, const rectangle &cliprect); void background_draw_colorsplit(bitmap_rgb32 &bitmap, const rectangle &cliprect, rgb_t color, int split, int split_flipped); void scramble_draw_stars(bitmap_rgb32 &bitmap, const rectangle &cliprect, int maxx); @@ -768,10 +769,10 @@ private: }; -class taiyo_sfx_state : public galaxian_state +class nihon_sfx_state : public galaxian_state { public: - taiyo_sfx_state(const machine_config &mconfig, device_type type, const char *tag) + nihon_sfx_state(const machine_config &mconfig, device_type type, const char *tag) : galaxian_state(mconfig, type, tag) , m_audio2(*this, "audio2") , m_dac(*this, "dac") @@ -779,31 +780,22 @@ public: } void sfx(machine_config &config); - void monsterz(machine_config &config); void init_sfx(); protected: virtual void machine_start() override; -private: uint8_t sample_io_r(offs_t offset); void sample_io_w(offs_t offset, uint8_t data); void sample_control_w(uint8_t data); - uint8_t monsterz_protection_r(); - void monsterz_porta_1_w(uint8_t data); - void monsterz_portb_1_w(uint8_t data); - void monsterz_portc_1_w(uint8_t data); - void monsterz_set_latch(); - void sfx_draw_background(bitmap_rgb32 &bitmap, const rectangle &cliprect); + void sfx_draw_bullet(bitmap_rgb32 &bitmap, const rectangle &cliprect, int offs, int x, int y); void sfx_map(address_map &map); void sfx_sample_map(address_map &map); void sfx_sample_portmap(address_map &map); - void monsterz_map(address_map &map); - void monsterz_sound_map(address_map &map); required_device<cpu_device> m_audio2; required_device<dac_byte_interface> m_dac; @@ -812,6 +804,38 @@ private: }; +class monsterz_state : public nihon_sfx_state +{ +public: + monsterz_state(const machine_config& mconfig, device_type type, const char* tag) + : nihon_sfx_state(mconfig, type, tag) + , m_dac2(*this, "dac2") + { + } + + void monsterz(machine_config& config); + + void init_monsterz(); + +protected: + virtual void machine_start() override; + +private: + void monsterz_map(address_map& map); + void monsterz_sound_map(address_map& map); + void monsterz_sound_portmap(address_map& map); + void monsterz_sample_map(address_map& map); + void monsterz_ay8910_w(offs_t offset, uint8_t data); + + required_device<dac_byte_interface> m_dac2; + + uint32_t m_monsterz_shift; + uint32_t m_monsterz_shift2; + uint8_t m_monsterz_audio_portb; + uint8_t m_monsterz_sample_portc; +}; + + class moonwar_state : public galaxian_state { public: diff --git a/src/mame/mame.lst b/src/mame/mame.lst index a9ef18fd502..ea7595c616d 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -62,6 +62,7 @@ slspirit // (c) 1999 Promat 48in1 // MAME based bootleg 48in1a // MAME based bootleg 48in1b // MAME based bootleg +48in1c // MAME based bootleg 4in1a // MAME based bootleg 4in1b // MAME based bootleg 60in1 // MAME based bootleg @@ -14547,6 +14548,7 @@ mimonscr // (c) 1982 bootleg mimonscra // (c) 1982 bootleg mltiwars // bootleg (Gayton Games) monsterz // (c) 1982 Nihon (Arcade TV Game List - P.102, Left, 20 from top) +monsterza // (c) 1982 Nihon (Arcade TV Game List - P.102, Left, 20 from top) moonal2 // [1980] Nichibutsu moonal2b // [1980] Nichibutsu moonaln // [Nichibutsu] (Karateco license) or hack diff --git a/src/mame/video/galaxian.cpp b/src/mame/video/galaxian.cpp index 6f32d43c8b0..6f59f183d32 100644 --- a/src/mame/video/galaxian.cpp +++ b/src/mame/video/galaxian.cpp @@ -930,12 +930,8 @@ void galaxian_state::null_draw_background(bitmap_rgb32 &bitmap, const rectangle } - -void galaxian_state::galaxian_draw_background(bitmap_rgb32 &bitmap, const rectangle &cliprect) +void galaxian_state::galaxian_draw_stars(bitmap_rgb32 &bitmap, const rectangle &cliprect, int maxx) { - /* erase the background to black first */ - bitmap.fill(rgb_t::black(), cliprect); - /* update the star origin to the current frame */ stars_update_origin(); @@ -948,12 +944,21 @@ void galaxian_state::galaxian_draw_background(bitmap_rgb32 &bitmap, const rectan for (y = cliprect.min_y; y <= cliprect.max_y; y++) { uint32_t star_offs = m_star_rng_origin + y * 512; - stars_draw_row(bitmap, 256, y, star_offs, 0xff); + stars_draw_row(bitmap, maxx, y, star_offs, 0xff); } } } +void galaxian_state::galaxian_draw_background(bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + /* erase the background to black first */ + bitmap.fill(rgb_t::black(), cliprect); + + galaxian_draw_stars(bitmap, cliprect, 256); +} + + void galaxian_state::background_draw_colorsplit(bitmap_rgb32 &bitmap, const rectangle &cliprect, rgb_t color, int split, int split_flipped) { /* horizontal bgcolor split */ @@ -1066,7 +1071,7 @@ void galaxian_state::turtles_draw_background(bitmap_rgb32 &bitmap, const rectang } -void taiyo_sfx_state::sfx_draw_background(bitmap_rgb32 &bitmap, const rectangle &cliprect) +void nihon_sfx_state::sfx_draw_background(bitmap_rgb32 &bitmap, const rectangle &cliprect) { // current schematics are unreadable, assuming like Turtles bitmap.fill(rgb_t(m_background_red * 0x55, m_background_green * 0x47, m_background_blue * 0x55), cliprect); @@ -1230,6 +1235,12 @@ void galaxian_state::theend_draw_bullet(bitmap_rgb32 &bitmap, const rectangle &c } +void nihon_sfx_state::sfx_draw_bullet(bitmap_rgb32 &bitmap, const rectangle &cliprect, int offs, int x, int y) +{ + scramble_draw_bullet(bitmap, cliprect, offs, x + 16, y); +} + + /************************************* * |