From 38854e7d8086e5d5e7b8d7ea00ec3c72c7b42c72 Mon Sep 17 00:00:00 2001 From: cam900 Date: Fri, 16 Feb 2018 21:29:10 +0900 Subject: =?UTF-8?q?deco32=20:=20Cleanup=20duplicates,=20Remove=20unneeded?= =?UTF-8?q?=20shared=5Fptr,=20Add=20notes,=20Con=E2=80=A6=20(#3216)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deco32 : Cleanup duplicates, Remove unneed shared_ptr, Add notes, Convert m_spriteram16*/m_spriteram16_buffered*/m_pf_rowscroll* to std::unique_ptr, Rowscroll RAM size allocated to memory mapped size lockload : Improve OKI Bankswitching, Add notes Demote Dragon Gun with MACHINE_IMPERFECT_SOUND, because OKI3 bankswitching aren't verified * deco32 : Minor fix * deco32 : More cleanups * deco32 : Move m_oki2_bank to dragngun_state * deco32 : Fix IOPORT Tags to captaven * Fix deco32.cpp ioport tags when "DSW" aren't actually dip switch --- src/mame/drivers/deco32.cpp | 355 ++++++++++++++++++++++++-------------------- src/mame/includes/deco32.h | 95 +++++------- src/mame/video/deco32.cpp | 186 +++++++++++------------ 3 files changed, 318 insertions(+), 318 deletions(-) diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp index 8b02a1fcb8c..e5a9be0f310 100644 --- a/src/mame/drivers/deco32.cpp +++ b/src/mame/drivers/deco32.cpp @@ -7,7 +7,7 @@ Captain America Dragon Gun Fighter's History - Locked 'N Loaded + Locked 'n Loaded Night Slashers Tattoo Assassins @@ -24,7 +24,7 @@ Captain America - Reset with Player 1 start held Fighter's History - Reset with Player 1 button 1 & 2 held Night Slashers - Reset with Player 1 & 2 start held - Locked 'N Loaded - Reset with Player 1 & 2 start held + Locked 'n Loaded - Reset with Player 1 & 2 start held Tattoo Assassins is a prototype, it is thought only 25 test units were manufactured and distributed to test arcades before the game @@ -41,10 +41,12 @@ Video backgrounds(intel DVI) in Dragongun? - Locked'N Loaded (parent set) is a slightly different hardware + Locked 'n Loaded (parent set) is a slightly different hardware revision: board # DE-0420-1 where the US set is DE-0359-2. The sound is _not_ hooked up correctly for this set. + Z80 Sound cpu version games : Music tempo is unverified (it has external timer / IRQ controller?). + Locked 'n Loaded (US) @@ -365,7 +367,6 @@ NOTE: There are several unpopulated locations (denoted by *) for additional rom #include "emu.h" #include "includes/deco32.h" -#include "cpu/z80/z80.h" #include "cpu/arm/arm.h" #include "cpu/h6280/h6280.h" #include "cpu/m6809/m6809.h" @@ -375,6 +376,8 @@ NOTE: There are several unpopulated locations (denoted by *) for additional rom #include "machine/input_merger.h" #include "speaker.h" +#include + //************************************************************************** // ADDRESS MAPS @@ -383,10 +386,10 @@ NOTE: There are several unpopulated locations (denoted by *) for additional rom ADDRESS_MAP_START(captaven_state::captaven_map) AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_RANGE(0x100000, 0x100007) AM_READ(_71_r) - AM_RANGE(0x100000, 0x100003) AM_WRITE(buffer_spriteram_w) + AM_RANGE(0x100000, 0x100003) AM_WRITE(buffer_spriteram_w<0>) AM_RANGE(0x108000, 0x108003) AM_WRITENOP /* ? */ - AM_RANGE(0x110000, 0x111fff) AM_READWRITE(spriteram_r, spriteram_w) - AM_RANGE(0x120000, 0x127fff) AM_RAM AM_SHARE("ram") /* Main RAM */ + AM_RANGE(0x110000, 0x111fff) AM_READWRITE(spriteram_r<0>, spriteram_w<0>) + AM_RANGE(0x120000, 0x127fff) AM_RAM /* Main RAM */ AM_RANGE(0x128000, 0x12ffff) AM_READWRITE16(ioprot_r, ioprot_w, 0x0000ffff) AM_RANGE(0x130000, 0x131fff) AM_RAM_DEVWRITE("palette", palette_device, write32) AM_SHARE("palette") AM_RANGE(0x148000, 0x14800f) AM_DEVICE8("irq", deco_irq_device, map, 0x000000ff) @@ -400,20 +403,20 @@ ADDRESS_MAP_START(captaven_state::captaven_map) AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x192000, 0x193fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) /* Mirror address - bug in program code */ AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") + AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") + AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused - AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused + AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") + AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") // unused ADDRESS_MAP_END ADDRESS_MAP_START(fghthist_state::fghthist_map) ADDRESS_MAP_UNMAP_HIGH // AM_RANGE(0x000000, 0x001fff) AM_ROM AM_WRITE(pf1_data_w) // wtf?? AM_RANGE(0x000000, 0x0fffff) AM_ROM - AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_SHARE("ram") + AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_RANGE(0x120020, 0x120023) AM_READ16(fghthist_in0_r, 0x0000ffff) AM_RANGE(0x120024, 0x120027) AM_READ16(fghthist_in1_r, 0x0000ffff) AM_RANGE(0x120028, 0x12002b) AM_READ8(eeprom_r, 0x000000ff) @@ -424,18 +427,18 @@ ADDRESS_MAP_START(fghthist_state::fghthist_map) AM_RANGE(0x168000, 0x169fff) AM_RAM_WRITE(buffered_palette_w) AM_SHARE("paletteram") AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(palette_dma_w) AM_RANGE(0x16c010, 0x16c013) AM_READ(unk_status_r) - AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram_r, spriteram_w) - AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram_w) + AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram_r<0>, spriteram_w<0>) + AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram_w<0>) AM_RANGE(0x17c020, 0x17c023) AM_READ(unk_status_r) AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") + AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") + AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") + AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") + AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) AM_RANGE(0x200000, 0x207fff) AM_READWRITE16(ioprot_r, ioprot_w, 0xffff0000) AM_SHARE("prot32ram") // only maps on 16-bits AM_RANGE(0x208800, 0x208803) AM_WRITENOP /* ? */ @@ -443,25 +446,25 @@ ADDRESS_MAP_END ADDRESS_MAP_START(fghthist_state::fghthsta_memmap) AM_RANGE(0x000000, 0x0fffff) AM_ROM - AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_SHARE("ram") + AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_RANGE(0x140000, 0x140003) AM_WRITE(vblank_ack_w) AM_RANGE(0x150000, 0x150003) AM_WRITE8(eeprom_w, 0x000000ff) AM_RANGE(0x150000, 0x150003) AM_WRITE8(volume_w, 0x0000ff00) AM_RANGE(0x168000, 0x169fff) AM_RAM_WRITE(buffered_palette_w) AM_SHARE("paletteram") AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(palette_dma_w) AM_RANGE(0x16c010, 0x16c013) AM_READ(unk_status_r) - AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram_r, spriteram_w) - AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram_w) + AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram_r<0>, spriteram_w<0>) + AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram_w<0>) AM_RANGE(0x17c020, 0x17c023) AM_READ(unk_status_r) AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") + AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") + AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") + AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") + AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) AM_RANGE(0x200000, 0x207fff) AM_READWRITE16(ioprot_r, ioprot_w, 0xffff0000) AM_SHARE("prot32ram") // only maps on 16-bits ADDRESS_MAP_END @@ -470,7 +473,7 @@ ADDRESS_MAP_END // raster effects appear to need some work on it anyway? ADDRESS_MAP_START(dragngun_state::dragngun_map) AM_RANGE(0x0000000, 0x00fffff) AM_ROM - AM_RANGE(0x0100000, 0x011ffff) AM_RAM AM_SHARE("ram") + AM_RANGE(0x0100000, 0x011ffff) AM_RAM AM_RANGE(0x0120000, 0x0127fff) AM_READWRITE16(ioprot_r, ioprot_w, 0x0000ffff) // AM_RANGE(0x01204c0, 0x01204c3) AM_WRITE(sound_w) AM_RANGE(0x0128000, 0x012800f) AM_DEVICE8("irq", deco_irq_device, map, 0x000000ff) @@ -484,13 +487,13 @@ ADDRESS_MAP_START(dragngun_state::dragngun_map) AM_RANGE(0x0180000, 0x018001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) AM_RANGE(0x0190000, 0x0191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x0194000, 0x0195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x01a0000, 0x01a3fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x01a4000, 0x01a5fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") + AM_RANGE(0x01a0000, 0x01a3fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") + AM_RANGE(0x01a4000, 0x01a5fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") AM_RANGE(0x01c0000, 0x01c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) AM_RANGE(0x01d0000, 0x01d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x01d4000, 0x01d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused - AM_RANGE(0x01e0000, 0x01e3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x01e4000, 0x01e5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused + AM_RANGE(0x01e0000, 0x01e3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") + AM_RANGE(0x01e4000, 0x01e5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") // unused AM_RANGE(0x0204800, 0x0204fff) AM_RAM // ace? 0x10 byte increments only // 13f ff stuff AM_RANGE(0x0208000, 0x0208fff) AM_RAM AM_SHARE("lay0") AM_RANGE(0x020c000, 0x020cfff) AM_RAM AM_SHARE("lay1") @@ -522,7 +525,7 @@ ADDRESS_MAP_END ADDRESS_MAP_START(dragngun_state::lockload_map) AM_RANGE(0x000000, 0x0fffff) AM_ROM - AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_SHARE("ram") + AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_RANGE(0x120000, 0x127fff) AM_READWRITE16(ioprot_r, ioprot_w, 0x0000ffff) AM_RANGE(0x128000, 0x12800f) AM_DEVICE8("irq", deco_irq_device, map, 0x000000ff) AM_RANGE(0x130000, 0x131fff) AM_RAM_WRITE(buffered_palette_w) AM_SHARE("paletteram") @@ -533,13 +536,13 @@ ADDRESS_MAP_START(dragngun_state::lockload_map) AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") + AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") + AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused - AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused + AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") + AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") // unused AM_RANGE(0x204800, 0x204fff) AM_RAM //0x10 byte increments only AM_RANGE(0x208000, 0x208fff) AM_RAM AM_SHARE("lay0") AM_RANGE(0x20c000, 0x20cfff) AM_RAM AM_SHARE("lay1") @@ -558,7 +561,7 @@ ADDRESS_MAP_END ADDRESS_MAP_START(nslasher_state::tattass_map) AM_RANGE(0x000000, 0x0f7fff) AM_ROM AM_RANGE(0x0f8000, 0x0fffff) AM_ROM AM_WRITENOP - AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_SHARE("ram") + AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_RANGE(0x120000, 0x120003) AM_NOP /* ACIA (unused) */ AM_RANGE(0x130000, 0x130003) AM_WRITENOP /* Coin port (unused?) */ AM_RANGE(0x140000, 0x140003) AM_WRITE(vblank_ack_w) @@ -572,23 +575,23 @@ ADDRESS_MAP_START(nslasher_state::tattass_map) AM_RANGE(0x168000, 0x169fff) AM_DEVREADWRITE("deco_ace", deco_ace_device, buffered_palette_r, buffered_palette_w) AM_RANGE(0x16c000, 0x16c003) AM_WRITENOP AM_RANGE(0x16c008, 0x16c00b) AM_DEVWRITE16("deco_ace", deco_ace_device, palette_dma_w, 0xffffffff) - AM_RANGE(0x170000, 0x171fff) AM_READWRITE(spriteram_r, spriteram_w) + AM_RANGE(0x170000, 0x171fff) AM_READWRITE(spriteram_r<0>, spriteram_w<0>) AM_RANGE(0x174000, 0x174003) AM_WRITENOP /* Sprite DMA mode (2) */ - AM_RANGE(0x174010, 0x174013) AM_WRITE(buffer_spriteram_w) + AM_RANGE(0x174010, 0x174013) AM_WRITE(buffer_spriteram_w<0>) AM_RANGE(0x174018, 0x17401b) AM_WRITENOP /* Sprite 'CPU' (unused) */ - AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram2_r, spriteram2_w) + AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram_r<1>, spriteram_w<1>) AM_RANGE(0x17c000, 0x17c003) AM_WRITENOP /* Sprite DMA mode (2) */ - AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram2_w) + AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram_w<1>) AM_RANGE(0x17c018, 0x17c01b) AM_WRITENOP /* Sprite 'CPU' (unused) */ AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") + AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") + AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") + AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") + AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) AM_RANGE(0x200000, 0x207fff) AM_READWRITE16(ioprot_r, ioprot_w, 0xffff0000) AM_RANGE(0x200000, 0x207fff) AM_READ16(nslasher_debug_r, 0x0000ffff) @@ -596,7 +599,7 @@ ADDRESS_MAP_END ADDRESS_MAP_START(nslasher_state::nslasher_map) AM_RANGE(0x000000, 0x0fffff) AM_ROM - AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_SHARE("ram") + AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_RANGE(0x120000, 0x1200ff) AM_NOP /* ACIA (unused) */ AM_RANGE(0x140000, 0x140003) AM_WRITE(vblank_ack_w) AM_RANGE(0x150000, 0x150003) AM_WRITE8(eeprom_w, 0x000000ff) @@ -609,23 +612,23 @@ ADDRESS_MAP_START(nslasher_state::nslasher_map) AM_RANGE(0x168000, 0x169fff) AM_DEVREADWRITE("deco_ace", deco_ace_device, buffered_palette_r, buffered_palette_w) AM_RANGE(0x16c000, 0x16c003) AM_WRITENOP AM_RANGE(0x16c008, 0x16c00b) AM_DEVWRITE16("deco_ace", deco_ace_device, palette_dma_w, 0xffffffff) - AM_RANGE(0x170000, 0x171fff) AM_READWRITE(spriteram_r, spriteram_w) + AM_RANGE(0x170000, 0x171fff) AM_READWRITE(spriteram_r<0>, spriteram_w<0>) AM_RANGE(0x174000, 0x174003) AM_WRITENOP /* Sprite DMA mode (2) */ - AM_RANGE(0x174010, 0x174013) AM_WRITE(buffer_spriteram_w) + AM_RANGE(0x174010, 0x174013) AM_WRITE(buffer_spriteram_w<0>) AM_RANGE(0x174018, 0x17401b) AM_WRITENOP /* Sprite 'CPU' (unused) */ - AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram2_r, spriteram2_w) + AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram_r<1>, spriteram_w<1>) AM_RANGE(0x17c000, 0x17c003) AM_WRITENOP /* Sprite DMA mode (2) */ - AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram2_w) + AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram_w<1>) AM_RANGE(0x17c018, 0x17c01b) AM_WRITENOP /* Sprite 'CPU' (unused) */ AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") - AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") + AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf_rowscroll_w<0>) AM_SHARE("pf1_rowscroll32") + AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf_rowscroll_w<1>) AM_SHARE("pf2_rowscroll32") AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) - AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") - AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") + AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf_rowscroll_w<2>) AM_SHARE("pf3_rowscroll32") + AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf_rowscroll_w<3>) AM_SHARE("pf4_rowscroll32") AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) AM_RANGE(0x200000, 0x207fff) AM_READWRITE16(ioprot_r, ioprot_w, 0xffff0000) AM_RANGE(0x200000, 0x207fff) AM_READ16(nslasher_debug_r, 0x0000ffff) // seems to be debug switches / code activated by this? @@ -638,7 +641,7 @@ ADDRESS_MAP_START(deco32_state::h6280_sound_map) AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_device, read, write) AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_device, read, write) AM_RANGE(0x140000, 0x140000) AM_DEVREAD("ioprot", deco_146_base_device, soundlatch_r) - AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") + AM_RANGE(0x1f0000, 0x1f1fff) AM_RAM AM_RANGE(0x1fec00, 0x1fec01) AM_DEVWRITE("audiocpu", h6280_device, timer_w) AM_RANGE(0x1ff400, 0x1ff403) AM_DEVWRITE("audiocpu", h6280_device, irq_status_w) ADDRESS_MAP_END @@ -649,7 +652,7 @@ ADDRESS_MAP_START(deco32_state::h6280_sound_custom_latch_map) ADDRESS_MAP_END // Z80 based sound -ADDRESS_MAP_START(deco32_state::z80_sound_mem) +ADDRESS_MAP_START(deco32_state::z80_sound_map) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0x87ff) AM_RAM AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) @@ -662,6 +665,17 @@ ADDRESS_MAP_START(deco32_state::z80_sound_io) AM_RANGE(0x0000, 0xffff) AM_ROM AM_REGION("audiocpu", 0) ADDRESS_MAP_END +// lockload needs hi bits of OKI2 bankswitching +ADDRESS_MAP_START(dragngun_state::lockload_sound_map) + AM_IMPORT_FROM(z80_sound_map) + AM_RANGE(0xe000, 0xe000) AM_WRITE(lockload_okibank_w) +ADDRESS_MAP_END + +ADDRESS_MAP_START(dragngun_state::lockloadu_sound_map) + AM_IMPORT_FROM(h6280_sound_map) + AM_RANGE(0x150000, 0x150000) AM_WRITE(lockload_okibank_w) +ADDRESS_MAP_END + //************************************************************************** // PROTECTION @@ -697,8 +711,8 @@ WRITE8_MEMBER( deco32_state::volume_w ) float vol_output = ((float)raw_vol) / 255.0f; m_ym2151->set_output_gain(ALL_OUTPUTS, vol_output); - m_oki1->set_output_gain(ALL_OUTPUTS, vol_output); - m_oki2->set_output_gain(ALL_OUTPUTS, vol_output); + m_oki[0]->set_output_gain(ALL_OUTPUTS, vol_output); + m_oki[1]->set_output_gain(ALL_OUTPUTS, vol_output); } READ8_MEMBER( captaven_state::captaven_soundcpu_status_r ) @@ -715,9 +729,12 @@ WRITE32_MEMBER( dragngun_state::volume_w ) m_vol_main->clk_w(BIT(data, 1)); m_vol_main->di_w(BIT(data, 0)); - m_vol_gun->ce_w(BIT(data, 2)); - m_vol_gun->clk_w(BIT(data, 1)); - m_vol_gun->di_w(BIT(data, 0)); + if (m_vol_gun.found()) + { + m_vol_gun->ce_w(BIT(data, 2)); + m_vol_gun->clk_w(BIT(data, 1)); + m_vol_gun->di_w(BIT(data, 0)); + } } WRITE32_MEMBER( dragngun_state::speaker_switch_w ) @@ -739,19 +756,19 @@ LC7535_VOLUME_CHANGED( dragngun_state::volume_main_changed ) m_ym2151->set_output_gain(0, gain_l); m_ym2151->set_output_gain(1, gain_r); // left and right are always set to the same value - m_oki1->set_output_gain(ALL_OUTPUTS, gain_l); - m_oki2->set_output_gain(ALL_OUTPUTS, gain_l); + m_oki[0]->set_output_gain(ALL_OUTPUTS, gain_l); + m_oki[1]->set_output_gain(ALL_OUTPUTS, gain_l); - if (m_oki3.found() && m_gun_speaker_disabled) - m_oki3->set_output_gain(ALL_OUTPUTS, gain_l); + if (m_oki[2].found() && m_gun_speaker_disabled) + m_oki[2]->set_output_gain(ALL_OUTPUTS, gain_l); } LC7535_VOLUME_CHANGED( dragngun_state::volume_gun_changed ) { logerror("Gun speaker volume: left = %d dB, right %d dB, loudness = %s\n", attenuation_left, attenuation_right, loudness ? "on" :"off"); - if (m_oki3.found() && !m_gun_speaker_disabled) - m_oki3->set_output_gain(ALL_OUTPUTS, m_vol_gun->normalize(attenuation_left)); + if (m_oki[2].found() && !m_gun_speaker_disabled) + m_oki[2]->set_output_gain(ALL_OUTPUTS, m_vol_gun->normalize(attenuation_left)); } WRITE_LINE_MEMBER( nslasher_state::tattass_sound_irq_w ) @@ -767,8 +784,22 @@ WRITE_LINE_MEMBER( nslasher_state::tattass_sound_irq_w ) WRITE8_MEMBER( deco32_state::sound_bankswitch_w ) { - m_oki1->set_rom_bank((data >> 0) & 1); - m_oki2->set_rom_bank((data >> 1) & 1); + m_oki[0]->set_rom_bank((data >> 0) & 1); + m_oki[1]->set_rom_bank((data >> 1) & 1); +} + +WRITE8_MEMBER( dragngun_state::sound_bankswitch_w ) +{ + m_oki2_bank = (m_oki2_bank & 2) | ((data >> 1) & 1); + m_oki[0]->set_rom_bank((data >> 0) & 1); + m_oki[1]->set_rom_bank(m_oki2_bank); +} + +WRITE8_MEMBER( dragngun_state::lockload_okibank_w ) +{ + m_oki2_bank = (m_oki2_bank & 1) | ((data & 1) << 1); // TODO : Actually value unverified + logerror("Load OKI2 Bank Hi bits: %02x\n",data); + m_oki[1]->set_rom_bank(m_oki2_bank); } @@ -781,45 +812,28 @@ WRITE32_MEMBER( deco32_state::vblank_ack_w ) m_maincpu->set_input_line(ARM_IRQ_LINE, CLEAR_LINE); } +template READ32_MEMBER(deco32_state::spriteram_r) { - return m_spriteram16[offset] ^ 0xffff0000; -} - -WRITE32_MEMBER( deco32_state::spriteram_w ) -{ - data &= 0x0000ffff; - mem_mask &= 0x0000ffff; - COMBINE_DATA(&m_spriteram16[offset]); -} - -WRITE32_MEMBER( deco32_state::buffer_spriteram_w ) -{ - memcpy(m_spriteram16_buffered, m_spriteram16, 0x1000); -} - -READ32_MEMBER( nslasher_state::spriteram2_r ) -{ - return m_spriteram16_2[offset] ^ 0xffff0000; + return m_spriteram16[Chip][offset] ^ 0xffff0000; } -WRITE32_MEMBER( nslasher_state::spriteram2_w ) +template +WRITE32_MEMBER(deco32_state::spriteram_w) { data &= 0x0000ffff; mem_mask &= 0x0000ffff; - COMBINE_DATA(&m_spriteram16_2[offset]); + COMBINE_DATA(&m_spriteram16[Chip][offset]); } -WRITE32_MEMBER( nslasher_state::buffer_spriteram2_w ) +template +WRITE32_MEMBER(deco32_state::buffer_spriteram_w) { - memcpy(m_spriteram16_2_buffered, m_spriteram16_2, 0x1000); + std::copy(&m_spriteram16[Chip][0], &m_spriteram16[Chip][0x2000/4], &m_spriteram16_buffered[Chip][0]); } // tattass tests these as 32-bit ram, even if only 16-bits are hooked up to the tilemap chip - does it mirror parts of the dword? -WRITE32_MEMBER( deco32_state::pf1_rowscroll_w ) { COMBINE_DATA(&m_pf1_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&m_pf1_rowscroll[offset]); } -WRITE32_MEMBER( deco32_state::pf2_rowscroll_w ) { COMBINE_DATA(&m_pf2_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&m_pf2_rowscroll[offset]); } -WRITE32_MEMBER( deco32_state::pf3_rowscroll_w ) { COMBINE_DATA(&m_pf3_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&m_pf3_rowscroll[offset]); } -WRITE32_MEMBER( deco32_state::pf4_rowscroll_w ) { COMBINE_DATA(&m_pf4_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&m_pf4_rowscroll[offset]); } +template WRITE32_MEMBER( deco32_state::pf_rowscroll_w ) { COMBINE_DATA(&m_pf_rowscroll32[TileMap][offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&m_pf_rowscroll[TileMap][offset]); } READ32_MEMBER( dragngun_state::unk_video_r) { @@ -1157,8 +1171,8 @@ void dragngun_state::dragngun_init_common() deco74_decrypt_gfx(machine(), "gfx2"); deco74_decrypt_gfx(machine(), "gfx3"); - memcpy(DST_RAM+0x80000,SRC_RAM,0x10000); - memcpy(DST_RAM+0x110000,SRC_RAM+0x10000,0x10000); + std::copy(&SRC_RAM[0x00000], &SRC_RAM[0x10000], &DST_RAM[0x080000]); + std::copy(&SRC_RAM[0x10000], &SRC_RAM[0x20000], &DST_RAM[0x110000]); #if 0 { @@ -1210,19 +1224,17 @@ DRIVER_INIT_MEMBER( fghthist_state, fghthist ) DRIVER_INIT_MEMBER( dragngun_state, lockload ) { - uint8_t *RAM = memregion("maincpu")->base(); // uint32_t *ROM = (uint32_t *)memregion("maincpu")->base(); deco74_decrypt_gfx(machine(), "gfx1"); deco74_decrypt_gfx(machine(), "gfx2"); deco74_decrypt_gfx(machine(), "gfx3"); - memcpy(RAM+0x300000,RAM+0x100000,0x100000); - memset(RAM+0x100000,0,0x100000); - // ROM[0x3fe3c0/4]=0xe1a00000;// NOP test switch lock // ROM[0x3fe3cc/4]=0xe1a00000;// NOP test switch lock // ROM[0x3fe40c/4]=0xe1a00000;// NOP test switch lock + + save_item(NAME(m_oki2_bank)); } DRIVER_INIT_MEMBER( nslasher_state, tattass ) @@ -1231,14 +1243,14 @@ DRIVER_INIT_MEMBER( nslasher_state, tattass ) std::vector tmp(0x80000); /* Reorder bitplanes to make decoding easier */ - memcpy(&tmp[0],RAM+0x80000,0x80000); - memcpy(RAM+0x80000,RAM+0x100000,0x80000); - memcpy(RAM+0x100000,&tmp[0],0x80000); + std::copy(&RAM[0x080000], &RAM[0x100000], tmp.begin()); + std::copy(&RAM[0x100000], &RAM[0x180000], &RAM[0x080000]); + std::copy(tmp.begin(), tmp.end(), &RAM[0x100000]); RAM = memregion("gfx2")->base(); - memcpy(&tmp[0],RAM+0x80000,0x80000); - memcpy(RAM+0x80000,RAM+0x100000,0x80000); - memcpy(RAM+0x100000,&tmp[0],0x80000); + std::copy(&RAM[0x080000], &RAM[0x100000], tmp.begin()); + std::copy(&RAM[0x100000], &RAM[0x180000], &RAM[0x080000]); + std::copy(tmp.begin(), tmp.end(), &RAM[0x100000]); deco56_decrypt_gfx(machine(), "gfx1"); /* 141 */ deco56_decrypt_gfx(machine(), "gfx2"); /* 141 */ @@ -1258,14 +1270,14 @@ DRIVER_INIT_MEMBER( nslasher_state, nslasher ) std::vector tmp(0x80000); /* Reorder bitplanes to make decoding easier */ - memcpy(&tmp[0],RAM+0x80000,0x80000); - memcpy(RAM+0x80000,RAM+0x100000,0x80000); - memcpy(RAM+0x100000,&tmp[0],0x80000); + std::copy(&RAM[0x080000], &RAM[0x100000], tmp.begin()); + std::copy(&RAM[0x100000], &RAM[0x180000], &RAM[0x080000]); + std::copy(tmp.begin(), tmp.end(), &RAM[0x100000]); RAM = memregion("gfx2")->base(); - memcpy(&tmp[0],RAM+0x80000,0x80000); - memcpy(RAM+0x80000,RAM+0x100000,0x80000); - memcpy(RAM+0x100000,&tmp[0],0x80000); + std::copy(&RAM[0x080000], &RAM[0x100000], tmp.begin()); + std::copy(&RAM[0x100000], &RAM[0x180000], &RAM[0x080000]); + std::copy(tmp.begin(), tmp.end(), &RAM[0x100000]); deco56_decrypt_gfx(machine(), "gfx1"); /* 141 */ deco74_decrypt_gfx(machine(), "gfx2"); @@ -1327,7 +1339,7 @@ COIN1n adds 100 energy points (based on "Coinage") for player n when ingame if e */ static INPUT_PORTS_START( captaven ) - PORT_START("INPUTS") + PORT_START("IN0") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY @@ -1345,7 +1357,7 @@ static INPUT_PORTS_START( captaven ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 ) - PORT_START("DSW") // not dsw but the prot code expects dsw + PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_8WAY PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_8WAY PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_8WAY @@ -1624,7 +1636,7 @@ static INPUT_PORTS_START( lockload ) INPUT_PORTS_END static INPUT_PORTS_START( tattass ) - PORT_START("INPUTS") + PORT_START("IN0") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY @@ -1642,7 +1654,7 @@ static INPUT_PORTS_START( tattass ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 ) - PORT_START("DSW") + PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) @@ -1662,7 +1674,7 @@ static INPUT_PORTS_START( tattass ) INPUT_PORTS_END static INPUT_PORTS_START( nslasher ) - PORT_START("INPUTS") + PORT_START("IN0") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY @@ -1680,7 +1692,7 @@ static INPUT_PORTS_START( nslasher ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 ) - PORT_START("DSW") + PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) @@ -1905,15 +1917,15 @@ MACHINE_CONFIG_START(captaven_state::captaven) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) + MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_PRIORITY_CB(captaven_state, captaven_pri_callback) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") MCFG_DECO146_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) + MCFG_DECO146_IN_PORTA_CB(IOPORT("IN0")) MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) + MCFG_DECO146_IN_PORTC_CB(IOPORT("IN1")) MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0)) MCFG_VIDEO_START_OVERRIDE(captaven_state, captaven) @@ -1986,7 +1998,7 @@ MACHINE_CONFIG_START(fghthist_state::fghthist) MCFG_DECO16IC_PF12_16X16_BANK(2) MCFG_DECO16IC_GFXDECODE("gfxdecode") - MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0) + MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) MCFG_DECO_SPRITE_GFX_REGION(3) MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") @@ -2041,7 +2053,7 @@ MACHINE_CONFIG_START(fghthist_state::fghthistu) MCFG_DEVICE_REMOVE("audiocpu") MCFG_CPU_ADD("audiocpu", Z80, XTAL(32'220'000) / 9) - MCFG_CPU_PROGRAM_MAP(z80_sound_mem) + MCFG_CPU_PROGRAM_MAP(z80_sound_map) MCFG_CPU_IO_MAP(z80_sound_io) MCFG_INPUT_MERGER_ANY_HIGH("sound_irq_merger") @@ -2057,6 +2069,7 @@ MACHINE_CONFIG_START(fghthist_state::fghthistu) MCFG_SOUND_ROUTE(1, "rspeaker", 0.40) MACHINE_CONFIG_END +// DE-0359-2 + Bottom board DE-0360-4 MACHINE_CONFIG_START(dragngun_state::dragngun) /* basic machine hardware */ @@ -2166,6 +2179,9 @@ MACHINE_CONFIG_START(dragngun_state::lockloadu) MCFG_CPU_MODIFY("maincpu") MCFG_CPU_PROGRAM_MAP(lockloadu_map) + MCFG_CPU_MODIFY("audiocpu") + MCFG_CPU_PROGRAM_MAP(lockloadu_sound_map) + MCFG_DEVICE_MODIFY("irq") MCFG_DECO_IRQ_LIGHTGUN_IRQ_CB(DEVWRITELINE("irq_merger", input_merger_any_high_device, in_w<2>)) @@ -2174,6 +2190,7 @@ MACHINE_CONFIG_START(dragngun_state::lockloadu) MCFG_DECO16IC_PF2_SIZE(DECO_32x32) // lockload definitely wants pf34 half width.. MACHINE_CONFIG_END +// DE-0420-1 + Bottom board DE-0421-0 MACHINE_CONFIG_START(dragngun_state::lockload) /* basic machine hardware */ @@ -2184,7 +2201,7 @@ MACHINE_CONFIG_START(dragngun_state::lockload) MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", ARM_IRQ_LINE)) MCFG_CPU_ADD("audiocpu", Z80, 32220000/8) - MCFG_CPU_PROGRAM_MAP(z80_sound_mem) + MCFG_CPU_PROGRAM_MAP(lockload_sound_map) MCFG_CPU_IO_MAP(z80_sound_io) MCFG_INPUT_MERGER_ANY_HIGH("sound_irq_merger") @@ -2211,7 +2228,7 @@ MACHINE_CONFIG_START(dragngun_state::lockload) MCFG_GFXDECODE_ADD("gfxdecode", "palette", dragngun) MCFG_PALETTE_ADD("palette", 2048) - MCFG_VIDEO_START_OVERRIDE(dragngun_state, lockload) + MCFG_VIDEO_START_OVERRIDE(dragngun_state, dragngun) MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) MCFG_DECO16IC_SPLIT(0) @@ -2275,10 +2292,6 @@ MACHINE_CONFIG_START(dragngun_state::lockload) MCFG_LC7535_ADD("vol_main") MCFG_LC7535_SELECT_CB(VCC) MCFG_LC7535_VOLUME_CB(dragngun_state, volume_main_changed) - - MCFG_LC7535_ADD("vol_gun") - MCFG_LC7535_SELECT_CB(GND) - MCFG_LC7535_VOLUME_CB(dragngun_state, volume_gun_changed) MACHINE_CONFIG_END MACHINE_CONFIG_START(nslasher_state::tattass) @@ -2341,9 +2354,9 @@ MACHINE_CONFIG_START(nslasher_state::tattass) MCFG_PALETTE_ADD("palette", 2048) MCFG_DECO104_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) + MCFG_DECO146_IN_PORTA_CB(IOPORT("IN0")) MCFG_DECO146_IN_PORTB_CB(READ16(nslasher_state, port_b_tattass)) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) + MCFG_DECO146_IN_PORTC_CB(IOPORT("IN1")) MCFG_DECO146_SOUNDLATCH_IRQ_CB(WRITELINE(nslasher_state, tattass_sound_irq_w)) MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE @@ -2361,7 +2374,7 @@ MACHINE_CONFIG_START(nslasher_state::nslasher) MCFG_CPU_VBLANK_INT_DRIVER("screen", deco32_state, irq0_line_assert) MCFG_CPU_ADD("audiocpu", Z80, 32220000/9) - MCFG_CPU_PROGRAM_MAP(z80_sound_mem) + MCFG_CPU_PROGRAM_MAP(z80_sound_map) MCFG_CPU_IO_MAP(z80_sound_io) MCFG_INPUT_MERGER_ANY_HIGH("sound_irq_merger") @@ -2424,9 +2437,9 @@ MACHINE_CONFIG_START(nslasher_state::nslasher) MCFG_VIDEO_START_OVERRIDE(nslasher_state, nslasher) MCFG_DECO104_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) + MCFG_DECO146_IN_PORTA_CB(IOPORT("IN0")) MCFG_DECO146_IN_PORTB_CB(DEVREADLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(0) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) + MCFG_DECO146_IN_PORTC_CB(IOPORT("IN1")) MCFG_DECO146_SOUNDLATCH_IRQ_CB(DEVWRITELINE("sound_irq_merger", input_merger_any_high_device, in_w<0>)) MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE @@ -2459,9 +2472,9 @@ MACHINE_CONFIG_START(nslasher_state::nslasheru) MCFG_DEVICE_REMOVE("ioprot") MCFG_DECO104_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) + MCFG_DECO146_IN_PORTA_CB(IOPORT("IN0")) MCFG_DECO146_IN_PORTB_CB(DEVREADLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(0) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) + MCFG_DECO146_IN_PORTC_CB(IOPORT("IN1")) MCFG_DECO146_SOUNDLATCH_IRQ_CB(INPUTLINE("audiocpu", 0)) MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE MACHINE_CONFIG_END @@ -2890,8 +2903,8 @@ ROM_START( dragngun ) ROM_LOAD16_BYTE( "kb09.a17", 0x00001, 0x10000, CRC(e9dcac3f) SHA1(0621e601ffae73bbf69623042c9c8ab0526c3de6) ) ROM_REGION( 0x120000, "gfx2", 0 ) - ROM_LOAD( "mar-00.bin", 0x00000, 0x80000, CRC(d0491a37) SHA1(cc0ae1e9e5f42ba30159fb79bccd2e237cd037d0) ) /* Encrypted tiles */ - ROM_LOAD( "mar-01.bin", 0x90000, 0x80000, CRC(d5970365) SHA1(729baf1efbef15c9f3e1d700717f5ba4f10d3014) ) + ROM_LOAD( "mar-00.bin", 0x000000, 0x80000, CRC(d0491a37) SHA1(cc0ae1e9e5f42ba30159fb79bccd2e237cd037d0) ) /* Encrypted tiles */ + ROM_LOAD( "mar-01.bin", 0x090000, 0x80000, CRC(d5970365) SHA1(729baf1efbef15c9f3e1d700717f5ba4f10d3014) ) ROM_REGION( 0x400000, "gfx3", 0 ) ROM_LOAD( "mar-02.bin", 0x000000, 0x40000, CRC(c6cd4baf) SHA1(350286829a330b64f463d0a9cbbfdb71eecf5188) ) /* Encrypted tiles 0/4 */ @@ -2943,8 +2956,12 @@ ROM_START( dragngun ) ROM_REGION(0x80000, "oki2", 0 ) ROM_LOAD( "mar-08.n21", 0x000000, 0x80000, CRC(b9281dfd) SHA1(449faf5d36f3b970d0a9b483e2152a5f68604a77) ) + // TODO : Japan version uses first bank of oki3, US version uses second half. it has bankswitched dynamic? or address shuffle? ROM_REGION(0x80000, "oki3", 0 ) - ROM_LOAD( "mar-07.n19", 0x000000, 0x80000, CRC(40287d62) SHA1(c00cb08bcdae55bcddc14c38e88b0484b1bc9e3e) ) + // Remove this hack if oki3 bankswitching is verified + ROM_LOAD( "mar-07.n19", 0x40000, 0x40000, CRC(40287d62) SHA1(c00cb08bcdae55bcddc14c38e88b0484b1bc9e3e) ) + ROM_CONTINUE( 0x00000, 0x40000 ) + //ROM_LOAD( "mar-07.n19", 0x000000, 0x80000, CRC(40287d62) SHA1(c00cb08bcdae55bcddc14c38e88b0484b1bc9e3e) ) ROM_END ROM_START( dragngunj ) @@ -2964,10 +2981,10 @@ ROM_START( dragngunj ) ROM_REGION( 0x020000, "gfx1", 0 ) ROM_LOAD16_BYTE( "ka-08.a15", 0x00000, 0x10000, CRC(8fe4e5f5) SHA1(922b94f8ce0c35e965259c11e95891ef4be913d4) ) /* Encrypted tiles */ ROM_LOAD16_BYTE( "ka-09.a17", 0x00001, 0x10000, CRC(e9dcac3f) SHA1(0621e601ffae73bbf69623042c9c8ab0526c3de6) ) - + ROM_REGION( 0x120000, "gfx2", 0 ) - ROM_LOAD( "mar-00.bin", 0x00000, 0x80000, CRC(d0491a37) SHA1(cc0ae1e9e5f42ba30159fb79bccd2e237cd037d0) ) /* Encrypted tiles */ - ROM_LOAD( "mar-01.bin", 0x90000, 0x80000, CRC(d5970365) SHA1(729baf1efbef15c9f3e1d700717f5ba4f10d3014) ) + ROM_LOAD( "mar-00.bin", 0x000000, 0x80000, CRC(d0491a37) SHA1(cc0ae1e9e5f42ba30159fb79bccd2e237cd037d0) ) /* Encrypted tiles */ + ROM_LOAD( "mar-01.bin", 0x090000, 0x80000, CRC(d5970365) SHA1(729baf1efbef15c9f3e1d700717f5ba4f10d3014) ) ROM_REGION( 0x400000, "gfx3", 0 ) ROM_LOAD( "mar-02.bin", 0x000000, 0x40000, CRC(c6cd4baf) SHA1(350286829a330b64f463d0a9cbbfdb71eecf5188) ) /* Encrypted tiles 0/4 */ @@ -3372,10 +3389,14 @@ ROM_END ROM_START( lockload ) /* Board No. DE-0420-1 + Bottom board DE-0421-0 slightly different hardware, a unique PCB and not a Dragongun conversion */ ROM_REGION(0x400000, "maincpu", 0 ) /* ARM 32 bit code */ - ROM_LOAD32_BYTE( "nl-00-1.a6", 0x000002, 0x80000, CRC(7a39bf8d) SHA1(8b1a6407bab74b3960a243a6c04c0005a82126f1) ) - ROM_LOAD32_BYTE( "nl-01-1.a8", 0x000000, 0x80000, CRC(d23afcb7) SHA1(de7b5bc936a87cc6511d588b0bf082bbf745581c) ) - ROM_LOAD32_BYTE( "nl-02-1.d6", 0x000003, 0x80000, CRC(730e0168) SHA1(fdfa0d335c03c2c528326f90948e642f9ea43150) ) - ROM_LOAD32_BYTE( "nl-03-1.d8", 0x000001, 0x80000, CRC(51a53ece) SHA1(ee2c8858844a47fa1e83c30c06d78cf49219dc33) ) + ROM_LOAD32_BYTE( "nl-00-1.a6", 0x000002, 0x40000, CRC(7a39bf8d) SHA1(8b1a6407bab74b3960a243a6c04c0005a82126f1) ) + ROM_CONTINUE( 0x300002, 0x40000 ) + ROM_LOAD32_BYTE( "nl-01-1.a8", 0x000000, 0x40000, CRC(d23afcb7) SHA1(de7b5bc936a87cc6511d588b0bf082bbf745581c) ) + ROM_CONTINUE( 0x300000, 0x40000 ) + ROM_LOAD32_BYTE( "nl-02-1.d6", 0x000003, 0x40000, CRC(730e0168) SHA1(fdfa0d335c03c2c528326f90948e642f9ea43150) ) + ROM_CONTINUE( 0x300003, 0x40000 ) + ROM_LOAD32_BYTE( "nl-03-1.d8", 0x000001, 0x40000, CRC(51a53ece) SHA1(ee2c8858844a47fa1e83c30c06d78cf49219dc33) ) + ROM_CONTINUE( 0x300001, 0x40000 ) ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ ROM_LOAD( "nm-06-.p22", 0x00000, 0x10000, CRC(31d1c245) SHA1(326e35e7ebd8ea761d90e856c50d86512327f2a5) ) @@ -3432,8 +3453,6 @@ ROM_START( lockload ) /* Board No. DE-0420-1 + Bottom board DE-0421-0 slightly d ROM_LOAD32_BYTE( "mbm-14.a23", 0x000003, 0x100000, CRC(5aaaf929) SHA1(5ee30db9b83db664d77e6b5e0988ce3366460df6) ) ROM_LOAD32_BYTE( "mbm-15.a25", 0x400003, 0x100000, CRC(789ce7b1) SHA1(3fb390ce0620ce7a63f7f46eac1ff0eb8ed76d26) ) - ROM_REGION( 0x1000000, "dvi", ROMREGION_ERASE00 ) /* Video data - unique PCB and this region is not used? */ - ROM_REGION(0x80000, "oki1", 0 ) ROM_LOAD( "mbm-07.n19", 0x00000, 0x80000, CRC(414f3793) SHA1(ed5f63e57390d503193fd1e9f7294ae1da6d3539) ) @@ -3443,10 +3462,14 @@ ROM_END ROM_START( gunhard ) /* Board No. DE-0420-1 + Bottom board DE-0421-0 slightly different hardware, a unique PCB and not a Dragongun conversion */ ROM_REGION(0x400000, "maincpu", 0 ) /* ARM 32 bit code */ - ROM_LOAD32_BYTE( "nf-00-1.a6", 0x000002, 0x80000, CRC(2c8045d4) SHA1(4c900951d56bd22e30905969b8eb687d9b4363bd) ) - ROM_LOAD32_BYTE( "nf-01-1.a8", 0x000000, 0x80000, CRC(6f160117) SHA1(05738f61890e9d6d2b25330958c0e7369f2ff4a6) ) - ROM_LOAD32_BYTE( "nf-02-1.d6", 0x000003, 0x80000, CRC(bd353948) SHA1(ddcc12b3d1c8919eb7eb961d61f6286e6b37a58e) ) - ROM_LOAD32_BYTE( "nf-03-1.d8", 0x000001, 0x80000, CRC(118a9a72) SHA1(e0b2fd21f477e531d6a04256767874f13e031a48) ) + ROM_LOAD32_BYTE( "nf-00-1.a6", 0x000002, 0x40000, CRC(2c8045d4) SHA1(4c900951d56bd22e30905969b8eb687d9b4363bd) ) + ROM_CONTINUE( 0x300002, 0x40000 ) + ROM_LOAD32_BYTE( "nf-01-1.a8", 0x000000, 0x40000, CRC(6f160117) SHA1(05738f61890e9d6d2b25330958c0e7369f2ff4a6) ) + ROM_CONTINUE( 0x300000, 0x40000 ) + ROM_LOAD32_BYTE( "nf-02-1.d6", 0x000003, 0x40000, CRC(bd353948) SHA1(ddcc12b3d1c8919eb7eb961d61f6286e6b37a58e) ) + ROM_CONTINUE( 0x300003, 0x40000 ) + ROM_LOAD32_BYTE( "nf-03-1.d8", 0x000001, 0x40000, CRC(118a9a72) SHA1(e0b2fd21f477e531d6a04256767874f13e031a48) ) + ROM_CONTINUE( 0x300001, 0x40000 ) ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ ROM_LOAD( "nj-06-1.p22", 0x00000, 0x10000, CRC(31d1c245) SHA1(326e35e7ebd8ea761d90e856c50d86512327f2a5) ) @@ -3503,8 +3526,6 @@ ROM_START( gunhard ) /* Board No. DE-0420-1 + Bottom board DE-0421-0 slightly di ROM_LOAD32_BYTE( "mbm-14.a23", 0x000003, 0x100000, CRC(5aaaf929) SHA1(5ee30db9b83db664d77e6b5e0988ce3366460df6) ) ROM_LOAD32_BYTE( "mbm-15.a25", 0x400003, 0x100000, CRC(789ce7b1) SHA1(3fb390ce0620ce7a63f7f46eac1ff0eb8ed76d26) ) - ROM_REGION( 0x1000000, "dvi", ROMREGION_ERASE00 ) /* Video data - unique PCB and this region is not used? */ - ROM_REGION(0x80000, "oki1", 0 ) ROM_LOAD( "mbm-07.n19", 0x00000, 0x80000, CRC(414f3793) SHA1(ed5f63e57390d503193fd1e9f7294ae1da6d3539) ) @@ -3514,10 +3535,14 @@ ROM_END ROM_START( lockloadu ) /* Board No. DE-0359-2 + Bottom board DE-0360-4, a Dragongun conversion */ ROM_REGION(0x400000, "maincpu", 0 ) /* ARM 32 bit code */ - ROM_LOAD32_BYTE( "nh-00-0.b5", 0x000002, 0x80000, CRC(b8a57164) SHA1(b700a08db2ad1aa1bf0a32635ffbd5d3f08713ee) ) - ROM_LOAD32_BYTE( "nh-01-0.b8", 0x000000, 0x80000, CRC(e371ac50) SHA1(c448b54bc8962844b490994607b21b0c806d7714) ) - ROM_LOAD32_BYTE( "nh-02-0.d5", 0x000003, 0x80000, CRC(3e361e82) SHA1(b5445d44f2a775c141fdc561d5489234c39445a4) ) - ROM_LOAD32_BYTE( "nh-03-0.d8", 0x000001, 0x80000, CRC(d08ee9c3) SHA1(9a85710a11940df047e83e8d5977a23d6c67d665) ) + ROM_LOAD32_BYTE( "nh-00-0.b5", 0x000002, 0x40000, CRC(b8a57164) SHA1(b700a08db2ad1aa1bf0a32635ffbd5d3f08713ee) ) + ROM_CONTINUE( 0x300002, 0x40000 ) + ROM_LOAD32_BYTE( "nh-01-0.b8", 0x000000, 0x40000, CRC(e371ac50) SHA1(c448b54bc8962844b490994607b21b0c806d7714) ) + ROM_CONTINUE( 0x300000, 0x40000 ) + ROM_LOAD32_BYTE( "nh-02-0.d5", 0x000003, 0x40000, CRC(3e361e82) SHA1(b5445d44f2a775c141fdc561d5489234c39445a4) ) + ROM_CONTINUE( 0x300003, 0x40000 ) + ROM_LOAD32_BYTE( "nh-03-0.d8", 0x000001, 0x40000, CRC(d08ee9c3) SHA1(9a85710a11940df047e83e8d5977a23d6c67d665) ) + ROM_CONTINUE( 0x300001, 0x40000 ) ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ ROM_LOAD( "nh-06-0.n25", 0x00000, 0x10000, CRC(7a1af51d) SHA1(54e6b16d3f5b787d3c6eb7203d8854e6e0fb9803) ) @@ -3596,7 +3621,7 @@ ROM_START( lockloadu ) /* Board No. DE-0359-2 + Bottom board DE-0360-4, a Dragon ROM_LOAD( "mbm-06.n17", 0x00000, 0x100000, CRC(f34d5999) SHA1(265b5f4e8598bcf9183bf9bd95db69b01536acb2) ) ROM_REGION(0x80000, "oki3", ROMREGION_ERASE00 ) - ROM_LOAD( "mar-07.n19", 0x00000, 0x80000, CRC(40287d62) SHA1(c00cb08bcdae55bcddc14c38e88b0484b1bc9e3e) ) // same as dragngun, unused? +// ROM_LOAD( "mar-07.n19", 0x00000, 0x80000, CRC(40287d62) SHA1(c00cb08bcdae55bcddc14c38e88b0484b1bc9e3e) ) // same as dragngun, unused ROM_END ROM_START( tattass ) @@ -3606,7 +3631,7 @@ ROM_START( tattass ) ROM_REGION(0x10000, "soundcpu", 0 ) /* Sound CPU */ ROM_LOAD( "u7.snd", 0x00000, 0x10000, CRC(6947be8a) SHA1(4ac6c3c7f54501f23c434708cea6bf327bc8cf95) ) - + ROM_REGION( 0x200000, "gfx1", 0 ) ROM_LOAD16_BYTE( "abak_b01.s02", 0x000000, 0x80000, CRC(bc805680) SHA1(ccdbca23fc843ef82a3524020999542f43b3c618) ) ROM_LOAD16_BYTE( "abak_b01.s13", 0x000001, 0x80000, CRC(350effcd) SHA1(0452d95be9fc28bd00d846a2cc5828899d69601e) ) @@ -3679,7 +3704,7 @@ ROM_START( tattassa ) ROM_REGION(0x10000, "soundcpu", 0 ) /* Sound CPU */ ROM_LOAD( "u7.snd", 0x00000, 0x10000, CRC(6947be8a) SHA1(4ac6c3c7f54501f23c434708cea6bf327bc8cf95) ) - + ROM_REGION( 0x200000, "gfx1", 0 ) ROM_LOAD16_BYTE( "abak_b01.s02", 0x000000, 0x80000, CRC(bc805680) SHA1(ccdbca23fc843ef82a3524020999542f43b3c618) ) ROM_LOAD16_BYTE( "abak_b01.s13", 0x000001, 0x80000, CRC(350effcd) SHA1(0452d95be9fc28bd00d846a2cc5828899d69601e) ) @@ -3752,7 +3777,7 @@ ROM_START( nslasher ) /* DE-0397-0 PCB */ ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */ ROM_LOAD( "sndprg.17l", 0x00000, 0x10000, CRC(18939e92) SHA1(50b37a78d9d2259d4b140dd17393c4e5ca92bca5) ) - + ROM_REGION( 0x200000, "gfx1", 0 ) ROM_LOAD( "mbh-00.8c", 0x000000, 0x200000, CRC(a877f8a3) SHA1(79253525f360a73161894f31e211e4d6b38d307a) ) /* Encrypted tiles */ @@ -3948,9 +3973,9 @@ GAME( 1994, nslasheru, nslasher, nslasheru, nslasher, nslasher_state, nslasher, GAME( 1994, tattass, 0, tattass, tattass, nslasher_state, tattass, ROT0, "Data East Pinball", "Tattoo Assassins (US prototype)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1994, tattassa, tattass, tattass, tattass, nslasher_state, tattass, ROT0, "Data East Pinball", "Tattoo Assassins (Asia prototype)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -// Dragon Gun / Lock 'n' Loaded have very different sprite hardware -GAME( 1993, dragngun, 0, dragngun, dragngun, dragngun_state, dragngun, ROT0, "Data East Corporation", "Dragon Gun (US)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1993, dragngunj, dragngun, dragngun, dragngun, dragngun_state, dragngunj, ROT0, "Data East Corporation", "Dragon Gun (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +// Dragon Gun / Locked 'n Loaded have very different sprite hardware +GAME( 1993, dragngun, 0, dragngun, dragngun, dragngun_state, dragngun, ROT0, "Data East Corporation", "Dragon Gun (US)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // OKI3 Bankswitching aren't verified +GAME( 1993, dragngunj, dragngun, dragngun, dragngun, dragngun_state, dragngunj, ROT0, "Data East Corporation", "Dragon Gun (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // "" GAME( 1994, lockload, 0, lockload, lockload, dragngun_state, lockload, ROT0, "Data East Corporation", "Locked 'n Loaded (World)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) GAME( 1994, gunhard, lockload, lockload, lockload, dragngun_state, lockload, ROT0, "Data East Corporation", "Gun Hard (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/deco32.h b/src/mame/includes/deco32.h index 403199805e9..4dcec7301db 100644 --- a/src/mame/includes/deco32.h +++ b/src/mame/includes/deco32.h @@ -26,26 +26,17 @@ public: m_ioprot(*this, "ioprot"), m_deco_irq(*this, "irq"), m_decobsmt(*this, "decobsmt"), - m_spriteram(*this, "spriteram"), - m_sprgen(*this, "spritegen"), - m_sprgen1(*this, "spritegen1"), - m_sprgen2(*this, "spritegen2"), + m_sprgen(*this, "spritegen%u", 1), m_sprgenzoom(*this, "spritegen_zoom"), m_eeprom(*this, "eeprom"), m_ym2151(*this, "ymsnd"), - m_oki1(*this, "oki1"), - m_oki2(*this, "oki2"), - m_deco_tilegen1(*this, "tilegen1"), - m_deco_tilegen2(*this, "tilegen2"), + m_oki(*this, "oki%u", 1), + m_deco_tilegen(*this, "tilegen%u", 1), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch"), - m_ram(*this, "ram"), - m_pf1_rowscroll32(*this, "pf1_rowscroll32"), - m_pf2_rowscroll32(*this, "pf2_rowscroll32"), - m_pf3_rowscroll32(*this, "pf3_rowscroll32"), - m_pf4_rowscroll32(*this, "pf4_rowscroll32"), + m_pf_rowscroll32(*this, "pf%u_rowscroll32", 1), m_generic_paletteram_32(*this, "paletteram") { } @@ -54,38 +45,26 @@ public: required_device m_ioprot; optional_device m_deco_irq; optional_device m_decobsmt; - optional_device m_spriteram; - optional_device m_sprgen; - optional_device m_sprgen1; - optional_device m_sprgen2; + optional_device_array m_sprgen; optional_device m_sprgenzoom; optional_device m_eeprom; optional_device m_ym2151; - optional_device m_oki1; - optional_device m_oki2; - required_device m_deco_tilegen1; - required_device m_deco_tilegen2; + optional_device_array m_oki; + required_device_array m_deco_tilegen; required_device m_gfxdecode; required_device m_screen; required_device m_palette; optional_device m_soundlatch; - required_shared_ptr m_ram; // we use the pointers below to store a 32-bit copy.. - required_shared_ptr m_pf1_rowscroll32; - required_shared_ptr m_pf2_rowscroll32; - required_shared_ptr m_pf3_rowscroll32; - required_shared_ptr m_pf4_rowscroll32; + required_shared_ptr_array m_pf_rowscroll32; optional_shared_ptr m_generic_paletteram_32; std::unique_ptr m_dirty_palette; // all but captaven int m_pri; // captaven, fghthist, nslasher and tattass - uint16_t m_spriteram16[0x1000]; // captaven, fghthist, nslasher and tattass - uint16_t m_spriteram16_buffered[0x1000]; // captaven, fghthist, nslasher and tattass - uint16_t m_pf1_rowscroll[0x1000]; // common - uint16_t m_pf2_rowscroll[0x1000]; // common - uint16_t m_pf3_rowscroll[0x1000]; // common - uint16_t m_pf4_rowscroll[0x1000]; // common + std::unique_ptr m_spriteram16[2]; // captaven, fghthist, nslasher and tattass + std::unique_ptr m_spriteram16_buffered[2]; // captaven, fghthist, nslasher and tattass + std::unique_ptr m_pf_rowscroll[4]; // common // common DECLARE_READ16_MEMBER(ioprot_r); @@ -95,28 +74,29 @@ public: DECLARE_WRITE8_MEMBER(volume_w); DECLARE_WRITE32_MEMBER(vblank_ack_w); - DECLARE_WRITE32_MEMBER(pf1_rowscroll_w); - DECLARE_WRITE32_MEMBER(pf2_rowscroll_w); - DECLARE_WRITE32_MEMBER(pf3_rowscroll_w); - DECLARE_WRITE32_MEMBER(pf4_rowscroll_w); + template DECLARE_WRITE32_MEMBER(pf_rowscroll_w); DECLARE_WRITE8_MEMBER(sound_bankswitch_w); // captaven, fghthist, nslasher and tattass - DECLARE_READ32_MEMBER(spriteram_r); - DECLARE_WRITE32_MEMBER(spriteram_w); - DECLARE_WRITE32_MEMBER(buffer_spriteram_w); + template DECLARE_READ32_MEMBER(spriteram_r); + template DECLARE_WRITE32_MEMBER(spriteram_w); + template DECLARE_WRITE32_MEMBER(buffer_spriteram_w); DECLARE_WRITE32_MEMBER(pri_w); // all but captaven DECLARE_WRITE32_MEMBER(buffered_palette_w); DECLARE_WRITE32_MEMBER(palette_dma_w); - + void h6280_sound_custom_latch_map(address_map &map); void h6280_sound_map(address_map &map); void z80_sound_io(address_map &map); - void z80_sound_mem(address_map &map); + void z80_sound_map(address_map &map); protected: virtual void video_start() override; + + void allocate_spriteram(int chip); + void allocate_buffered_palette(); + void allocate_rowscroll(int size1, int size2, int size3, int size4); }; @@ -186,9 +166,6 @@ public: DECLARE_WRITE32_MEMBER(tattass_control_w); DECLARE_WRITE_LINE_MEMBER(tattass_sound_irq_w); DECLARE_READ16_MEMBER(nslasher_debug_r); - DECLARE_READ32_MEMBER(spriteram2_r); - DECLARE_WRITE32_MEMBER(spriteram2_w); - DECLARE_WRITE32_MEMBER(buffer_spriteram2_w); DECLARE_DRIVER_INIT(tattass); DECLARE_DRIVER_INIT(nslasher); @@ -209,9 +186,6 @@ private: std::unique_ptr m_tilemap_alpha_bitmap; - uint16_t m_spriteram16_2[0x1000]; - uint16_t m_spriteram16_2_buffered[0x1000]; - int m_tattass_eprom_bit; int m_lastClock; char m_buffer[32]; @@ -226,26 +200,24 @@ class dragngun_state : public deco32_state public: dragngun_state(const machine_config &mconfig, device_type type, const char *tag) : deco32_state(mconfig, type, tag), - m_sprite_layout_0_ram(*this, "lay0"), - m_sprite_layout_1_ram(*this, "lay1"), - m_sprite_lookup_0_ram(*this, "look0"), - m_sprite_lookup_1_ram(*this, "look1"), - m_oki3(*this, "oki3"), + m_spriteram(*this, "spriteram"), + m_sprite_layout_ram(*this, "lay%u", 0), + m_sprite_lookup_ram(*this, "look%u", 0), m_vol_main(*this, "vol_main"), m_vol_gun(*this, "vol_gun"), m_gun_speaker_disabled(true) { } + + required_device m_spriteram; - required_shared_ptr m_sprite_layout_0_ram; - required_shared_ptr m_sprite_layout_1_ram; - required_shared_ptr m_sprite_lookup_0_ram; - required_shared_ptr m_sprite_lookup_1_ram; - optional_device m_oki3; + required_shared_ptr_array m_sprite_layout_ram; + required_shared_ptr_array m_sprite_lookup_ram; required_device m_vol_main; - required_device m_vol_gun; + optional_device m_vol_gun; uint32_t m_sprite_ctrl; int m_lightgun_port; + int m_oki2_bank; // lockload bitmap_rgb32 m_temp_render_bitmap; DECLARE_READ32_MEMBER(lightgun_r); @@ -261,13 +233,14 @@ public: DECLARE_WRITE32_MEMBER(speaker_switch_w); LC7535_VOLUME_CHANGED(volume_main_changed); LC7535_VOLUME_CHANGED(volume_gun_changed); + + DECLARE_WRITE8_MEMBER(sound_bankswitch_w); + DECLARE_WRITE8_MEMBER(lockload_okibank_w); // lockload - virtual void video_start() override; DECLARE_DRIVER_INIT(dragngun); DECLARE_DRIVER_INIT(dragngunj); DECLARE_DRIVER_INIT(lockload); DECLARE_VIDEO_START(dragngun); - DECLARE_VIDEO_START(lockload); void dragngun_init_common(); DECLARE_INPUT_CHANGED_MEMBER(lockload_gun_trigger); @@ -282,6 +255,8 @@ public: void dragngun_map(address_map &map); void lockload_map(address_map &map); void lockloadu_map(address_map &map); + void lockload_sound_map(address_map &map); + void lockloadu_sound_map(address_map &map); private: bool m_gun_speaker_disabled; }; diff --git a/src/mame/video/deco32.cpp b/src/mame/video/deco32.cpp index e0139b95eba..4b8dc1a754c 100644 --- a/src/mame/video/deco32.cpp +++ b/src/mame/video/deco32.cpp @@ -55,25 +55,47 @@ WRITE32_MEMBER( deco32_state::palette_dma_w ) void deco32_state::video_start() { save_item(NAME(m_pri)); - save_item(NAME(m_spriteram16)); - save_item(NAME(m_spriteram16_buffered)); - save_item(NAME(m_pf1_rowscroll)); - save_item(NAME(m_pf2_rowscroll)); - save_item(NAME(m_pf3_rowscroll)); - save_item(NAME(m_pf4_rowscroll)); +} + +void deco32_state::allocate_spriteram(int chip) +{ + m_spriteram16[chip] = std::make_unique(0x2000/4); + m_spriteram16_buffered[chip] = std::make_unique(0x2000/4); + save_pointer(NAME(m_spriteram16[chip].get()), 0x2000/4); + save_pointer(NAME(m_spriteram16_buffered[chip].get()), 0x2000/4); +} + +void deco32_state::allocate_buffered_palette() +{ + m_dirty_palette = make_unique_clear(2048); + save_pointer(NAME(m_dirty_palette.get()), 2048); +} + +void deco32_state::allocate_rowscroll(int size1, int size2, int size3, int size4) +{ + m_pf_rowscroll[0] = make_unique_clear(size1); + m_pf_rowscroll[1] = make_unique_clear(size2); + m_pf_rowscroll[2] = make_unique_clear(size3); + m_pf_rowscroll[3] = make_unique_clear(size4); + save_pointer(NAME(m_pf_rowscroll[0].get()), size1); + save_pointer(NAME(m_pf_rowscroll[1].get()), size2); + save_pointer(NAME(m_pf_rowscroll[2].get()), size3); + save_pointer(NAME(m_pf_rowscroll[3].get()), size4); } VIDEO_START_MEMBER( captaven_state, captaven ) { + deco32_state::allocate_spriteram(0); + deco32_state::allocate_rowscroll(0x4000/4, 0x2000/4, 0x4000/4, 0x2000/4); deco32_state::video_start(); } VIDEO_START_MEMBER( fghthist_state, fghthist ) { - m_dirty_palette = std::make_unique(4096); - m_sprgen->alloc_sprite_bitmap(); - - save_pointer(NAME(m_dirty_palette.get()), 4096); + m_sprgen[0]->alloc_sprite_bitmap(); + deco32_state::allocate_spriteram(0); + deco32_state::allocate_rowscroll(0x2000/4, 0x2000/4, 0x2000/4, 0x2000/4); + deco32_state::allocate_buffered_palette(); deco32_state::video_start(); } @@ -83,43 +105,21 @@ VIDEO_START_MEMBER( nslasher_state, nslasher ) width = m_screen->width(); height = m_screen->height(); m_tilemap_alpha_bitmap=std::make_unique(width, height ); - m_sprgen1->alloc_sprite_bitmap(); - m_sprgen2->alloc_sprite_bitmap(); - - save_item(NAME(m_spriteram16_2)); - save_item(NAME(m_spriteram16_2_buffered)); - + for (int chip = 0; chip < 2; chip++) + { + m_sprgen[chip]->alloc_sprite_bitmap(); + deco32_state::allocate_spriteram(chip); + } + deco32_state::allocate_rowscroll(0x2000/4, 0x2000/4, 0x2000/4, 0x2000/4); deco32_state::video_start(); } -void dragngun_state::video_start() -{ - save_item(NAME(m_pf1_rowscroll)); - save_item(NAME(m_pf2_rowscroll)); - save_item(NAME(m_pf3_rowscroll)); - save_item(NAME(m_pf4_rowscroll)); -} - VIDEO_START_MEMBER( dragngun_state, dragngun ) { - m_dirty_palette = std::make_unique(4096); m_screen->register_screen_bitmap(m_temp_render_bitmap); - - memset(m_dirty_palette.get(),0,4096); - - save_item(NAME(m_sprite_ctrl)); - save_pointer(NAME(m_dirty_palette.get()), 4096); -} - -VIDEO_START_MEMBER( dragngun_state, lockload ) -{ - m_dirty_palette = std::make_unique(4096); - m_screen->register_screen_bitmap(m_temp_render_bitmap); - - memset(m_dirty_palette.get(),0,4096); - + deco32_state::allocate_rowscroll(0x4000/4, 0x2000/4, 0x4000/4, 0x2000/4); + deco32_state::allocate_buffered_palette(); save_item(NAME(m_sprite_ctrl)); - save_pointer(NAME(m_dirty_palette.get()), 4096); } /******************************************************************************/ @@ -129,35 +129,35 @@ VIDEO_START_MEMBER( dragngun_state, lockload ) uint32_t captaven_state::screen_update_captaven(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { address_space &space = machine().dummy_space(); - uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); + uint16_t flip = m_deco_tilegen[0]->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); - m_sprgen->set_flip_screen(BIT(flip, 7)); + m_sprgen[0]->set_flip_screen(BIT(flip, 7)); screen.priority().fill(0, cliprect); bitmap.fill(m_palette->pen(0x000), cliprect); // Palette index not confirmed - m_deco_tilegen2->set_pf1_8bpp_mode(1); + m_deco_tilegen[1]->set_pf1_8bpp_mode(1); - m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); - m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); + m_deco_tilegen[0]->pf_update(m_pf_rowscroll[0].get(), m_pf_rowscroll[1].get()); + m_deco_tilegen[1]->pf_update(m_pf_rowscroll[2].get(), m_pf_rowscroll[3].get()); // pf4 not used (because pf3 is in 8bpp mode) if ((m_pri&1)==0) { - m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, 0, 1); - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); + m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 1); + m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); } else { - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); - m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, 0, 2); + m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); + m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 2); } - m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); + m_deco_tilegen[0]->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); - m_sprgen->set_alt_format(true); - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x400); + m_sprgen[0]->set_alt_format(true); + m_sprgen[0]->draw_sprites(bitmap, cliprect, m_spriteram16_buffered[0].get(), 0x400); // only low half of sprite ram is used? return 0; } @@ -167,15 +167,15 @@ uint32_t dragngun_state::screen_update_dragngun(screen_device &screen, bitmap_rg screen.priority().fill(0, cliprect); bitmap.fill(m_palette->black_pen(), cliprect); - m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); - m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); + m_deco_tilegen[0]->pf_update(m_pf_rowscroll[0].get(), m_pf_rowscroll[1].get()); + m_deco_tilegen[1]->pf_update(m_pf_rowscroll[2].get(), m_pf_rowscroll[3].get()); - //m_deco_tilegen1->set_pf3_8bpp_mode(1); // despite being 8bpp this doesn't require the same shifting as captaven, why not? + //m_deco_tilegen[0]->set_pf3_8bpp_mode(1); // despite being 8bpp this doesn't require the same shifting as captaven, why not? - m_deco_tilegen2->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); // it uses pf3 in 8bpp mode instead, like captaven - m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, 0, 2); - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 4); - m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 8); + m_deco_tilegen[1]->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); // it uses pf3 in 8bpp mode instead, like captaven + m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 2); + m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 4); + m_deco_tilegen[0]->tilemap_1_draw(screen, bitmap, cliprect, 0, 8); // zooming sprite draw is very slow, and sprites are buffered.. however, one of the levels attempts to use // partial updates for every line, which causes things to be very slow... the sprites appear to support @@ -188,7 +188,7 @@ uint32_t dragngun_state::screen_update_dragngun(screen_device &screen, bitmap_rg { rectangle clip(cliprect.min_x, cliprect.max_x, 8, 247); - m_sprgenzoom->dragngun_draw_sprites(bitmap,clip,m_spriteram->buffer(), m_sprite_layout_0_ram, m_sprite_layout_1_ram, m_sprite_lookup_0_ram, m_sprite_lookup_1_ram, m_sprite_ctrl, screen.priority(), m_temp_render_bitmap ); + m_sprgenzoom->dragngun_draw_sprites(bitmap,clip,m_spriteram->buffer(), m_sprite_layout_ram[0], m_sprite_layout_ram[1], m_sprite_lookup_ram[0], m_sprite_lookup_ram[1], m_sprite_ctrl, screen.priority(), m_temp_render_bitmap ); } @@ -201,32 +201,32 @@ uint32_t fghthist_state::screen_update_fghthist(screen_device &screen, bitmap_rg screen.priority().fill(0, cliprect); bitmap.fill(m_palette->pen(0x300), cliprect); // Palette index not confirmed - m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); - m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); + m_deco_tilegen[0]->pf_update(m_pf_rowscroll[0].get(), m_pf_rowscroll[1].get()); + m_deco_tilegen[1]->pf_update(m_pf_rowscroll[2].get(), m_pf_rowscroll[3].get()); // sprites are flipped relative to tilemaps - m_sprgen->set_flip_screen(true); - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x800); + m_sprgen[0]->set_flip_screen(true); + m_sprgen[0]->draw_sprites(bitmap, cliprect, m_spriteram16_buffered[0].get(), 0x800); /* Draw screen */ - m_deco_tilegen2->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); + m_deco_tilegen[1]->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); if(m_pri&1) { - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); - m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); - m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); + m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); + m_sprgen[0]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); + m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); } else { - m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, 0, 2); - m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 4); + m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 2); + m_sprgen[0]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); + m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 4); } - m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 1024, 0x1ff); + m_sprgen[0]->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 1024, 0x1ff); - m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); + m_deco_tilegen[0]->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); return 0; } @@ -245,8 +245,8 @@ void nslasher_state::mixDualAlphaSprites(screen_device &screen, bitmap_rgb32 &bi const pen_t *pal1 = &pens[gfx1->colorbase()]; const pen_t *pal2 = &pens[m_gfxdecode->gfx((m_pri&1) ? 1 : 2)->colorbase()]; int x,y; - bitmap_ind16& sprite0_mix_bitmap = machine().device("spritegen1")->get_sprite_temp_bitmap(); - bitmap_ind16& sprite1_mix_bitmap = machine().device("spritegen2")->get_sprite_temp_bitmap(); + bitmap_ind16& sprite0_mix_bitmap = m_sprgen[0]->get_sprite_temp_bitmap(); + bitmap_ind16& sprite1_mix_bitmap = m_sprgen[1]->get_sprite_temp_bitmap(); /* Mix sprites into main bitmap, based on priority & alpha */ @@ -372,8 +372,8 @@ void nslasher_state::mixDualAlphaSprites(screen_device &screen, bitmap_rgb32 &bi uint32_t nslasher_state::screen_update_nslasher(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int alphaTilemap=0; - m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); - m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); + m_deco_tilegen[0]->pf_update(m_pf_rowscroll[0].get(), m_pf_rowscroll[1].get()); + m_deco_tilegen[1]->pf_update(m_pf_rowscroll[2].get(), m_pf_rowscroll[3].get()); /* This is not a conclusive test for deciding if tilemap needs alpha blending */ if (m_deco_ace->get_aceram(0x17)!=0x0 && m_pri) @@ -384,14 +384,14 @@ uint32_t nslasher_state::screen_update_nslasher(screen_device &screen, bitmap_rg bitmap.fill(m_palette->pen(0x200), cliprect); /* Draw sprites to temporary bitmaps, saving alpha & priority info for later mixing */ - m_sprgen1->set_pix_raw_shift(8); - m_sprgen2->set_pix_raw_shift(8); + m_sprgen[0]->set_pix_raw_shift(8); + m_sprgen[1]->set_pix_raw_shift(8); // sprites are flipped relative to tilemaps - m_sprgen1->set_flip_screen(true); - m_sprgen2->set_flip_screen(true); - m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x800); - m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram16_2_buffered, 0x800); + m_sprgen[0]->set_flip_screen(true); + m_sprgen[1]->set_flip_screen(true); + m_sprgen[0]->draw_sprites(bitmap, cliprect, m_spriteram16_buffered[0].get(), 0x800); + m_sprgen[1]->draw_sprites(bitmap, cliprect, m_spriteram16_buffered[1].get(), 0x800); /* Render alpha-blended tilemap to separate buffer for proper mixing */ @@ -400,32 +400,32 @@ uint32_t nslasher_state::screen_update_nslasher(screen_device &screen, bitmap_rg /* Draw playfields & sprites */ if (m_pri&2) { - m_deco_tilegen2->tilemap_12_combine_draw(screen, bitmap, cliprect, 0, 1, 1); - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 4); + m_deco_tilegen[1]->tilemap_12_combine_draw(screen, bitmap, cliprect, 0, 1, 1); + m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 4); } else { - m_deco_tilegen2->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); + m_deco_tilegen[1]->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); if (m_pri&1) { - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); + m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); if (alphaTilemap) - m_deco_tilegen2->tilemap_1_draw(screen, *m_tilemap_alpha_bitmap, cliprect, 0, 4); + m_deco_tilegen[1]->tilemap_1_draw(screen, *m_tilemap_alpha_bitmap, cliprect, 0, 4); else - m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); + m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); } else { - m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, 0, 2); + m_deco_tilegen[1]->tilemap_1_draw(screen, bitmap, cliprect, 0, 2); if (alphaTilemap) - m_deco_tilegen1->tilemap_2_draw(screen, *m_tilemap_alpha_bitmap, cliprect, 0, 4); + m_deco_tilegen[0]->tilemap_2_draw(screen, *m_tilemap_alpha_bitmap, cliprect, 0, 4); else - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 4); + m_deco_tilegen[0]->tilemap_2_draw(screen, bitmap, cliprect, 0, 4); } } mixDualAlphaSprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_gfxdecode->gfx(4), alphaTilemap); - m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); + m_deco_tilegen[0]->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); return 0; } -- cgit v1.2.3