diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 36917e8348f..db012b8d572 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -1764,8 +1764,6 @@ files { MAME_DIR .. "src/mame/video/decocass.cpp", MAME_DIR .. "src/mame/drivers/deshoros.cpp", MAME_DIR .. "src/mame/drivers/dietgo.cpp", - MAME_DIR .. "src/mame/includes/dietgo.h", - MAME_DIR .. "src/mame/video/dietgo.cpp", MAME_DIR .. "src/mame/drivers/dreambal.cpp", MAME_DIR .. "src/mame/drivers/exprraid.cpp", MAME_DIR .. "src/mame/includes/exprraid.h", diff --git a/src/mame/drivers/cchasm.cpp b/src/mame/drivers/cchasm.cpp index e40fa754d2e..99385a62057 100644 --- a/src/mame/drivers/cchasm.cpp +++ b/src/mame/drivers/cchasm.cpp @@ -22,7 +22,6 @@ #include "machine/gen_latch.h" #include "machine/watchdog.h" #include "machine/z80ctc.h" -#include "machine/z80ctc.h" #include "machine/z80daisy.h" #include "sound/ay8910.h" #include "sound/dac.h" diff --git a/src/mame/drivers/dietgo.cpp b/src/mame/drivers/dietgo.cpp index c4fe483750a..a8c0fe19998 100644 --- a/src/mame/drivers/dietgo.cpp +++ b/src/mame/drivers/dietgo.cpp @@ -22,65 +22,131 @@ PAL16R6A 11H */ #include "emu.h" -#include "includes/dietgo.h" +#include "cpu/h6280/h6280.h" #include "cpu/m68000/m68000.h" #include "sound/okim6295.h" #include "sound/ymopm.h" + #include "machine/decocrpt.h" #include "machine/deco102.h" -#include "machine/gen_latch.h" +#include "machine/deco104.h" +#include "video/deco16ic.h" +#include "video/decospr.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" -uint16_t dietgo_state::dietgo_protection_region_0_104_r(offs_t offset) +namespace { + +class dietgo_state : public driver_device { - int real_address = 0 + (offset *2); +public: + dietgo_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_pf_rowscroll(*this, "pf%u_rowscroll", 1) + , m_spriteram(*this, "spriteram") + , m_decrypted_opcodes(*this, "decrypted_opcodes") + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_deco_tilegen(*this, "tilegen") + , m_deco104(*this, "ioprot104") + , m_sprgen(*this, "spritegen") + { } + + void dietgo(machine_config &config); + + void init_dietgo(); + +private: + // memory pointers + required_shared_ptr_array m_pf_rowscroll; + required_shared_ptr m_spriteram; + required_shared_ptr m_decrypted_opcodes; + + // devices + required_device m_maincpu; + required_device m_audiocpu; + required_device m_deco_tilegen; + required_device m_deco104; + required_device m_sprgen; + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECO16IC_BANK_CB_MEMBER(bank_callback); + + uint16_t protection_region_0_104_r(offs_t offset); + void protection_region_0_104_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void decrypted_opcodes_map(address_map &map); + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +uint32_t dietgo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + uint16_t flip = m_deco_tilegen->pf_control_r(0); + + flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); + m_deco_tilegen->pf_update(m_pf_rowscroll[0], m_pf_rowscroll[1]); + + bitmap.fill(256, cliprect); /* not verified */ + + m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); + + m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); + return 0; +} + +uint16_t dietgo_state::protection_region_0_104_r(offs_t offset) +{ + int real_address = 0 + (offset * 2); int deco146_addr = bitswap<32>(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; uint8_t cs = 0; - uint16_t data = m_deco104->read_data( deco146_addr, cs ); + uint16_t data = m_deco104->read_data(deco146_addr, cs); return data; } -void dietgo_state::dietgo_protection_region_0_104_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void dietgo_state::protection_region_0_104_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - int real_address = 0 + (offset *2); + int real_address = 0 + (offset * 2); int deco146_addr = bitswap<32>(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; uint8_t cs = 0; - m_deco104->write_data( deco146_addr, data, mem_mask, cs ); + m_deco104->write_data(deco146_addr, data, mem_mask, cs); } -void dietgo_state::dietgo_map(address_map &map) +void dietgo_state::main_map(address_map &map) { map(0x000000, 0x07ffff).rom(); map(0x200000, 0x20000f).w(m_deco_tilegen, FUNC(deco16ic_device::pf_control_w)); map(0x210000, 0x211fff).w(m_deco_tilegen, FUNC(deco16ic_device::pf1_data_w)); map(0x212000, 0x213fff).w(m_deco_tilegen, FUNC(deco16ic_device::pf2_data_w)); - map(0x220000, 0x2207ff).writeonly().share("pf1_rowscroll"); - map(0x222000, 0x2227ff).writeonly().share("pf2_rowscroll"); - map(0x280000, 0x2807ff).ram().share("spriteram"); + map(0x220000, 0x2207ff).writeonly().share(m_pf_rowscroll[0]); + map(0x222000, 0x2227ff).writeonly().share(m_pf_rowscroll[1]); + map(0x280000, 0x2807ff).ram().share(m_spriteram); map(0x300000, 0x300bff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); - map(0x340000, 0x343fff).rw(FUNC(dietgo_state::dietgo_protection_region_0_104_r), FUNC(dietgo_state::dietgo_protection_region_0_104_w)).share("prot16ram"); /* Protection device */ + map(0x340000, 0x343fff).rw(FUNC(dietgo_state::protection_region_0_104_r), FUNC(dietgo_state::protection_region_0_104_w)).share("prot16ram"); // Protection device map(0x380000, 0x38ffff).ram(); // mainram } void dietgo_state::decrypted_opcodes_map(address_map &map) { - map(0x000000, 0x07ffff).rom().share("decrypted_opcodes"); + map(0x000000, 0x07ffff).rom().share(m_decrypted_opcodes); } -/* Physical memory map (21 bits) */ +// Physical memory map (21 bits) void dietgo_state::sound_map(address_map &map) { map(0x000000, 0x00ffff).rom(); - map(0x100000, 0x100001).noprw(); /* YM2203 - this board doesn't have one */ + map(0x100000, 0x100001).noprw(); // YM2203 - this board doesn't have one map(0x110000, 0x110001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); map(0x120000, 0x120001).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x130000, 0x130001).noprw(); /* This board only has 1 oki chip */ + map(0x130000, 0x130001).noprw(); // This board only has 1 oki chip map(0x140000, 0x140000).r(m_deco104, FUNC(deco104_device::soundlatch_r)); map(0x1f0000, 0x1f1fff).ram(); } @@ -88,7 +154,7 @@ void dietgo_state::sound_map(address_map &map) static INPUT_PORTS_START( dietgo ) - PORT_START("SYSTEM") /* Verified as 4 bit input port only */ + PORT_START("SYSTEM") // Verified as 4 bit input port only PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) @@ -185,9 +251,9 @@ static const gfx_layout tile_16x16_layout = }; static GFXDECODE_START( gfx_dietgo ) - GFXDECODE_ENTRY( "gfx1", 0, tile_8x8_layout, 0, 32 ) /* Tiles (8x8) */ - GFXDECODE_ENTRY( "gfx1", 0, tile_16x16_layout, 0, 32 ) /* Tiles (16x16) */ - GFXDECODE_ENTRY( "gfx2", 0, tile_16x16_layout, 512, 16 ) /* Sprites (16x16) */ + GFXDECODE_ENTRY( "tiles", 0, tile_8x8_layout, 0, 32 ) // Tiles (8x8) + GFXDECODE_ENTRY( "tiles", 0, tile_16x16_layout, 0, 32 ) // Tiles (16x16) + GFXDECODE_ENTRY( "sprites", 0, tile_16x16_layout, 512, 16 ) // Sprites (16x16) GFXDECODE_END DECO16IC_BANK_CB_MEMBER(dietgo_state::bank_callback) @@ -197,20 +263,20 @@ DECO16IC_BANK_CB_MEMBER(dietgo_state::bank_callback) void dietgo_state::dietgo(machine_config &config) { - /* basic machine hardware */ - M68000(config, m_maincpu, XTAL(28'000'000)/2); /* DE102 (verified on pcb) */ - m_maincpu->set_addrmap(AS_PROGRAM, &dietgo_state::dietgo_map); + // basic machine hardware + M68000(config, m_maincpu, XTAL(28'000'000) / 2); // DE102 (verified on PCB) + m_maincpu->set_addrmap(AS_PROGRAM, &dietgo_state::main_map); m_maincpu->set_addrmap(AS_OPCODES, &dietgo_state::decrypted_opcodes_map); m_maincpu->set_vblank_int("screen", FUNC(dietgo_state::irq6_line_hold)); - H6280(config, m_audiocpu, XTAL(32'220'000)/4/3); /* Custom chip 45; XIN is 32.220MHZ/4, verified on pcb */ + H6280(config, m_audiocpu, XTAL(32'220'000) / 4 / 3); // Custom chip 45; XIN is 32.220MHZ/4, verified on PCB m_audiocpu->set_addrmap(AS_PROGRAM, &dietgo_state::sound_map); m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(58); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(40*8, 32*8); screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1); screen.set_screen_update(FUNC(dietgo_state::screen_update)); @@ -245,122 +311,123 @@ void dietgo_state::dietgo(machine_config &config) m_deco104->set_interface_scramble_interleave(); m_deco104->set_use_magic_read_address_xor(true); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(32'220'000)/9)); /* verified on pcb */ - ymsnd.irq_handler().set_inputline(m_audiocpu, 1); /* IRQ2 */ + ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(32'220'000) / 9)); // verified on PCB + ymsnd.irq_handler().set_inputline(m_audiocpu, 1); // IRQ2 ymsnd.add_route(ALL_OUTPUTS, "mono", 0.45); - OKIM6295(config, "oki", XTAL(32'220'000)/32, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.60); /* verified on pcb */ + OKIM6295(config, "oki", XTAL(32'220'000) / 32, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.60); // verified on PCB } -/* Diet Go Go */ - ROM_START( dietgo ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* DE102 code (encrypted) */ + ROM_REGION( 0x80000, "maincpu", 0 ) // DE102 code (encrypted) ROM_LOAD16_BYTE( "jy_00-2.4h", 0x000001, 0x040000, CRC(014dcf62) SHA1(1a28ce4a643ec8b6f062b1200342ed4dc6db38a1) ) ROM_LOAD16_BYTE( "jy_01-2.5h", 0x000000, 0x040000, CRC(793ebd83) SHA1(b9178f18ce6e9fca848cbbf9dce3f3856672bf94) ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "jy_02.14m", 0x00000, 0x10000, CRC(4e3492a5) SHA1(5f302bdbacbf95ea9f3694c48545a1d6bba4b019) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "tiles", 0 ) ROM_LOAD( "may-00.10a", 0x00000, 0x100000, CRC(234d1f8d) SHA1(42d23aad20df20cbd2359cc12bdd47636b2027d3) ) - ROM_REGION( 0x200000, "gfx2", 0 ) + ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD( "may-01.14a", 0x000000, 0x100000, CRC(2da57d04) SHA1(3898e9fef365ecaa4d86aa11756b527a4fffb494) ) ROM_LOAD( "may-02.16a", 0x100000, 0x100000, CRC(3a66a713) SHA1(beeb99156332cf4870738f7769b719a02d7b40af) ) - ROM_REGION( 0x80000, "oki", 0 ) /* Oki samples */ + ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "may-03.11l", 0x00000, 0x80000, CRC(b6e42bae) SHA1(c282cdf7db30fb63340cc609bf00f5ab63a75583) ) ROM_REGION( 0x0600, "plds", 0 ) - ROM_LOAD( "pal16l8b_vd-00.6h", 0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */ - ROM_LOAD( "pal16l8b_vd-01.7h", 0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */ - ROM_LOAD( "pal16r6a_vd-02.11h", 0x0400, 0x0104, NO_DUMP ) /* PAL is read protected */ + ROM_LOAD( "pal16l8b_vd-00.6h", 0x0000, 0x0104, NO_DUMP ) // PAL is read protected + ROM_LOAD( "pal16l8b_vd-01.7h", 0x0200, 0x0104, NO_DUMP ) // PAL is read protected + ROM_LOAD( "pal16r6a_vd-02.11h", 0x0400, 0x0104, NO_DUMP ) // PAL is read protected ROM_END ROM_START( dietgoe ) // weird, still version 1.1 but different (earlier) date - ROM_REGION( 0x80000, "maincpu", 0 ) /* DE102 code (encrypted) */ + ROM_REGION( 0x80000, "maincpu", 0 ) // DE102 code (encrypted) ROM_LOAD16_BYTE( "jy_00-1.4h", 0x000001, 0x040000, CRC(8bce137d) SHA1(55f5b1c89330803c6147f9656f2cabe8d1de8478) ) ROM_LOAD16_BYTE( "jy_01-1.5h", 0x000000, 0x040000, CRC(eca50450) SHA1(1a24117e3b1b66d7dbc5484c94cc2c627d34e6a3) ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "jy_02.14m", 0x00000, 0x10000, CRC(4e3492a5) SHA1(5f302bdbacbf95ea9f3694c48545a1d6bba4b019) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "tiles", 0 ) ROM_LOAD( "may-00.10a", 0x00000, 0x100000, CRC(234d1f8d) SHA1(42d23aad20df20cbd2359cc12bdd47636b2027d3) ) - ROM_REGION( 0x200000, "gfx2", 0 ) + ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD( "may-01.14a", 0x000000, 0x100000, CRC(2da57d04) SHA1(3898e9fef365ecaa4d86aa11756b527a4fffb494) ) ROM_LOAD( "may-02.16a", 0x100000, 0x100000, CRC(3a66a713) SHA1(beeb99156332cf4870738f7769b719a02d7b40af) ) - ROM_REGION( 0x80000, "oki", 0 ) /* Oki samples */ + ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "may-03.11l", 0x00000, 0x80000, CRC(b6e42bae) SHA1(c282cdf7db30fb63340cc609bf00f5ab63a75583) ) ROM_REGION( 0x0600, "plds", 0 ) - ROM_LOAD( "pal16l8b_vd-00.6h", 0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */ - ROM_LOAD( "pal16l8b_vd-01.7h", 0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */ - ROM_LOAD( "pal16r6a_vd-02.11h", 0x0400, 0x0104, NO_DUMP ) /* PAL is read protected */ + ROM_LOAD( "pal16l8b_vd-00.6h", 0x0000, 0x0104, NO_DUMP ) // PAL is read protected + ROM_LOAD( "pal16l8b_vd-01.7h", 0x0200, 0x0104, NO_DUMP ) // PAL is read protected + ROM_LOAD( "pal16r6a_vd-02.11h", 0x0400, 0x0104, NO_DUMP ) // PAL is read protected ROM_END ROM_START( dietgou ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* DE102 code (encrypted) */ + ROM_REGION( 0x80000, "maincpu", 0 ) // DE102 code (encrypted) ROM_LOAD16_BYTE( "jx_00-.4h", 0x000001, 0x040000, CRC(1a9de04f) SHA1(7ce1e7cf4cdce2b02da4df2a6ae9a9e665e24422) ) ROM_LOAD16_BYTE( "jx_01-.5h", 0x000000, 0x040000, CRC(79c097c8) SHA1(be49055ee324535e1118d243bd49e74ec1d2a2d7) ) ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "jx_02.14m", 0x00000, 0x10000, CRC(4e3492a5) SHA1(5f302bdbacbf95ea9f3694c48545a1d6bba4b019) ) /* Same as other regions but different label */ + ROM_LOAD( "jx_02.14m", 0x00000, 0x10000, CRC(4e3492a5) SHA1(5f302bdbacbf95ea9f3694c48545a1d6bba4b019) ) // Same as other regions but different label - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "tiles", 0 ) ROM_LOAD( "may-00.10a", 0x00000, 0x100000, CRC(234d1f8d) SHA1(42d23aad20df20cbd2359cc12bdd47636b2027d3) ) - ROM_REGION( 0x200000, "gfx2", 0 ) + ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD( "may-01.14a", 0x000000, 0x100000, CRC(2da57d04) SHA1(3898e9fef365ecaa4d86aa11756b527a4fffb494) ) ROM_LOAD( "may-02.16a", 0x100000, 0x100000, CRC(3a66a713) SHA1(beeb99156332cf4870738f7769b719a02d7b40af) ) - ROM_REGION( 0x80000, "oki", 0 ) /* Oki samples */ + ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "may-03.11l", 0x00000, 0x80000, CRC(b6e42bae) SHA1(c282cdf7db30fb63340cc609bf00f5ab63a75583) ) ROM_REGION( 0x0600, "plds", 0 ) - ROM_LOAD( "pal16l8b_vd-00.6h", 0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */ - ROM_LOAD( "pal16l8b_vd-01.7h", 0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */ - ROM_LOAD( "pal16r6a_vd-02.11h", 0x0400, 0x0104, NO_DUMP ) /* PAL is read protected */ + ROM_LOAD( "pal16l8b_vd-00.6h", 0x0000, 0x0104, NO_DUMP ) // PAL is read protected + ROM_LOAD( "pal16l8b_vd-01.7h", 0x0200, 0x0104, NO_DUMP ) // PAL is read protected + ROM_LOAD( "pal16r6a_vd-02.11h", 0x0400, 0x0104, NO_DUMP ) // PAL is read protected ROM_END ROM_START( dietgoj ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* DE102 code (encrypted) */ + ROM_REGION( 0x80000, "maincpu", 0 ) // DE102 code (encrypted) ROM_LOAD16_BYTE( "jw_00-2.4h", 0x000001, 0x040000, CRC(e6ba6c49) SHA1(d5eaea81f1353c58c03faae67428f7ee98e766b1) ) ROM_LOAD16_BYTE( "jw_01-2.5h", 0x000000, 0x040000, CRC(684a3d57) SHA1(bd7a57ba837a1dc8f92b5ebcb46e50db1f98524f) ) ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "jw_02.14m", 0x00000, 0x10000, CRC(4e3492a5) SHA1(5f302bdbacbf95ea9f3694c48545a1d6bba4b019) ) /* Same as other regions but different label */ + ROM_LOAD( "jw_02.14m", 0x00000, 0x10000, CRC(4e3492a5) SHA1(5f302bdbacbf95ea9f3694c48545a1d6bba4b019) ) // Same as other regions but different label - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "tiles", 0 ) ROM_LOAD( "may-00.10a", 0x00000, 0x100000, CRC(234d1f8d) SHA1(42d23aad20df20cbd2359cc12bdd47636b2027d3) ) - ROM_REGION( 0x200000, "gfx2", 0 ) + ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD( "may-01.14a", 0x000000, 0x100000, CRC(2da57d04) SHA1(3898e9fef365ecaa4d86aa11756b527a4fffb494) ) ROM_LOAD( "may-02.16a", 0x100000, 0x100000, CRC(3a66a713) SHA1(beeb99156332cf4870738f7769b719a02d7b40af) ) - ROM_REGION( 0x80000, "oki", 0 ) /* Oki samples */ + ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "may-03.11l", 0x00000, 0x80000, CRC(b6e42bae) SHA1(c282cdf7db30fb63340cc609bf00f5ab63a75583) ) ROM_REGION( 0x0600, "plds", 0 ) - ROM_LOAD( "pal16l8b_vd-00.6h", 0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */ - ROM_LOAD( "pal16l8b_vd-01.7h", 0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */ - ROM_LOAD( "pal16r6a_vd-02.11h", 0x0400, 0x0104, NO_DUMP ) /* PAL is read protected */ + ROM_LOAD( "pal16l8b_vd-00.6h", 0x0000, 0x0104, NO_DUMP ) // PAL is read protected + ROM_LOAD( "pal16l8b_vd-01.7h", 0x0200, 0x0104, NO_DUMP ) // PAL is read protected + ROM_LOAD( "pal16r6a_vd-02.11h", 0x0400, 0x0104, NO_DUMP ) // PAL is read protected ROM_END void dietgo_state::init_dietgo() { - deco56_decrypt_gfx(machine(), "gfx1"); + deco56_decrypt_gfx(machine(), "tiles"); deco102_decrypt_cpu((uint16_t *)memregion("maincpu")->base(), m_decrypted_opcodes, 0x80000, 0xe9ba, 0x01, 0x19); } +} // Anonymous namespace + + GAME( 1992, dietgo, 0, dietgo, dietgo, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (Euro v1.1 1992.09.26)", MACHINE_SUPPORTS_SAVE ) GAME( 1992, dietgoe, dietgo, dietgo, dietgo, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (Euro v1.1 1992.08.04)" , MACHINE_SUPPORTS_SAVE ) GAME( 1992, dietgou, dietgo, dietgo, dietgo, dietgo_state, init_dietgo, ROT0, "Data East Corporation", "Diet Go Go (USA v1.1 1992.09.26)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/dietgo.h b/src/mame/includes/dietgo.h deleted file mode 100644 index 7a6196eb70f..00000000000 --- a/src/mame/includes/dietgo.h +++ /dev/null @@ -1,59 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail, David Haywood -/************************************************************************* - - Diet Go Go - -*************************************************************************/ -#ifndef MAME_INCLUDES_DIETGO_H -#define MAME_INCLUDES_DIETGO_H - -#pragma once - -#include "cpu/h6280/h6280.h" -#include "video/decospr.h" -#include "video/deco16ic.h" -#include "machine/deco104.h" - -class dietgo_state : public driver_device -{ -public: - dietgo_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_deco104(*this, "ioprot104") - , m_pf_rowscroll(*this, "pf%u_rowscroll", 1) - , m_spriteram(*this, "spriteram") - , m_sprgen(*this, "spritegen") - , m_maincpu(*this, "maincpu") - , m_audiocpu(*this, "audiocpu") - , m_deco_tilegen(*this, "tilegen") - , m_decrypted_opcodes(*this, "decrypted_opcodes") - { } - - void dietgo(machine_config &config); - - void init_dietgo(); - -private: - optional_device m_deco104; - /* memory pointers */ - required_shared_ptr_array m_pf_rowscroll; - required_shared_ptr m_spriteram; - optional_device m_sprgen; - - /* devices */ - required_device m_maincpu; - required_device m_audiocpu; - required_device m_deco_tilegen; - required_shared_ptr m_decrypted_opcodes; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECO16IC_BANK_CB_MEMBER(bank_callback); - - uint16_t dietgo_protection_region_0_104_r(offs_t offset); - void dietgo_protection_region_0_104_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void decrypted_opcodes_map(address_map &map); - void dietgo_map(address_map &map); - void sound_map(address_map &map); -}; - -#endif // MAME_INCLUDES_DIETGO_H diff --git a/src/mame/video/dietgo.cpp b/src/mame/video/dietgo.cpp deleted file mode 100644 index 8223693a488..00000000000 --- a/src/mame/video/dietgo.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Bryan McPhail, David Haywood -#include "emu.h" -#include "includes/dietgo.h" - -uint32_t dietgo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - uint16_t flip = m_deco_tilegen->pf_control_r(0); - - flip_screen_set(BIT(flip, 7)); - m_sprgen->set_flip_screen(BIT(flip, 7)); - m_deco_tilegen->pf_update(m_pf_rowscroll[0], m_pf_rowscroll[1]); - - bitmap.fill(256, cliprect); /* not verified */ - - m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); - m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); - - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); - return 0; -}