diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index d604ede648a..bda11dd97a7 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -1439,11 +1439,9 @@ files { createMAMEProjects(_target, _subtarget, "atlus") files { - MAME_DIR .. "src/mame/drivers/ohmygod.cpp", - MAME_DIR .. "src/mame/includes/ohmygod.h", - MAME_DIR .. "src/mame/video/ohmygod.cpp", - MAME_DIR .. "src/mame/drivers/patapata.cpp", MAME_DIR .. "src/mame/drivers/bowltry.cpp", + MAME_DIR .. "src/mame/drivers/ohmygod.cpp", + MAME_DIR .. "src/mame/drivers/patapata.cpp", } createMAMEProjects(_target, _subtarget, "barcrest") diff --git a/src/mame/drivers/crshrace.cpp b/src/mame/drivers/crshrace.cpp index 35fafc79eb0..648065506c9 100644 --- a/src/mame/drivers/crshrace.cpp +++ b/src/mame/drivers/crshrace.cpp @@ -3,6 +3,7 @@ /*************************************************************************** Crash Race (c) 1993 Video System Co. +VSEC-24 PCB driver by Nicola Salmoria @@ -458,68 +459,101 @@ void crshrace_state::crshrace(machine_config &config) ROM_START( crshrace ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code - ROM_LOAD16_WORD_SWAP( "1", 0x000000, 0x80000, CRC(21e34fb7) SHA1(be47b4a9bce2d6ce0a127dffe032c61547b2a3c0) ) + ROM_LOAD16_WORD_SWAP( "1.ic10", 0x000000, 0x80000, CRC(21e34fb7) SHA1(be47b4a9bce2d6ce0a127dffe032c61547b2a3c0) ) ROM_REGION16_BE( 0x100000, "user1", 0 ) // extra ROM - ROM_LOAD16_WORD_SWAP( "w21", 0x000000, 0x100000, CRC(a5df7325) SHA1(614095a086164af5b5e73245744411187d81deec) ) + ROM_LOAD16_WORD_SWAP( "w21.ic14", 0x000000, 0x100000, CRC(a5df7325) SHA1(614095a086164af5b5e73245744411187d81deec) ) ROM_REGION16_BE( 0x100000, "user2", 0 ) // extra ROM - ROM_LOAD16_WORD_SWAP( "w22", 0x000000, 0x100000, CRC(fc9d666d) SHA1(45aafcce82b668f93e51b5e4d092b1d0077e5192) ) + ROM_LOAD16_WORD_SWAP( "w22.ic13", 0x000000, 0x100000, CRC(fc9d666d) SHA1(45aafcce82b668f93e51b5e4d092b1d0077e5192) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // 64k for the audio CPU + banks - ROM_LOAD( "2", 0x00000, 0x20000, CRC(e70a900f) SHA1(edfe5df2dab5a7dccebe1a6f978144bcd516ab03) ) + ROM_LOAD( "2.ic58", 0x00000, 0x20000, CRC(e70a900f) SHA1(edfe5df2dab5a7dccebe1a6f978144bcd516ab03) ) ROM_REGION( 0x100000, "chars", 0 ) - ROM_LOAD( "h895", 0x000000, 0x100000, CRC(36ad93c3) SHA1(f68f229dd1a1f8bfd3b8f73b6627f5f00f809d34) ) + ROM_LOAD( "h895.ic50", 0x000000, 0x100000, CRC(36ad93c3) SHA1(f68f229dd1a1f8bfd3b8f73b6627f5f00f809d34) ) ROM_REGION( 0x400000, "tiles", 0 ) - ROM_LOAD( "w18", 0x000000, 0x100000, CRC(b15df90d) SHA1(56e38e6c40a02553b6b8c5282aa8f16b20779ebf) ) - ROM_LOAD( "w19", 0x100000, 0x100000, CRC(28326b93) SHA1(997e9b250b984b012ce1d165add59c741fb18171) ) - ROM_LOAD( "w20", 0x200000, 0x100000, CRC(d4056ad1) SHA1(4b45b14aa0766d7aef72f060e1cd28d67690d5fe) ) + ROM_LOAD( "w18.rom-a", 0x000000, 0x100000, CRC(b15df90d) SHA1(56e38e6c40a02553b6b8c5282aa8f16b20779ebf) ) + ROM_LOAD( "w19.rom-b", 0x100000, 0x100000, CRC(28326b93) SHA1(997e9b250b984b012ce1d165add59c741fb18171) ) + ROM_LOAD( "w20.rom-c", 0x200000, 0x100000, CRC(d4056ad1) SHA1(4b45b14aa0766d7aef72f060e1cd28d67690d5fe) ) // 300000-3fffff empty ROM_REGION( 0x400000, "sprites", 0 ) - ROM_LOAD( "h897", 0x000000, 0x200000, CRC(e3230128) SHA1(758c65f113481cf25bf0359deecd6736a7c9ee7e) ) - ROM_LOAD( "h896", 0x200000, 0x200000, CRC(fff60233) SHA1(56b4b708883a80761dc5f9184780477d72b80351) ) + ROM_LOAD( "h897.ic29", 0x000000, 0x200000, CRC(e3230128) SHA1(758c65f113481cf25bf0359deecd6736a7c9ee7e) ) + ROM_LOAD( "h896.ic75", 0x200000, 0x200000, CRC(fff60233) SHA1(56b4b708883a80761dc5f9184780477d72b80351) ) ROM_REGION( 0x100000, "ymsnd:adpcmb", 0 ) // sound samples - ROM_LOAD( "h894", 0x000000, 0x100000, CRC(d53300c1) SHA1(4c3ff7d3156791cb960c28845a5f1906605bce55) ) + ROM_LOAD( "h894.ic73", 0x000000, 0x100000, CRC(d53300c1) SHA1(4c3ff7d3156791cb960c28845a5f1906605bce55) ) ROM_REGION( 0x100000, "ymsnd:adpcma", 0 ) // sound samples - ROM_LOAD( "h893", 0x000000, 0x100000, CRC(32513b63) SHA1(c4ede4aaa2611cedb53d47448422a1926acf3052) ) + ROM_LOAD( "h893.ic69", 0x000000, 0x100000, CRC(32513b63) SHA1(c4ede4aaa2611cedb53d47448422a1926acf3052) ) ROM_END ROM_START( crshrace2 ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code - ROM_LOAD16_WORD_SWAP( "01-ic10.bin", 0x000000, 0x80000, CRC(b284aacd) SHA1(f0ef279cdec30eb32e8aa8cdd51e289b70f2d6f5) ) + ROM_LOAD16_WORD_SWAP( "01.ic10", 0x000000, 0x80000, CRC(b284aacd) SHA1(f0ef279cdec30eb32e8aa8cdd51e289b70f2d6f5) ) ROM_REGION16_BE( 0x100000, "user1", 0 ) // extra ROM - ROM_LOAD16_WORD_SWAP( "w21", 0x000000, 0x100000, CRC(a5df7325) SHA1(614095a086164af5b5e73245744411187d81deec) ) // IC14.BIN + ROM_LOAD16_WORD_SWAP( "w21.ic14", 0x000000, 0x100000, CRC(a5df7325) SHA1(614095a086164af5b5e73245744411187d81deec) ) ROM_REGION16_BE( 0x100000, "user2", 0 ) // extra ROM - ROM_LOAD16_WORD_SWAP( "w22", 0x000000, 0x100000, CRC(fc9d666d) SHA1(45aafcce82b668f93e51b5e4d092b1d0077e5192) ) // IC13.BIN + ROM_LOAD16_WORD_SWAP( "w22.ic13", 0x000000, 0x100000, CRC(fc9d666d) SHA1(45aafcce82b668f93e51b5e4d092b1d0077e5192) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // 64k for the audio CPU + banks - ROM_LOAD( "2", 0x00000, 0x20000, CRC(e70a900f) SHA1(edfe5df2dab5a7dccebe1a6f978144bcd516ab03) ) // 02-IC58.BIN + ROM_LOAD( "2.ic58", 0x00000, 0x20000, CRC(e70a900f) SHA1(edfe5df2dab5a7dccebe1a6f978144bcd516ab03) ) ROM_REGION( 0x100000, "chars", 0 ) - ROM_LOAD( "h895", 0x000000, 0x100000, CRC(36ad93c3) SHA1(f68f229dd1a1f8bfd3b8f73b6627f5f00f809d34) ) // IC50.BIN + ROM_LOAD( "h895.ic50", 0x000000, 0x100000, CRC(36ad93c3) SHA1(f68f229dd1a1f8bfd3b8f73b6627f5f00f809d34) ) ROM_REGION( 0x400000, "tiles", 0 ) - ROM_LOAD( "w18", 0x000000, 0x100000, CRC(b15df90d) SHA1(56e38e6c40a02553b6b8c5282aa8f16b20779ebf) ) // ROM-A.BIN - ROM_LOAD( "w19", 0x100000, 0x100000, CRC(28326b93) SHA1(997e9b250b984b012ce1d165add59c741fb18171) ) // ROM-B.BIN - ROM_LOAD( "w20", 0x200000, 0x100000, CRC(d4056ad1) SHA1(4b45b14aa0766d7aef72f060e1cd28d67690d5fe) ) // ROM-C.BIN + ROM_LOAD( "w18.rom-a", 0x000000, 0x100000, CRC(b15df90d) SHA1(56e38e6c40a02553b6b8c5282aa8f16b20779ebf) ) + ROM_LOAD( "w19.rom-b", 0x100000, 0x100000, CRC(28326b93) SHA1(997e9b250b984b012ce1d165add59c741fb18171) ) + ROM_LOAD( "w20.rom-c", 0x200000, 0x100000, CRC(d4056ad1) SHA1(4b45b14aa0766d7aef72f060e1cd28d67690d5fe) ) // 300000-3fffff empty ROM_REGION( 0x400000, "sprites", 0 ) - ROM_LOAD( "h897", 0x000000, 0x200000, CRC(e3230128) SHA1(758c65f113481cf25bf0359deecd6736a7c9ee7e) ) // IC29.BIN - ROM_LOAD( "h896", 0x200000, 0x200000, CRC(fff60233) SHA1(56b4b708883a80761dc5f9184780477d72b80351) ) // IC75.BIN + ROM_LOAD( "h897.ic29", 0x000000, 0x200000, CRC(e3230128) SHA1(758c65f113481cf25bf0359deecd6736a7c9ee7e) ) + ROM_LOAD( "h896.ic75", 0x200000, 0x200000, CRC(fff60233) SHA1(56b4b708883a80761dc5f9184780477d72b80351) ) ROM_REGION( 0x100000, "ymsnd:adpcmb", 0 ) // sound samples - ROM_LOAD( "h894", 0x000000, 0x100000, CRC(d53300c1) SHA1(4c3ff7d3156791cb960c28845a5f1906605bce55) ) // IC73.BIN + ROM_LOAD( "h894.ic73", 0x000000, 0x100000, CRC(d53300c1) SHA1(4c3ff7d3156791cb960c28845a5f1906605bce55) ) ROM_REGION( 0x100000, "ymsnd:adpcma", 0 ) // sound samples - ROM_LOAD( "h893", 0x000000, 0x100000, CRC(32513b63) SHA1(c4ede4aaa2611cedb53d47448422a1926acf3052) ) // IC69.BIN + ROM_LOAD( "h893.ic69", 0x000000, 0x100000, CRC(32513b63) SHA1(c4ede4aaa2611cedb53d47448422a1926acf3052) ) +ROM_END + +ROM_START( crshrace2a ) + ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code + ROM_LOAD16_WORD_SWAP( "01.ic10", 0x000000, 0x80000, CRC(b284aacd) SHA1(f0ef279cdec30eb32e8aa8cdd51e289b70f2d6f5) ) + + ROM_REGION16_BE( 0x100000, "user1", 0 ) // extra ROM + ROM_LOAD16_WORD_SWAP( "w21.ic14", 0x000000, 0x100000, CRC(a5df7325) SHA1(614095a086164af5b5e73245744411187d81deec) ) + + ROM_REGION16_BE( 0x100000, "user2", 0 ) // extra ROM + ROM_LOAD16_WORD_SWAP( "w22.ic13", 0x000000, 0x100000, CRC(fc9d666d) SHA1(45aafcce82b668f93e51b5e4d092b1d0077e5192) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) // 64k for the audio CPU + banks + ROM_LOAD( "2.ic58", 0x00000, 0x20000, CRC(7ef4f9dc) SHA1(cf9cc1cf16349b0b930f4572194b7ed3828c3bd8) ) // sldh + + ROM_REGION( 0x100000, "chars", 0 ) + ROM_LOAD( "h895.ic50", 0x000000, 0x100000, CRC(36ad93c3) SHA1(f68f229dd1a1f8bfd3b8f73b6627f5f00f809d34) ) + + ROM_REGION( 0x400000, "tiles", 0 ) // on a riser board + ROM_LOAD( "w18.rom-a", 0x000000, 0x100000, CRC(b15df90d) SHA1(56e38e6c40a02553b6b8c5282aa8f16b20779ebf) ) + ROM_LOAD( "w19.rom-b", 0x100000, 0x100000, CRC(28326b93) SHA1(997e9b250b984b012ce1d165add59c741fb18171) ) + ROM_LOAD( "w20.rom-c", 0x200000, 0x100000, CRC(d4056ad1) SHA1(4b45b14aa0766d7aef72f060e1cd28d67690d5fe) ) + // 300000-3fffff empty + + ROM_REGION( 0x400000, "sprites", 0 ) + ROM_LOAD( "h897.ic29", 0x000000, 0x200000, CRC(e3230128) SHA1(758c65f113481cf25bf0359deecd6736a7c9ee7e) ) + ROM_LOAD( "h896.ic75", 0x200000, 0x200000, CRC(fff60233) SHA1(56b4b708883a80761dc5f9184780477d72b80351) ) + + ROM_REGION( 0x100000, "ymsnd:adpcmb", 0 ) // sound samples + ROM_LOAD( "h894.ic73", 0x000000, 0x100000, CRC(d53300c1) SHA1(4c3ff7d3156791cb960c28845a5f1906605bce55) ) + + ROM_REGION( 0x100000, "ymsnd:adpcma", 0 ) // sound samples + ROM_LOAD( "h893.ic69", 0x000000, 0x100000, CRC(32513b63) SHA1(c4ede4aaa2611cedb53d47448422a1926acf3052) ) ROM_END @@ -548,5 +582,6 @@ void crshrace_state::init_crshrace2() } -GAME( 1993, crshrace, 0, crshrace, crshrace, crshrace_state, init_crshrace, ROT270, "Video System Co.", "Lethal Crash Race / Bakuretsu Crash Race (set 1)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1993, crshrace2, crshrace, crshrace, crshrace2, crshrace_state, init_crshrace2, ROT270, "Video System Co.", "Lethal Crash Race / Bakuretsu Crash Race (set 2)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, crshrace, 0, crshrace, crshrace, crshrace_state, init_crshrace, ROT270, "Video System Co.", "Lethal Crash Race / Bakuretsu Crash Race (set 1)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, crshrace2, crshrace, crshrace, crshrace2, crshrace_state, init_crshrace2, ROT270, "Video System Co.", "Lethal Crash Race / Bakuretsu Crash Race (set 2)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1993, crshrace2a, crshrace, crshrace, crshrace2, crshrace_state, init_crshrace2, ROT270, "Video System Co.", "Lethal Crash Race / Bakuretsu Crash Race (set 2, alternate sound ROM)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/igs017.cpp b/src/mame/drivers/igs017.cpp index 7e6d166cdc6..8dbdbe27915 100644 --- a/src/mame/drivers/igs017.cpp +++ b/src/mame/drivers/igs017.cpp @@ -4412,6 +4412,21 @@ ROM_START( genius6a ) ROM_LOAD( "speech.u17", 0x00000, 0x40000, CRC(d9e3d39f) SHA1(bec85d1ac2dfca77453cbca0e7dd53fee8fb438b) ) // same as iqblocka ROM_END +ROM_START( genius6b ) // PCB N0 - 0132, identical to V133F but for the main CPU ROM + ROM_REGION( 0x40000, "maincpu", 0 ) + ROM_LOAD( "genius6_v-132f.u18", 0x00000, 0x40000, CRC(231be791) SHA1(1684395dc93902893dca32952c236617ccdbc269) ) + + ROM_REGION( 0x80000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "genius6_cg.u7", 0x000000, 0x080000, CRC(1842d021) SHA1(78bfb5108741d39bd19b603cc97623fba7b2a31e) ) + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD( "text.u8", 0x000000, 0x040000, CRC(7716b601) SHA1(363cddd930fdec4821ebfaced64276f8fa943eae) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "speech.u17", 0x00000, 0x40000, CRC(d9e3d39f) SHA1(bec85d1ac2dfca77453cbca0e7dd53fee8fb438b) ) +ROM_END + + /*************************************************************************** Mahjong Tian Jiang Shen Bing @@ -5070,6 +5085,7 @@ GAME( 1997, sdmg2, 0, sdmg2, sdmg2, igs017_state, init_sdmg2, GAME( 1997, tjsb, 0, tjsb, tjsb, igs017_state, init_tjsb, ROT0, "IGS", "Mahjong Tian Jiang Shen Bing (V137C)", MACHINE_UNEMULATED_PROTECTION ) GAME( 1998, genius6, 0, genius6, genius6, igs017_state, init_iqblocka, ROT0, "IGS", "Genius 6 (V110F)", 0 ) GAME( 1997, genius6a, genius6, genius6, genius6, igs017_state, init_iqblocka, ROT0, "IGS", "Genius 6 (V133F)", 0 ) // clone because it has older copyright year +GAME( 1997, genius6b, genius6, genius6, genius6, igs017_state, init_iqblocka, ROT0, "IGS", "Genius 6 (V132F)", 0 ) // " GAME( 1998, mgcs, 0, mgcs, mgcs, igs017_state, init_mgcs, ROT0, "IGS", "Mahjong Man Guan Caishen (V103CS)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND ) GAME( 1998, lhzb2, 0, lhzb2, lhzb2, igs017_state, init_lhzb2, ROT0, "IGS", "Mahjong Long Hu Zhengba 2 (set 1)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // 龙虎争霸2 GAME( 1998, lhzb2a, lhzb2, lhzb2a, lhzb2a, igs017_state, init_lhzb2a, ROT0, "IGS", "Mahjong Long Hu Zhengba 2 (VS221M)", 0 ) // 龙虎争霸2 diff --git a/src/mame/drivers/ohmygod.cpp b/src/mame/drivers/ohmygod.cpp index 8b739a3d802..96f19318451 100644 --- a/src/mame/drivers/ohmygod.cpp +++ b/src/mame/drivers/ohmygod.cpp @@ -9,64 +9,222 @@ driver by Nicola Salmoria Notes: - not sure about the scroll registers -- lots of unknown RAM, maybe other gfx planes not used by this game +- lots of unknown RAM, maybe other GFX planes not used by these games ***************************************************************************/ #include "emu.h" -#include "includes/ohmygod.h" #include "cpu/m68000/m68000.h" #include "machine/watchdog.h" #include "sound/okim6295.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" -void ohmygod_state::ohmygod_ctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask) +namespace { + +class ohmygod_state : public driver_device +{ +public: + ohmygod_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_videoram(*this, "videoram"), + m_spriteram(*this, "spriteram"), + m_okibank(*this, "okibank"), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette") + { } + + void ohmygod(machine_config &config); + + void init_ohmygod(); + void init_naname(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + void ctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void spritebank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void scrollx_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void scrolly_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + TILE_GET_INFO_MEMBER(get_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); + void main_map(address_map &map); + void oki_map(address_map &map); + + // memory pointers + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_memory_bank m_okibank; + + // video-related + tilemap_t *m_bg_tilemap; + uint8_t m_spritebank; + uint16_t m_scrollx; + uint16_t m_scrolly; + + // misc + uint8_t m_adpcm_bank_shift; + uint8_t m_sndbank; + + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_palette; +}; + + +/*************************************************************************** + + Callbacks for the TileMap code + +***************************************************************************/ + +TILE_GET_INFO_MEMBER(ohmygod_state::get_tile_info) +{ + uint16_t code = m_videoram[2 * tile_index + 1]; + uint16_t attr = m_videoram[2 * tile_index]; + tileinfo.set(0, + code, + (attr & 0x0f00) >> 8, + 0); +} + + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +void ohmygod_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ohmygod_state::get_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); +} + + + +/*************************************************************************** + + Memory handlers + +***************************************************************************/ + +void ohmygod_state::videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_videoram[offset]); + m_bg_tilemap->mark_tile_dirty(offset / 2); +} + +void ohmygod_state::spritebank_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + if (ACCESSING_BITS_8_15) + m_spritebank = BIT(data, 15); +} + +void ohmygod_state::scrollx_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_scrollx); + m_bg_tilemap->set_scrollx(0, m_scrollx - 0x81ec); +} + +void ohmygod_state::scrolly_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_scrolly); + m_bg_tilemap->set_scrolly(0, m_scrolly - 0x81ef); +} + + +/*************************************************************************** + + Display refresh + +***************************************************************************/ + +void ohmygod_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) +{ + for (int offs = 0; offs < m_spriteram.bytes() / 4; offs += 4) + { + uint16_t *sr = m_spritebank ? (m_spriteram + m_spriteram.bytes() / 4) : m_spriteram; + + int code = sr[offs + 3] & 0x0fff; + int color = sr[offs + 2] & 0x000f; + int sx = sr[offs + 0] - 29; + int sy = sr[offs + 1]; + if (sy >= 32768) + sy -= 65536; + int flipx = sr[offs + 3] & 0x8000; + + m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, + code, + color, + flipx, 0, + sx, sy, 0); + } +} + +uint32_t ohmygod_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); + return 0; +} + + +void ohmygod_state::ctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask) { if (ACCESSING_BITS_0_7) { - /* ADPCM bank switch */ + // ADPCM bank switch if (m_sndbank != ((data >> m_adpcm_bank_shift) & 0x0f)) { m_sndbank = (data >> m_adpcm_bank_shift) & 0x0f; - membank("okibank")->set_entry(m_sndbank); + m_okibank->set_entry(m_sndbank); } } if (ACCESSING_BITS_8_15) { - machine().bookkeeping().coin_counter_w(0, data & 0x1000); - machine().bookkeeping().coin_counter_w(1, data & 0x2000); + machine().bookkeeping().coin_counter_w(0, BIT(data, 12)); + machine().bookkeeping().coin_counter_w(1, BIT(data, 13)); } } -void ohmygod_state::ohmygod_map(address_map &map) +void ohmygod_state::main_map(address_map &map) { map(0x000000, 0x07ffff).rom(); map(0x300000, 0x303fff).ram(); - map(0x304000, 0x307fff).ram().w(FUNC(ohmygod_state::ohmygod_videoram_w)).share("videoram"); + map(0x304000, 0x307fff).ram().w(FUNC(ohmygod_state::videoram_w)).share(m_videoram); map(0x308000, 0x30ffff).ram(); - map(0x400000, 0x400001).w(FUNC(ohmygod_state::ohmygod_scrollx_w)); - map(0x400002, 0x400003).w(FUNC(ohmygod_state::ohmygod_scrolly_w)); + map(0x400000, 0x400001).w(FUNC(ohmygod_state::scrollx_w)); + map(0x400002, 0x400003).w(FUNC(ohmygod_state::scrolly_w)); map(0x600000, 0x6007ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x700000, 0x703fff).ram().share("spriteram"); + map(0x700000, 0x703fff).ram().share(m_spriteram); map(0x704000, 0x707fff).ram(); - map(0x708000, 0x70ffff).ram(); /* Work RAM */ + map(0x708000, 0x70ffff).ram(); // Work RAM map(0x800000, 0x800001).portr("P1"); map(0x800002, 0x800003).portr("P2"); - map(0x900000, 0x900001).w(FUNC(ohmygod_state::ohmygod_ctrl_w)); + map(0x900000, 0x900001).w(FUNC(ohmygod_state::ctrl_w)); map(0xa00000, 0xa00001).portr("DSW1"); map(0xa00002, 0xa00003).portr("DSW2"); map(0xb00001, 0xb00001).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0xc00000, 0xc00001).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); - map(0xd00000, 0xd00001).w(FUNC(ohmygod_state::ohmygod_spritebank_w)); + map(0xd00000, 0xd00001).w(FUNC(ohmygod_state::spritebank_w)); } void ohmygod_state::oki_map(address_map &map) { map(0x00000, 0x1ffff).rom(); - map(0x20000, 0x3ffff).bankr("okibank"); + map(0x20000, 0x3ffff).bankr(m_okibank); } static INPUT_PORTS_START( ohmygod ) @@ -117,7 +275,7 @@ static INPUT_PORTS_START( ohmygod ) PORT_DIPSETTING( 0x0f00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0300, "5 Coins/6 Credits" ) PORT_DIPSETTING( 0x0200, DEF_STR( 4C_5C ) ) -// PORT_DIPSETTING( 0x0600, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x0600, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x0100, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x0e00, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0d00, DEF_STR( 1C_3C ) ) @@ -134,7 +292,7 @@ static INPUT_PORTS_START( ohmygod ) PORT_DIPSETTING( 0xf000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x3000, "5 Coins/6 Credits" ) PORT_DIPSETTING( 0x2000, DEF_STR( 4C_5C ) ) -// PORT_DIPSETTING( 0x6000, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x6000, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x1000, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0xe000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xd000, DEF_STR( 1C_3C ) ) @@ -217,7 +375,7 @@ static INPUT_PORTS_START( naname ) PORT_DIPSETTING( 0x0f00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0300, "5 Coins/6 Credits" ) PORT_DIPSETTING( 0x0200, DEF_STR( 4C_5C ) ) -// PORT_DIPSETTING( 0x0600, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x0600, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x0100, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x0e00, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0d00, DEF_STR( 1C_3C ) ) @@ -234,7 +392,7 @@ static INPUT_PORTS_START( naname ) PORT_DIPSETTING( 0xf000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x3000, "5 Coins/6 Credits" ) PORT_DIPSETTING( 0x2000, DEF_STR( 4C_5C ) ) -// PORT_DIPSETTING( 0x6000, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x6000, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x1000, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0xe000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xd000, DEF_STR( 1C_3C ) ) @@ -271,40 +429,16 @@ INPUT_PORTS_END -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 -}; - -static const gfx_layout spritelayout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, - 8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 }, - { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, - 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, - 128*8 -}; - static GFXDECODE_START( gfx_ohmygod ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) /* colors 0-255 */ - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 512, 16 ) /* colors 512-767 */ + GFXDECODE_ENTRY( "chars", 0, gfx_8x8x4_packed_msb, 0, 16 ) // colors 0-255 + GFXDECODE_ENTRY( "sprites", 0, gfx_16x16x4_packed_msb, 512, 16 ) // colors 512-767 GFXDECODE_END void ohmygod_state::machine_start() { - membank("okibank")->configure_entries(0, 16, memregion("oki")->base(), 0x20000); + m_okibank->configure_entries(0, 16, memregion("oki")->base(), 0x20000); save_item(NAME(m_spritebank)); save_item(NAME(m_scrollx)); @@ -322,31 +456,31 @@ void ohmygod_state::machine_reset() void ohmygod_state::ohmygod(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware M68000(config, m_maincpu, 12000000); - m_maincpu->set_addrmap(AS_PROGRAM, &ohmygod_state::ohmygod_map); + m_maincpu->set_addrmap(AS_PROGRAM, &ohmygod_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(ohmygod_state::irq1_line_hold)); - WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ + WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); // a guess, and certainly wrong - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(64*8, 32*8); screen.set_visarea(12*8, (64-12)*8-1, 0*8, 30*8-1 ); - screen.set_screen_update(FUNC(ohmygod_state::screen_update_ohmygod)); + screen.set_screen_update(FUNC(ohmygod_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_ohmygod); PALETTE(config, m_palette).set_format(palette_device::xGRB_555, 1024); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - okim6295_device &oki(OKIM6295(config, "oki", 14000000/8, okim6295_device::PIN7_HIGH)); + okim6295_device &oki(OKIM6295(config, "oki", 14000000 / 8, okim6295_device::PIN7_HIGH)); oki.set_addrmap(0, &ohmygod_state::oki_map); oki.add_route(ALL_OUTPUTS, "mono", 1.0); } @@ -362,28 +496,28 @@ ROM_START( ohmygod ) ROM_REGION( 0x80000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "omg-p.114", 0x00000, 0x80000, CRC(48fa40ca) SHA1(b1d91e1a4a888526febbe53a12b73e375f604f2b) ) - ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_REGION( 0x80000, "chars", 0 ) ROM_LOAD( "omg-b.117", 0x00000, 0x80000, CRC(73621fa6) SHA1(de28c123eeaab78af83ab673431f90c97569450b) ) - ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD( "omg-s.120", 0x00000, 0x80000, CRC(6413bd36) SHA1(52c455d727496eae80bfab9460127c4c5a874e32) ) ROM_REGION( 0x200000, "oki", 0 ) - ROM_LOAD( "omg-g.107", 0x00000, 0x200000, CRC(7405573c) SHA1(f4e7318c0a58f43d3c6370490637aea53b28547e) ) /* 00000-1ffff is fixed, 20000-3ffff is banked */ + ROM_LOAD( "omg-g.107", 0x00000, 0x200000, CRC(7405573c) SHA1(f4e7318c0a58f43d3c6370490637aea53b28547e) ) // 00000-1ffff is fixed, 20000-3ffff is banked ROM_END ROM_START( naname ) ROM_REGION( 0x80000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "036-prg.114", 0x00000, 0x80000, CRC(3b7362f7) SHA1(ba16ec9df8569bacd387561ef2b3ea5b17cb650c) ) - ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_REGION( 0x80000, "chars", 0 ) ROM_LOAD( "036-bg.117", 0x00000, 0x80000, CRC(f53e8da5) SHA1(efaec4bb90cad75380ac6eb6859379cdefd187ac) ) - ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD( "036-spr.120", 0x00000, 0x80000, CRC(e36d8731) SHA1(652709d7884d40459c95761c8abcb394c4b712bf) ) ROM_REGION( 0x200000, "oki", 0 ) - ROM_LOAD( "036-snd.107", 0x00000, 0x200000, CRC(a3e0caf4) SHA1(35b0eb4ae5b9df1b7c99ec2476a6d834ea50d2e3) ) /* 00000-1ffff is fixed, 20000-3ffff is banked */ + ROM_LOAD( "036-snd.107", 0x00000, 0x200000, CRC(a3e0caf4) SHA1(35b0eb4ae5b9df1b7c99ec2476a6d834ea50d2e3) ) // 00000-1ffff is fixed, 20000-3ffff is banked ROM_END @@ -398,6 +532,8 @@ void ohmygod_state::init_naname() m_adpcm_bank_shift = 0; } +} // Anonymous namespace + GAME( 1993, ohmygod, 0, ohmygod, ohmygod, ohmygod_state, init_ohmygod, ROT0, "Atlus", "Oh My God! (Japan)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) GAME( 1994, naname, 0, ohmygod, naname, ohmygod_state, init_naname, ROT0, "Atlus", "Naname de Magic! (Japan)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/ohmygod.h b/src/mame/includes/ohmygod.h deleted file mode 100644 index df7a2d2c175..00000000000 --- a/src/mame/includes/ohmygod.h +++ /dev/null @@ -1,67 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -/************************************************************************* - - Oh My God! - -*************************************************************************/ -#ifndef MAME_INCLUDES_OHMYGOD_H -#define MAME_INCLUDES_OHMYGOD_H - -#pragma once - -#include "emupal.h" -#include "tilemap.h" - -class ohmygod_state : public driver_device -{ -public: - ohmygod_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") - { } - - void ohmygod(machine_config &config); - - void init_ohmygod(); - void init_naname(); - -private: - void ohmygod_ctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void ohmygod_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void ohmygod_spritebank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void ohmygod_scrollx_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void ohmygod_scrolly_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - TILE_GET_INFO_MEMBER(get_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_ohmygod(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - void ohmygod_map(address_map &map); - void oki_map(address_map &map); - - /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - - /* video-related */ - tilemap_t *m_bg_tilemap; - int m_spritebank; - uint16_t m_scrollx; - uint16_t m_scrolly; - - /* misc */ - int m_adpcm_bank_shift; - int m_sndbank; - - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; -}; - -#endif // MAME_INCLUDES_OHMYGOD_H diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 9f8437b13a4..72e8e0cd5c9 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -11540,6 +11540,7 @@ crospuzl // @source:crshrace.cpp crshrace // (c) 1993 Video System Co. crshrace2 // (c) 1993 Video System Co. +crshrace2a // (c) 1993 Video System Co. @source:crvision.cpp crvisio2 // @@ -17132,6 +17133,7 @@ xymg // (c) 1996 @source:igs017.cpp genius6 // (c) 1998 genius6a // (c) 1997 +genius6b // (c) 1997 happyskl // (c) 2001? iqblocka // (c) 1996 iqblockf // (c) 1996 diff --git a/src/mame/video/ohmygod.cpp b/src/mame/video/ohmygod.cpp deleted file mode 100644 index 2558eaf7c16..00000000000 --- a/src/mame/video/ohmygod.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -#include "emu.h" -#include "includes/ohmygod.h" - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILE_GET_INFO_MEMBER(ohmygod_state::get_tile_info) -{ - uint16_t code = m_videoram[2 * tile_index + 1]; - uint16_t attr = m_videoram[2 * tile_index]; - tileinfo.set(0, - code, - (attr & 0x0f00) >> 8, - 0); -} - - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void ohmygod_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ohmygod_state::get_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); -} - - - -/*************************************************************************** - - Memory handlers - -***************************************************************************/ - -void ohmygod_state::ohmygod_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_videoram[offset]); - m_bg_tilemap->mark_tile_dirty(offset / 2); -} - -void ohmygod_state::ohmygod_spritebank_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - if (ACCESSING_BITS_8_15) - m_spritebank = data & 0x8000; -} - -void ohmygod_state::ohmygod_scrollx_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_scrollx); - m_bg_tilemap->set_scrollx(0, m_scrollx - 0x81ec); -} - -void ohmygod_state::ohmygod_scrolly_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_scrolly); - m_bg_tilemap->set_scrolly(0, m_scrolly - 0x81ef); -} - - -/*************************************************************************** - - Display refresh - -***************************************************************************/ - -void ohmygod_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - uint16_t *spriteram = m_spriteram; - int offs; - - for (offs = 0; offs < m_spriteram.bytes() / 4; offs += 4) - { - int sx, sy, code, color, flipx; - uint16_t *sr; - - sr = m_spritebank ? (spriteram + m_spriteram.bytes() / 4) : spriteram; - - code = sr[offs + 3] & 0x0fff; - color = sr[offs + 2] & 0x000f; - sx = sr[offs + 0] - 29; - sy = sr[offs + 1]; - if (sy >= 32768) - sy -= 65536; - flipx = sr[offs + 3] & 0x8000; - - m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, - code, - color, - flipx,0, - sx,sy,0); - } -} - -uint32_t ohmygod_state::screen_update_ohmygod(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - draw_sprites(bitmap, cliprect); - return 0; -}