devfind: Add rom_ptr_finder, which works like shared_ptr_finder

except it finds a ROM region instead of a memory share.
Unlike the old memory_region_finder, these can be accessed without
any overhead (since it's a pointer directly to the data and not
to the memory_region object), can be whatever data type you want
(no casting needed) and are strictly type-checked--if you have a
required_rom_ptr<UINT32> the region has to be a ROM_REGION32
(or an implicitly 32-bit region due to belonging to a CPU) or
the finder won't find it and will tell you why.

Basically, rom_ptr_finders are strictly better than
memory_region_finders and all drivers using the latter should be
converted over. I've done megasys1.c and twin16.c as examples.

megasys1: Use a device address map for the peekaboo oki instead
of memcpy().

twin16: Convert the scrolling layers to tilemaps (the fixed text
layer was already one). Miscellaneous cleanups/modernizations.

(nw)

Notice that rom_ptr_finder has a length() method which returns the
length in whatever size unit the pointer is, instead of a bytes()
method. Yes, I'm going to convert shared_ptr_finder to match, since
this way makes a lot more sense (in particular, mask() is useless
for shared_ptrs that are anything other than INT8/UINT8)
This commit is contained in:
Alex W. Jackson 2014-10-17 02:59:51 +00:00
parent a6128baac7
commit 6ca10ab4fa
7 changed files with 508 additions and 431 deletions

View File

@ -37,10 +37,35 @@ finder_base::~finder_base()
//-------------------------------------------------
// find_memory - find memory
// find_memregion - find memory region
//-------------------------------------------------
void *finder_base::find_memory(UINT8 width, size_t &bytes, bool required)
void *finder_base::find_memregion(UINT8 width, size_t &length, bool required)
{
// look up the region and return NULL if not found
memory_region *region = m_base.memregion(m_tag);
if (region == NULL)
return NULL;
// check the width and warn if not correct
if (region->width() != width)
{
if (required)
osd_printf_warning("Region '%s' found but is width %d, not %d as requested\n", m_tag, region->width()*8, width*8);
return NULL;
}
// return results
length = region->bytes() / width;
return region->base();
}
//-------------------------------------------------
// find_memshare - find memory share
//-------------------------------------------------
void *finder_base::find_memshare(UINT8 width, size_t &bytes, bool required)
{
// look up the share and return NULL if not found
memory_share *share = m_base.memshare(m_tag);

View File

@ -53,7 +53,8 @@ public:
protected:
// helpers
void *find_memory(UINT8 width, size_t &bytes, bool required);
void *find_memregion(UINT8 width, size_t &length, bool required);
void *find_memshare(UINT8 width, size_t &bytes, bool required);
bool report_missing(bool found, const char *objname, bool required);
// internal state
@ -304,6 +305,56 @@ public:
};
// ======================> rom_ptr_finder
// ROM region pointer finder template
template<typename _PointerType, bool _Required>
class rom_ptr_finder : public object_finder_base<_PointerType>
{
public:
// construction/destruction
rom_ptr_finder(device_t &base, const char *tag)
: object_finder_base<_PointerType>(base, tag),
m_length(0) { }
// operators to make use transparent
_PointerType operator[](int index) const { return this->m_target[index]; }
_PointerType &operator[](int index) { return this->m_target[index]; }
// getter for explicit fetching
UINT32 length() const { return m_length; }
UINT32 mask() const { return m_length - 1; }
// finder
virtual bool findit(bool isvalidation = false)
{
if (isvalidation) return true;
this->m_target = reinterpret_cast<_PointerType *>(this->find_memregion(sizeof(_PointerType), m_length, _Required));
return this->report_missing(this->m_target != NULL, "memory region", _Required);
}
protected:
// internal state
size_t m_length;
};
// optional ROM pointer finder
template<class _PointerType>
class optional_rom_ptr : public rom_ptr_finder<_PointerType, false>
{
public:
optional_rom_ptr(device_t &base, const char *tag = FINDER_DUMMY_TAG) : rom_ptr_finder<_PointerType, false>(base, tag) { }
};
// required ROM pointer finder
template<class _PointerType>
class required_rom_ptr : public rom_ptr_finder<_PointerType, true>
{
public:
required_rom_ptr(device_t &base, const char *tag = FINDER_DUMMY_TAG) : rom_ptr_finder<_PointerType, true>(base, tag) { }
};
// ======================> shared_ptr_finder
// shared pointer finder template
@ -342,7 +393,7 @@ public:
virtual bool findit(bool isvalidation = false)
{
if (isvalidation) return true;
this->m_target = reinterpret_cast<_PointerType *>(this->find_memory(m_width, m_bytes, _Required));
this->m_target = reinterpret_cast<_PointerType *>(this->find_memshare(m_width, m_bytes, _Required));
return this->report_missing(this->m_target != NULL, "shared pointer", _Required);
}

View File

@ -312,6 +312,10 @@ static ADDRESS_MAP_START( megasys1D_map, AS_PROGRAM, 16, megasys1_state )
AM_RANGE(0x1f0000, 0x1fffff) AM_RAM AM_SHARE("ram")
ADDRESS_MAP_END
static ADDRESS_MAP_START( megasys1D_oki_map, AS_0, 8, megasys1_state )
AM_RANGE(0x00000, 0x1ffff) AM_ROM
AM_RANGE(0x20000, 0x3ffff) AM_ROMBANK("okibank")
ADDRESS_MAP_END
/*************************************
*
@ -1382,16 +1386,7 @@ WRITE16_MEMBER(megasys1_state::protection_peekaboo_w)
COMBINE_DATA(&m_protection_val);
if ((m_protection_val & 0x90) == 0x90)
{
UINT8 *RAM = m_region_oki1->base();
int new_bank = (m_protection_val & 0x7) % 7;
if (m_bank != new_bank)
{
memcpy(&RAM[0x20000],&RAM[0x40000 + 0x20000*new_bank],0x20000);
m_bank = new_bank;
}
}
membank("okibank")->set_entry(m_protection_val & 7);
m_maincpu->set_input_line(4, HOLD_LINE);
}
@ -1621,6 +1616,7 @@ static MACHINE_CONFIG_START( system_D, megasys1_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_OKIM6295_ADD("oki1", SYS_D_CPU_CLOCK/4, OKIM6295_PIN7_HIGH) /* 2MHz (8MHz / 4) */
MCFG_DEVICE_ADDRESS_MAP(AS_0, megasys1D_oki_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@ -3145,9 +3141,8 @@ ROM_START( peekaboo )
ROM_REGION( 0x080000, "gfx4", 0 ) /* Sprites */
ROM_LOAD( "1", 0x000000, 0x080000, CRC(5a444ecf) SHA1(38a7a6e91d0635a7f82a1c9a04efe1586ed3d856) )
ROM_REGION( 0x120000, "oki1", 0 ) /* Samples */
ROM_LOAD( "peeksamp.124", 0x000000, 0x020000, CRC(e1206fa8) SHA1(339d5a4fa2af7fb4ab2e9c6c66f4848fa8774832) )
ROM_CONTINUE( 0x040000, 0x0e0000 )
ROM_REGION( 0x100000, "oki1", 0 ) /* Samples */
ROM_LOAD( "peeksamp.124", 0x000000, 0x100000, CRC(e1206fa8) SHA1(339d5a4fa2af7fb4ab2e9c6c66f4848fa8774832) )
ROM_REGION( 0x0200, "proms", 0 ) /* Priority PROM */
ROM_LOAD( "priority.69", 0x000000, 0x200, CRC(b40bff56) SHA1(39c95eed79328ef2df754988db83e07909e848f8) )
@ -3173,9 +3168,8 @@ ROM_START( peekaboou )
ROM_REGION( 0x080000, "gfx4", 0 ) /* Sprites */
ROM_LOAD( "1", 0x000000, 0x080000, CRC(5a444ecf) SHA1(38a7a6e91d0635a7f82a1c9a04efe1586ed3d856) )
ROM_REGION( 0x120000, "oki1", 0 ) /* Samples */
ROM_LOAD( "peeksamp.124", 0x000000, 0x020000, CRC(e1206fa8) SHA1(339d5a4fa2af7fb4ab2e9c6c66f4848fa8774832) )
ROM_CONTINUE( 0x040000, 0x0e0000 )
ROM_REGION( 0x100000, "oki1", 0 ) /* Samples */
ROM_LOAD( "peeksamp.124", 0x000000, 0x100000, CRC(e1206fa8) SHA1(339d5a4fa2af7fb4ab2e9c6c66f4848fa8774832) )
ROM_REGION( 0x0200, "proms", 0 ) /* Priority PROM */
ROM_LOAD( "priority.69", 0x000000, 0x200, CRC(b40bff56) SHA1(39c95eed79328ef2df754988db83e07909e848f8) )
@ -3793,8 +3787,6 @@ DRIVER_INIT_MEMBER(megasys1_state,64street)
READ16_MEMBER(megasys1_state::megasys1A_mcu_hs_r)
{
UINT16 *ROM = (UINT16 *) m_region_maincpu->base();
if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0))
{
if(MCU_HS_LOG && !space.debugger_access())
@ -3803,7 +3795,7 @@ READ16_MEMBER(megasys1_state::megasys1A_mcu_hs_r)
return 0x889e;
}
return ROM[offset];
return m_rom_maincpu[offset];
}
WRITE16_MEMBER(megasys1_state::megasys1A_mcu_hs_w)
@ -3922,8 +3914,6 @@ DRIVER_INIT_MEMBER(megasys1_state,hayaosi1)
READ16_MEMBER(megasys1_state::iganinju_mcu_hs_r)
{
UINT16 *ROM = (UINT16 *) m_region_maincpu->base();
if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0))
{
if(MCU_HS_LOG && !space.debugger_access())
@ -3932,7 +3922,7 @@ READ16_MEMBER(megasys1_state::iganinju_mcu_hs_r)
return 0x835d;
}
return ROM[offset];
return m_rom_maincpu[offset];
}
WRITE16_MEMBER(megasys1_state::iganinju_mcu_hs_w)
@ -3957,33 +3947,27 @@ WRITE16_MEMBER(megasys1_state::iganinju_mcu_hs_w)
DRIVER_INIT_MEMBER(megasys1_state,iganinju)
{
//UINT16 *ROM;
phantasm_rom_decode(machine(), "maincpu");
//ROM = (UINT16 *) m_region_maincpu->base();
m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_r),this));
m_maincpu->space(AS_PROGRAM).install_write_handler(0x2f000, 0x2f009, write16_delegate(FUNC(megasys1_state::iganinju_mcu_hs_w),this));
//ROM[0x00006e/2] = 0x0420; // the only game that does
// not like lev 3 interrupts
//m_rom_maincpu[0x00006e/2] = 0x0420; // the only game that does
// not like lev 3 interrupts
}
// jitsupro writes oki commands to both the lsb and msb; it works because of byte smearing
WRITE16_MEMBER(megasys1_state::okim6295_both_1_w)
{
if (ACCESSING_BITS_0_7) m_oki1->write_command((data >> 0) & 0xff );
else m_oki1->write_command((data >> 8) & 0xff );
m_oki1->write_command(data & 0xff);
}
WRITE16_MEMBER(megasys1_state::okim6295_both_2_w)
{
if (ACCESSING_BITS_0_7) m_oki2->write_command((data >> 0) & 0xff );
else m_oki2->write_command((data >> 8) & 0xff );
m_oki2->write_command(data & 0xff);
}
DRIVER_INIT_MEMBER(megasys1_state,jitsupro)
{
//UINT16 *ROM = (UINT16 *) m_region_maincpu->base();
astyanax_rom_decode(machine(), "maincpu"); // Code
jitsupro_gfx_unmangle("gfx1"); // Gfx
@ -3991,13 +3975,18 @@ DRIVER_INIT_MEMBER(megasys1_state,jitsupro)
m_maincpu->space(AS_PROGRAM).install_read_handler(0x00000, 0x3ffff, read16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_r),this));
m_maincpu->space(AS_PROGRAM).install_write_handler(0x20000, 0x20009, write16_delegate(FUNC(megasys1_state::megasys1A_mcu_hs_w),this));
/* the sound code writes oki commands to both the lsb and msb */
m_audiocpu->space(AS_PROGRAM).install_write_handler(0xa0000, 0xa0003, write16_delegate(FUNC(megasys1_state::okim6295_both_1_w),this));
m_audiocpu->space(AS_PROGRAM).install_write_handler(0xc0000, 0xc0003, write16_delegate(FUNC(megasys1_state::okim6295_both_2_w),this));
}
DRIVER_INIT_MEMBER(megasys1_state,peekaboo)
{
UINT8 *ROM = memregion("oki1")->base();
memory_bank *okibank = membank("okibank");
okibank->configure_entry(7, &ROM[0x20000]);
okibank->configure_entries(0, 7, &ROM[0x20000], 0x20000);
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x100000, 0x100001, read16_delegate(FUNC(megasys1_state::protection_peekaboo_r),this), write16_delegate(FUNC(megasys1_state::protection_peekaboo_w),this));
}
@ -4046,8 +4035,6 @@ DRIVER_INIT_MEMBER(megasys1_state,soldam)
READ16_MEMBER(megasys1_state::stdragon_mcu_hs_r)
{
UINT16 *ROM = (UINT16 *) m_region_maincpu->base();
if(m_mcu_hs && ((m_mcu_hs_ram[8/2] << 6) & 0x3ffc0) == ((offset*2) & 0x3ffc0))
{
if(MCU_HS_LOG && !space.debugger_access())
@ -4056,7 +4043,7 @@ READ16_MEMBER(megasys1_state::stdragon_mcu_hs_r)
return 0x835d;
}
return ROM[offset];
return m_rom_maincpu[offset];
}
WRITE16_MEMBER(megasys1_state::stdragon_mcu_hs_w)
@ -4114,8 +4101,7 @@ DRIVER_INIT_MEMBER(megasys1_state,monkelf)
{
DRIVER_INIT_CALL(avspirit);
UINT16 *ROM = (UINT16*)m_region_maincpu->base();
ROM[0x00744/2] = 0x4e71; // weird check, 0xe000e R is a port-based trap?
m_rom_maincpu[0x00744/2] = 0x4e71; // weird check, 0xe000e R is a port-based trap?
m_maincpu->space(AS_PROGRAM).install_read_handler(0xe0000, 0xe000f, read16_delegate(FUNC(megasys1_state::monkelf_input_r),this));
}

View File

@ -59,7 +59,7 @@ Known Issues:
int twin16_state::twin16_spriteram_process_enable( )
int twin16_state::spriteram_process_enable( )
{
return (m_CPUA_register & 0x40) == 0;
}
@ -68,17 +68,7 @@ int twin16_state::twin16_spriteram_process_enable( )
/* Read/Write Handlers */
READ16_MEMBER(twin16_state::twin16_gfx_rom1_r)
{
return m_gfx_rom[offset + ((m_CPUB_register&0x04)?0x40000:0)];
}
READ16_MEMBER(twin16_state::twin16_gfx_rom2_r)
{
return m_gfx_rom[offset + 0x80000 + ((m_CPUB_register&0x04)?0x40000:0)];
}
WRITE16_MEMBER(twin16_state::twin16_CPUA_register_w)
WRITE16_MEMBER(twin16_state::CPUA_register_w)
{
/*
7 6 5 4 3 2 1 0
@ -88,17 +78,21 @@ WRITE16_MEMBER(twin16_state::twin16_CPUA_register_w)
X 0->1 trigger IRQ on sound CPU
x x x coin counters
*/
UINT16 old = m_CPUA_register;
int old = m_CPUA_register;
COMBINE_DATA(&m_CPUA_register);
if (m_CPUA_register != old)
{
if ((old & 0x08) == 0 && (m_CPUA_register & 0x08))
int rising_edge = ~old & m_CPUA_register;
int falling_edge = old & ~m_CPUA_register;
if (rising_edge & 0x08)
m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
if ((old & 0x40) && (m_CPUA_register & 0x40) == 0)
twin16_spriteram_process();
if (falling_edge & 0x40)
spriteram_process();
if ((old & 0x10) == 0 && (m_CPUA_register & 0x10))
if (rising_edge & 0x10)
m_subcpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
coin_counter_w(machine(), 0, m_CPUA_register & 0x01);
@ -107,7 +101,7 @@ WRITE16_MEMBER(twin16_state::twin16_CPUA_register_w)
}
}
WRITE16_MEMBER(twin16_state::twin16_CPUB_register_w)
WRITE16_MEMBER(twin16_state::CPUB_register_w)
{
/*
7 6 5 4 3 2 1 0
@ -115,19 +109,24 @@ WRITE16_MEMBER(twin16_state::twin16_CPUB_register_w)
X IRQ5 enable
X 0->1 trigger IRQ6 on CPUA
*/
UINT16 old = m_CPUB_register;
int old = m_CPUB_register;
COMBINE_DATA(&m_CPUB_register);
if( m_CPUB_register!=old )
if (m_CPUB_register != old)
{
if ((old & 0x01) == 0 && (m_CPUB_register & 0x01))
int rising_edge = ~old & m_CPUB_register;
if (rising_edge & 0x01)
m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
m_gfxrombank->set_entry(BIT(m_CPUB_register, 2));
}
}
WRITE16_MEMBER(twin16_state::fround_CPU_register_w)
WRITE16_MEMBER(fround_state::fround_CPU_register_w)
{
/*
7 6 5 4 3 2 1 0
X IRQ5 enable
X 0->1 trigger IRQ on sound CPU
x x coin counters
*/
@ -143,17 +142,17 @@ WRITE16_MEMBER(twin16_state::fround_CPU_register_w)
}
}
READ8_MEMBER(twin16_state::twin16_upd_busy_r)
READ8_MEMBER(twin16_state::upd_busy_r)
{
return m_upd7759->busy_r();
}
WRITE8_MEMBER(twin16_state::twin16_upd_reset_w)
WRITE8_MEMBER(twin16_state::upd_reset_w)
{
m_upd7759->reset_w(data & 2);
}
WRITE8_MEMBER(twin16_state::twin16_upd_start_w)
WRITE8_MEMBER(twin16_state::upd_start_w)
{
m_upd7759->start_w(data & 1);
}
@ -163,13 +162,13 @@ WRITE8_MEMBER(twin16_state::twin16_upd_start_w)
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, twin16_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x9000, 0x9000) AM_WRITE(twin16_upd_reset_w)
AM_RANGE(0x9000, 0x9000) AM_WRITE(upd_reset_w)
AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("k007232", k007232_device, read, write)
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("upd", upd7759_device, port_w)
AM_RANGE(0xe000, 0xe000) AM_WRITE(twin16_upd_start_w)
AM_RANGE(0xf000, 0xf000) AM_READ(twin16_upd_busy_r) // miaj writes 0 to it
AM_RANGE(0xe000, 0xe000) AM_WRITE(upd_start_w)
AM_RANGE(0xf000, 0xf000) AM_READ(upd_busy_r) // miaj writes 0 to it
ADDRESS_MAP_END
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, twin16_state )
@ -179,7 +178,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, twin16_state )
AM_RANGE(0x060000, 0x063fff) AM_RAM
AM_RANGE(0x080000, 0x080fff) AM_DEVREADWRITE8("palette", palette_device, read, write, 0x00ff) AM_SHARE("palette")
AM_RANGE(0x081000, 0x081fff) AM_WRITENOP
AM_RANGE(0x0a0000, 0x0a0001) AM_READ_PORT("SYSTEM") AM_WRITE(twin16_CPUA_register_w)
AM_RANGE(0x0a0000, 0x0a0001) AM_READ_PORT("SYSTEM") AM_WRITE(CPUA_register_w)
AM_RANGE(0x0a0002, 0x0a0003) AM_READ_PORT("P1")
AM_RANGE(0x0a0004, 0x0a0005) AM_READ_PORT("P2")
AM_RANGE(0x0a0006, 0x0a0007) AM_READ_PORT("P3")
@ -187,11 +186,12 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, twin16_state )
AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW2") AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW1")
AM_RANGE(0x0a0018, 0x0a0019) AM_READ_PORT("DSW3")
AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(twin16_video_register_w)
AM_RANGE(0x0c000e, 0x0c000f) AM_READ(twin16_sprite_status_r)
AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(twin16_text_ram_w) AM_SHARE("text_ram")
AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(video_register_w)
AM_RANGE(0x0c000e, 0x0c000f) AM_READ(sprite_status_r)
AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(fixram_w) AM_SHARE("fixram")
// AM_RANGE(0x104000, 0x105fff) AM_NOP // miaj
AM_RANGE(0x120000, 0x123fff) AM_RAM AM_SHARE("videoram")
AM_RANGE(0x120000, 0x121fff) AM_RAM_WRITE(videoram0_w) AM_SHARE("videoram.0")
AM_RANGE(0x122000, 0x123fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram.1")
AM_RANGE(0x140000, 0x143fff) AM_RAM AM_SHARE("spriteram")
ADDRESS_MAP_END
@ -200,17 +200,18 @@ static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 16, twin16_state )
AM_RANGE(0x040000, 0x043fff) AM_RAM AM_SHARE("comram")
// AM_RANGE(0x044000, 0x04ffff) AM_NOP // miaj
AM_RANGE(0x060000, 0x063fff) AM_RAM
AM_RANGE(0x080000, 0x09ffff) AM_ROM AM_REGION("gfx3", 0)
AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(twin16_CPUB_register_w)
AM_RANGE(0x080000, 0x09ffff) AM_ROM AM_REGION("data", 0)
AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(CPUB_register_w)
AM_RANGE(0x400000, 0x403fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x480000, 0x483fff) AM_RAM AM_SHARE("videoram")
AM_RANGE(0x500000, 0x53ffff) AM_RAM AM_SHARE("tile_gfx_ram")
AM_RANGE(0x600000, 0x6fffff) AM_READ(twin16_gfx_rom1_r)
AM_RANGE(0x700000, 0x77ffff) AM_READ(twin16_gfx_rom2_r)
AM_RANGE(0x480000, 0x481fff) AM_RAM_WRITE(videoram0_w) AM_SHARE("videoram.0")
AM_RANGE(0x482000, 0x483fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram.1")
AM_RANGE(0x500000, 0x53ffff) AM_RAM_WRITE(zipram_w) AM_SHARE("zipram")
AM_RANGE(0x600000, 0x6fffff) AM_ROM AM_REGION("gfxrom", 0)
AM_RANGE(0x700000, 0x77ffff) AM_ROMBANK("gfxrombank")
AM_RANGE(0x780000, 0x79ffff) AM_RAM AM_SHARE("sprite_gfx_ram")
ADDRESS_MAP_END
static ADDRESS_MAP_START( fround_map, AS_PROGRAM, 16, twin16_state )
static ADDRESS_MAP_START( fround_map, AS_PROGRAM, 16, fround_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x040000, 0x043fff) AM_RAM AM_SHARE("comram")
AM_RANGE(0x060000, 0x063fff) AM_RAM
@ -222,13 +223,15 @@ static ADDRESS_MAP_START( fround_map, AS_PROGRAM, 16, twin16_state )
AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW2") AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW1")
AM_RANGE(0x0a0018, 0x0a0019) AM_READ_PORT("DSW3")
AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(twin16_video_register_w)
AM_RANGE(0x0c000e, 0x0c000f) AM_READ(twin16_sprite_status_r)
AM_RANGE(0x0e0000, 0x0e0001) AM_WRITE(fround_gfx_bank_w)
AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(twin16_text_ram_w) AM_SHARE("text_ram")
AM_RANGE(0x120000, 0x123fff) AM_RAM AM_SHARE("videoram")
AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(video_register_w)
AM_RANGE(0x0c000e, 0x0c000f) AM_READ(sprite_status_r)
AM_RANGE(0x0e0000, 0x0e0001) AM_WRITE(gfx_bank_w)
AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(fixram_w) AM_SHARE("fixram")
AM_RANGE(0x120000, 0x121fff) AM_RAM_WRITE(videoram0_w) AM_SHARE("videoram.0")
AM_RANGE(0x122000, 0x123fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram.1")
AM_RANGE(0x140000, 0x143fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x500000, 0x6fffff) AM_ROM AM_REGION("gfx2", 0)
AM_RANGE(0x500000, 0x5fffff) AM_ROM AM_REGION("tiles", 0)
AM_RANGE(0x600000, 0x6fffff) AM_ROM AM_REGION("gfxrom", 0)
ADDRESS_MAP_END
/* Input Ports */
@ -595,21 +598,27 @@ INPUT_PORTS_END
/* Graphics Layouts */
static const gfx_layout alpha_layout =
static const gfx_layout tile_layout =
{
8,8,
0x200,
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 },
8*32
{ STEP8(0, 4) },
{ STEP8(0, 4*8) },
4*8*8
};
/* Graphics Decode Info */
static GFXDECODE_START( twin16 )
GFXDECODE_ENTRY( "gfx1", 0x00000, alpha_layout, 0, 16 )
GFXDECODE_ENTRY( "fixed", 0, tile_layout, 0, 16 )
GFXDECODE_RAM( "zipram", 0, tile_layout, 512, 16 )
GFXDECODE_END
static GFXDECODE_START( fround )
GFXDECODE_ENTRY( "fixed", 0, tile_layout, 0, 16 )
GFXDECODE_ENTRY( "tiles", 0, tile_layout, 512, 16 )
GFXDECODE_END
/* Sound Interfaces */
@ -634,13 +643,13 @@ INTERRUPT_GEN_MEMBER(twin16_state::CPUB_interrupt)
/* Machine Drivers */
MACHINE_RESET_MEMBER(twin16_state,twin16)
void twin16_state::machine_reset()
{
m_CPUA_register = 0;
m_CPUB_register = 0;
}
MACHINE_START_MEMBER(twin16_state,twin16)
void twin16_state::machine_start()
{
/* register for savestates */
save_item(NAME(m_CPUA_register));
@ -651,20 +660,17 @@ static MACHINE_CONFIG_START( twin16, twin16_state )
// basic machine hardware
MCFG_CPU_ADD("maincpu", M68000, XTAL_18_432MHz/2)
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUA_interrupt)
MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUA_interrupt)
MCFG_CPU_ADD("sub", M68000, XTAL_18_432MHz/2)
MCFG_CPU_PROGRAM_MAP(sub_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUB_interrupt)
MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUB_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
MCFG_MACHINE_START_OVERRIDE(twin16_state,twin16)
MCFG_MACHINE_RESET_OVERRIDE(twin16_state,twin16)
// video hardware
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
@ -676,13 +682,11 @@ static MACHINE_CONFIG_START( twin16, twin16_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", twin16)
MCFG_PALETTE_ADD("palette", 0x400)
MCFG_PALETTE_ADD("palette", 1024)
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
MCFG_PALETTE_MEMBITS(8)
MCFG_PALETTE_ENABLE_SHADOWS()
MCFG_VIDEO_START_OVERRIDE(twin16_state,twin16)
// sound hardware
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@ -706,20 +710,17 @@ static MACHINE_CONFIG_DERIVED( devilw, twin16 )
MCFG_QUANTUM_TIME(attotime::from_hz(60000)) // watchdog reset otherwise
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( fround, twin16_state )
static MACHINE_CONFIG_START( fround, fround_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_18_432MHz/2)
MCFG_CPU_PROGRAM_MAP(fround_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUA_interrupt)
MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUA_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
MCFG_MACHINE_START_OVERRIDE(twin16_state,twin16)
MCFG_MACHINE_RESET_OVERRIDE(twin16_state,twin16)
/* video hardware */
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
@ -729,15 +730,13 @@ static MACHINE_CONFIG_START( fround, twin16_state )
MCFG_SCREEN_VBLANK_DRIVER(twin16_state, screen_eof_twin16)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", twin16)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", fround)
MCFG_PALETTE_ADD("palette", 0x400)
MCFG_PALETTE_ADD("palette", 1024)
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
MCFG_PALETTE_MEMBITS(8)
MCFG_PALETTE_ENABLE_SHADOWS()
MCFG_VIDEO_START_OVERRIDE(twin16_state,twin16)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@ -783,19 +782,19 @@ ROM_START( devilw )
ROM_LOAD16_BYTE( "687_q13.10s", 0x20000, 0x10000, CRC(36ae6014) SHA1(102d4c3215fb5f199ce6f93ce92725b5cce0b01d) )
ROM_LOAD16_BYTE( "687_q12.8s", 0x20001, 0x10000, CRC(6d012167) SHA1(d608e29e0b2e834c099386b6ebb667e4bfc40ce7) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "687_l03.10a", 0x00000, 0x8000, CRC(7201983c) SHA1(06d089406d2f702e8d51ffdfbf34e4727a28d506) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "687_m14.d8", 0x0000, 0x4000, CRC(d7338557) SHA1(9b384baafabaab3888a0139674f0b530303684ca) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD( "687_m14.d8", 0x0000, 0x4000, CRC(d7338557) SHA1(9b384baafabaab3888a0139674f0b530303684ca) )
ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime
ROM_REGION16_BE( 0x200000, "gfxrom", 0 ) // gfx data used at runtime
ROM_LOAD32_WORD_SWAP( "687i15.p13", 0x000000, 0x80000, CRC(eec8c5b2) SHA1(c400dd8c7bb85d233815572acd547acf626e4c73) )
ROM_LOAD32_WORD_SWAP( "687i17.p16", 0x000002, 0x80000, CRC(66cb3923) SHA1(3c1fc1dff77201cf8d8c4594c965695066c1701c) )
ROM_LOAD32_WORD_SWAP( "687i16.p15", 0x100000, 0x80000, CRC(746cf48b) SHA1(8f51df931b1de928f402f51bbaf02e37dfec1d6d) )
ROM_LOAD32_WORD_SWAP( "687i18.p18", 0x100002, 0x80000, CRC(a1c7d0db) SHA1(901bc6e1982b9a8c2150a802995256d0168cc605) )
ROM_REGION16_BE( 0x20000, "gfx3", 0 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION16_BE( 0x20000, "data", 0 ) // tile data; mapped at 0x80000 on CPUB
ROM_LOAD16_BYTE( "687_l11.10r", 0x00000, 0x10000, CRC(399deee8) SHA1(dcc65e95f28ae4e9b671e70ce0bd5ba0fe178506) )
ROM_LOAD16_BYTE( "687_l10.8r", 0x00001, 0x10000, CRC(117c91ee) SHA1(dcf8efb25fc73cff916b66b7bcfd3c1fb2556a53) )
@ -819,19 +818,19 @@ ROM_START( majuu )
ROM_LOAD16_BYTE( "687_q13.10s", 0x20000, 0x10000, CRC(36ae6014) SHA1(102d4c3215fb5f199ce6f93ce92725b5cce0b01d) )
ROM_LOAD16_BYTE( "687_q12.8s", 0x20001, 0x10000, CRC(6d012167) SHA1(d608e29e0b2e834c099386b6ebb667e4bfc40ce7) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "687_l03.10a", 0x00000, 0x8000, CRC(7201983c) SHA1(06d089406d2f702e8d51ffdfbf34e4727a28d506) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "687_l14.d8", 0x0000, 0x4000, CRC(20ecccd6) SHA1(b8ac3186de5ea81ae1c64b9511b7a0718aabab48) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD( "687_l14.d8", 0x0000, 0x4000, CRC(20ecccd6) SHA1(b8ac3186de5ea81ae1c64b9511b7a0718aabab48) )
ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime
ROM_REGION16_BE( 0x200000, "gfxrom", 0 ) // gfx data used at runtime
ROM_LOAD32_WORD_SWAP( "687i15.p13", 0x000000, 0x80000, CRC(eec8c5b2) SHA1(c400dd8c7bb85d233815572acd547acf626e4c73) )
ROM_LOAD32_WORD_SWAP( "687i17.p16", 0x000002, 0x80000, CRC(66cb3923) SHA1(3c1fc1dff77201cf8d8c4594c965695066c1701c) )
ROM_LOAD32_WORD_SWAP( "687i16.p15", 0x100000, 0x80000, CRC(746cf48b) SHA1(8f51df931b1de928f402f51bbaf02e37dfec1d6d) )
ROM_LOAD32_WORD_SWAP( "687i18.p18", 0x100002, 0x80000, CRC(a1c7d0db) SHA1(901bc6e1982b9a8c2150a802995256d0168cc605) )
ROM_REGION16_BE( 0x20000, "gfx3", 0 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION16_BE( 0x20000, "data", 0 ) // tile data; mapped at 0x80000 on CPUB
ROM_LOAD16_BYTE( "687_l11.10r", 0x00000, 0x10000, CRC(399deee8) SHA1(dcc65e95f28ae4e9b671e70ce0bd5ba0fe178506) )
ROM_LOAD16_BYTE( "687_l10.8r", 0x00001, 0x10000, CRC(117c91ee) SHA1(dcf8efb25fc73cff916b66b7bcfd3c1fb2556a53) )
@ -855,19 +854,19 @@ ROM_START( darkadv )
ROM_LOAD16_BYTE( "687_n13.10s", 0x20000, 0x10000, CRC(f1c252af) SHA1(dbe78352ae5b284870becc92139773f66c52ed7d) )
ROM_LOAD16_BYTE( "687_n12.8s", 0x20001, 0x10000, CRC(da221944) SHA1(c288ee583414a077f0d8b815b8e01b7f19a5fafe) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "687_n03.10a", 0x00000, 0x8000, CRC(a24c682f) SHA1(cf053270d3f77448ff802db832598ae3cf7dae6c) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "687_n14.d8", 0x0000, 0x4000, CRC(c76ac6d2) SHA1(d8fec255f1f7177a3716a5894fb679cbe172b6ea) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD( "687_n14.d8", 0x0000, 0x4000, CRC(c76ac6d2) SHA1(d8fec255f1f7177a3716a5894fb679cbe172b6ea) )
ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime
ROM_REGION16_BE( 0x200000, "gfxrom", 0 ) // gfx data used at runtime
ROM_LOAD32_WORD_SWAP( "687i15.p13", 0x000000, 0x80000, CRC(eec8c5b2) SHA1(c400dd8c7bb85d233815572acd547acf626e4c73) )
ROM_LOAD32_WORD_SWAP( "687i17.p16", 0x000002, 0x80000, CRC(66cb3923) SHA1(3c1fc1dff77201cf8d8c4594c965695066c1701c) )
ROM_LOAD32_WORD_SWAP( "687i16.p15", 0x100000, 0x80000, CRC(746cf48b) SHA1(8f51df931b1de928f402f51bbaf02e37dfec1d6d) )
ROM_LOAD32_WORD_SWAP( "687i18.p18", 0x100002, 0x80000, CRC(a1c7d0db) SHA1(901bc6e1982b9a8c2150a802995256d0168cc605) )
ROM_REGION16_BE( 0x20000, "gfx3", 0 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION16_BE( 0x20000, "data", 0 ) // tile data; mapped at 0x80000 on CPUB
ROM_LOAD16_BYTE( "687_l11.10r", 0x00000, 0x10000, CRC(399deee8) SHA1(dcc65e95f28ae4e9b671e70ce0bd5ba0fe178506) )
ROM_LOAD16_BYTE( "687_l10.8r", 0x00001, 0x10000, CRC(117c91ee) SHA1(dcf8efb25fc73cff916b66b7bcfd3c1fb2556a53) )
@ -891,19 +890,19 @@ ROM_START( vulcan )
ROM_LOAD16_BYTE( "785_p13.10s", 0x20000, 0x10000, CRC(478fdb0a) SHA1(2e285ad6dcfc67f3e24d231e0e1be19036ce64d2) )
ROM_LOAD16_BYTE( "785_p12.8s", 0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) )
ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime
ROM_REGION16_BE( 0x200000, "gfxrom", 0 ) // gfx data used at runtime
ROM_LOAD32_WORD_SWAP( "785f15.p13", 0x000000, 0x80000, CRC(5bd239ac) SHA1(9c96f6069d06a1d80c04650ed56bc5e1508db657) )
ROM_LOAD32_WORD_SWAP( "785f17.p16", 0x000002, 0x80000, CRC(4e7a7b82) SHA1(520b5ebd400954042d55cf243842a6d6b6d10210) )
ROM_LOAD32_WORD_SWAP( "785f16.p15", 0x100000, 0x80000, CRC(95c6b8a3) SHA1(0a906af72d08993fd83f23d72ffb919801aa17af) )
ROM_LOAD32_WORD_SWAP( "785f18.p18", 0x100002, 0x80000, CRC(3f604e9a) SHA1(c5e0b6f6dd506209e8c07cbae89c821828f488ff) )
ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION( 0x20000, "k007232", 0 ) // samples
ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) )
@ -925,19 +924,19 @@ ROM_START( vulcana )
ROM_LOAD16_BYTE( "785_p13.10s", 0x20000, 0x10000, CRC(478fdb0a) SHA1(2e285ad6dcfc67f3e24d231e0e1be19036ce64d2) )
ROM_LOAD16_BYTE( "785_p12.8s", 0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) )
ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime
ROM_REGION16_BE( 0x200000, "gfxrom", 0 ) // gfx data used at runtime
ROM_LOAD32_WORD_SWAP( "785f15.p13", 0x000000, 0x80000, CRC(5bd239ac) SHA1(9c96f6069d06a1d80c04650ed56bc5e1508db657) )
ROM_LOAD32_WORD_SWAP( "785f17.p16", 0x000002, 0x80000, CRC(4e7a7b82) SHA1(520b5ebd400954042d55cf243842a6d6b6d10210) )
ROM_LOAD32_WORD_SWAP( "785f16.p15", 0x100000, 0x80000, CRC(95c6b8a3) SHA1(0a906af72d08993fd83f23d72ffb919801aa17af) )
ROM_LOAD32_WORD_SWAP( "785f18.p18", 0x100002, 0x80000, CRC(3f604e9a) SHA1(c5e0b6f6dd506209e8c07cbae89c821828f488ff) )
ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION( 0x20000, "k007232", 0 ) // samples
ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) )
@ -959,19 +958,19 @@ ROM_START( vulcanb )
ROM_LOAD16_BYTE( "785_g13.10s", 0x20000, 0x10000, CRC(274f325d) SHA1(1076efa204eff0fc8a8788706b17b9a128023d35) )
ROM_LOAD16_BYTE( "785_g12.8s", 0x20001, 0x10000, CRC(1625f933) SHA1(3f25d7396af46e75e3ae8456414e31935de43d34) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD( "785_h14.d8", 0x0000, 0x4000, CRC(02f4b16f) SHA1(45addc99f520770f38c6aa69aef9af59cfc410b5) )
ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime
ROM_REGION16_BE( 0x200000, "gfxrom", 0 ) // gfx data used at runtime
ROM_LOAD32_WORD_SWAP( "785f15.p13", 0x000000, 0x80000, CRC(5bd239ac) SHA1(9c96f6069d06a1d80c04650ed56bc5e1508db657) )
ROM_LOAD32_WORD_SWAP( "785f17.p16", 0x000002, 0x80000, CRC(4e7a7b82) SHA1(520b5ebd400954042d55cf243842a6d6b6d10210) )
ROM_LOAD32_WORD_SWAP( "785f16.p15", 0x100000, 0x80000, CRC(95c6b8a3) SHA1(0a906af72d08993fd83f23d72ffb919801aa17af) )
ROM_LOAD32_WORD_SWAP( "785f18.p18", 0x100002, 0x80000, CRC(3f604e9a) SHA1(c5e0b6f6dd506209e8c07cbae89c821828f488ff) )
ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION( 0x20000, "k007232", 0 ) // samples
ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) )
@ -993,19 +992,19 @@ ROM_START( gradius2 )
ROM_LOAD16_BYTE( "785_p13.10s", 0x20000, 0x10000, CRC(478fdb0a) SHA1(2e285ad6dcfc67f3e24d231e0e1be19036ce64d2) )
ROM_LOAD16_BYTE( "785_p12.8s", 0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) )
ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime
ROM_REGION16_BE( 0x200000, "gfxrom", 0 ) // gfx data used at runtime
ROM_LOAD32_WORD_SWAP( "785f15.p13", 0x000000, 0x80000, CRC(5bd239ac) SHA1(9c96f6069d06a1d80c04650ed56bc5e1508db657) )
ROM_LOAD32_WORD_SWAP( "785f17.p16", 0x000002, 0x80000, CRC(4e7a7b82) SHA1(520b5ebd400954042d55cf243842a6d6b6d10210) )
ROM_LOAD32_WORD_SWAP( "785f16.p15", 0x100000, 0x80000, CRC(95c6b8a3) SHA1(0a906af72d08993fd83f23d72ffb919801aa17af) )
ROM_LOAD32_WORD_SWAP( "785f18.p18", 0x100002, 0x80000, CRC(3f604e9a) SHA1(c5e0b6f6dd506209e8c07cbae89c821828f488ff) )
ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION( 0x20000, "k007232", 0 ) // samples
ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) )
@ -1027,19 +1026,19 @@ ROM_START( gradius2a )
ROM_LOAD16_BYTE( "785_p13.10s", 0x20000, 0x10000, CRC(478fdb0a) SHA1(2e285ad6dcfc67f3e24d231e0e1be19036ce64d2) )
ROM_LOAD16_BYTE( "785_p12.8s", 0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) )
ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime
ROM_REGION16_BE( 0x200000, "gfxrom", 0 ) // gfx data used at runtime
ROM_LOAD32_WORD_SWAP( "785f15.p13", 0x000000, 0x80000, CRC(5bd239ac) SHA1(9c96f6069d06a1d80c04650ed56bc5e1508db657) )
ROM_LOAD32_WORD_SWAP( "785f17.p16", 0x000002, 0x80000, CRC(4e7a7b82) SHA1(520b5ebd400954042d55cf243842a6d6b6d10210) )
ROM_LOAD32_WORD_SWAP( "785f16.p15", 0x100000, 0x80000, CRC(95c6b8a3) SHA1(0a906af72d08993fd83f23d72ffb919801aa17af) )
ROM_LOAD32_WORD_SWAP( "785f18.p18", 0x100002, 0x80000, CRC(3f604e9a) SHA1(c5e0b6f6dd506209e8c07cbae89c821828f488ff) )
ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION( 0x20000, "k007232", 0 ) // samples
ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) )
@ -1061,19 +1060,19 @@ ROM_START( gradius2b )
ROM_LOAD16_BYTE( "785_p13.10s", 0x20000, 0x10000, CRC(478fdb0a) SHA1(2e285ad6dcfc67f3e24d231e0e1be19036ce64d2) )
ROM_LOAD16_BYTE( "785_p12.8s", 0x20001, 0x10000, CRC(38ea402a) SHA1(90ff2bd71435988cde967704ce3b1401de206683) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "785_g03.10a", 0x00000, 0x8000, CRC(67a3b50d) SHA1(3c83f3b0df73d9361ec3cda26a6c4c603a088419) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD( "785_g14.d8", 0x0000, 0x4000, CRC(9dcdad9d) SHA1(22f457408b453a71b7e91974aee1b1e735ff887f) )
ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime
ROM_REGION16_BE( 0x200000, "gfxrom", 0 ) // gfx data used at runtime
ROM_LOAD32_WORD_SWAP( "785f15.p13", 0x000000, 0x80000, CRC(5bd239ac) SHA1(9c96f6069d06a1d80c04650ed56bc5e1508db657) )
ROM_LOAD32_WORD_SWAP( "785f17.p16", 0x000002, 0x80000, CRC(4e7a7b82) SHA1(520b5ebd400954042d55cf243842a6d6b6d10210) )
ROM_LOAD32_WORD_SWAP( "785f16.p15", 0x100000, 0x80000, CRC(95c6b8a3) SHA1(0a906af72d08993fd83f23d72ffb919801aa17af) )
ROM_LOAD32_WORD_SWAP( "785f18.p18", 0x100002, 0x80000, CRC(3f604e9a) SHA1(c5e0b6f6dd506209e8c07cbae89c821828f488ff) )
ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION( 0x20000, "k007232", 0 ) // samples
ROM_LOAD( "785_f01.5a", 0x00000, 0x20000, CRC(a0d8d69e) SHA1(2994e5740b7c099d55fb162a363a26ef1995c756) )
@ -1087,17 +1086,19 @@ ROM_START( fround )
ROM_LOAD16_BYTE( "870_m21.bin", 0x00000, 0x20000, CRC(436dbffb) SHA1(be8c8544f4d8ae86f216095753c6178a3cbf0e8d) )
ROM_LOAD16_BYTE( "870_m20.bin", 0x00001, 0x20000, CRC(b1c79d6a) SHA1(76e95e87eaa96ba694675fde7706540c584a36fb) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "870_f03.10a", 0x00000, 0x8000, CRC(a645c727) SHA1(e173e79130f187d090766664f1c478d47062749c) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) )
ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime
ROM_LOAD32_WORD_SWAP( "870c16.p15", 0x000000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) )
ROM_LOAD32_WORD_SWAP( "870c18.p18", 0x000002, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) )
ROM_LOAD32_WORD_SWAP( "870c15.p13", 0x100000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) )
ROM_LOAD32_WORD_SWAP( "870c17.p16", 0x100002, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) )
ROM_REGION16_BE( 0x100000, "tiles", 0 ) // tile gfx data
ROM_LOAD32_WORD_SWAP( "870c16.p15", 0x00000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) )
ROM_LOAD32_WORD_SWAP( "870c18.p18", 0x00002, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) )
ROM_REGION16_BE( 0x100000, "gfxrom", 0 ) // sprite gfx data
ROM_LOAD32_WORD_SWAP( "870c15.p13", 0x00000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) )
ROM_LOAD32_WORD_SWAP( "870c17.p16", 0x00002, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) )
ROM_REGION( 0x20000, "k007232", 0 ) // samples
ROM_LOAD( "870_c01.5a", 0x00000, 0x20000, CRC(6af96546) SHA1(63b49b28c0f2ef8f52bc4c5955ad6a633dd553cf) )
@ -1111,17 +1112,19 @@ ROM_START( froundl )
ROM_LOAD16_BYTE( "870_l21.bin", 0x00000, 0x20000, CRC(e21a3a19) SHA1(5f5793c88093bc8632eab673f5e0d954ac9b9177) )
ROM_LOAD16_BYTE( "870_l20.bin", 0x00001, 0x20000, CRC(0ce9786f) SHA1(0fb0eef999ed09dd50eed403255887103fc35461) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "870_f03.10a", 0x00000, 0x8000, CRC(a645c727) SHA1(e173e79130f187d090766664f1c478d47062749c) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) )
ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime
ROM_LOAD32_WORD_SWAP( "870c16.p15", 0x000000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) )
ROM_LOAD32_WORD_SWAP( "870c18.p18", 0x000002, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) )
ROM_LOAD32_WORD_SWAP( "870c15.p13", 0x100000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) )
ROM_LOAD32_WORD_SWAP( "870c17.p16", 0x100002, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) )
ROM_REGION16_BE( 0x100000, "tiles", 0 ) // tile gfx data
ROM_LOAD32_WORD_SWAP( "870c16.p15", 0x00000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) )
ROM_LOAD32_WORD_SWAP( "870c18.p18", 0x00002, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) )
ROM_REGION16_BE( 0x100000, "gfxrom", 0 ) // sprite gfx data
ROM_LOAD32_WORD_SWAP( "870c15.p13", 0x00000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) )
ROM_LOAD32_WORD_SWAP( "870c17.p16", 0x00002, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) )
ROM_REGION( 0x20000, "k007232", 0 ) // samples
ROM_LOAD( "870_c01.5a", 0x00000, 0x20000, CRC(6af96546) SHA1(63b49b28c0f2ef8f52bc4c5955ad6a633dd553cf) )
@ -1141,19 +1144,19 @@ ROM_START( hpuncher )
ROM_LOAD16_BYTE( "870_h07.10n", 0x00000, 0x10000, CRC(b4dda612) SHA1(e9612af11a151de1f0236629c84679f80936cae9) )
ROM_LOAD16_BYTE( "870_h06.8n", 0x00001, 0x10000, CRC(696ba702) SHA1(e35c9aeab4305d828a347eaddf4abc806a889fa3) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "870_g03.10a", 0x00000, 0x8000, CRC(db9c10c8) SHA1(b2ec4d6800a4ab00dfcc8d3cd4abf9b9d7c5544a) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD( "870_f14.d8", 0x0000, 0x4000, CRC(c9b46615) SHA1(c0cddb1af47b8e0865055624cf4e89a111ac1b0f) )
ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime
ROM_REGION16_BE( 0x200000, "gfxrom", 0 ) // gfx data used at runtime
ROM_LOAD32_WORD_SWAP( "870c15.p13", 0x000000, 0x80000, CRC(8c9281df) SHA1(5e3d80be414db108d5363d0ea1b74021ba942c33) )
ROM_LOAD32_WORD_SWAP( "870c17.p16", 0x000002, 0x80000, CRC(2bc99ff8) SHA1(9a06502317a71ca5662b79aedf47379b8e5434a9) )
ROM_LOAD32_WORD_SWAP( "870c16.p15", 0x100000, 0x80000, CRC(41df6a1b) SHA1(32e0fdeb53628d18adde851e4496dd01ac6ec68f) )
ROM_LOAD32_WORD_SWAP( "870c18.p18", 0x100002, 0x80000, CRC(07927fe8) SHA1(0ab5e0e785347fbed5c4b930a32876d6ce2bef4a) )
ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION( 0x20000, "k007232", 0 ) // samples
ROM_LOAD( "870_c01.5a", 0x00000, 0x20000, CRC(6af96546) SHA1(63b49b28c0f2ef8f52bc4c5955ad6a633dd553cf) )
@ -1175,17 +1178,17 @@ ROM_START( miaj )
ROM_LOAD16_BYTE("808_e13.10s", 0x20000, 0x10000, CRC(1fa708f4) SHA1(9511a19f50fb61571c2986c72d1a85e87b8d0495) )
ROM_LOAD16_BYTE("808_e12.8s", 0x20001, 0x10000, CRC(d62f1fde) SHA1(1e55084f1294b6ac7c152fcd1800511fcab5d360) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "808_e03.10a", 0x00000, 0x8000, CRC(3d93a7cd) SHA1(dcdd327e78f32436b276d0666f62a5b733b296e8) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD("808_e14.d8", 0x0000, 0x4000, CRC(b9d36525) SHA1(53291c4911d7e1a5110539e4c57a11d0d530dc6f) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD("808_e14.d8", 0x0000, 0x4000, CRC(b9d36525) SHA1(53291c4911d7e1a5110539e4c57a11d0d530dc6f) )
ROM_REGION16_BE( 0x200000, "gfx2", 0 ) // gfx data used at runtime
ROM_REGION16_BE( 0x200000, "gfxrom", 0 ) // gfx data used at runtime
ROM_LOAD32_WORD_SWAP("808d15.p13", 0x000000, 0x80000, CRC(2b22a6b6) SHA1(8e1af0627a4eac045128c4096e2cfb59c3d2f5ef) )
ROM_LOAD32_WORD_SWAP("808d17.p16", 0x000002, 0x80000, CRC(d1299082) SHA1(c3c07b0517e7428ccd1cdf9e15aaf16d98e7c4cd) )
ROM_REGION( 0x20000, "gfx3", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION16_BE( 0x20000, "data", ROMREGION_ERASE00 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION( 0x20000, "k007232", 0 ) // samples
ROM_LOAD("808_d01.5a", 0x00000, 0x20000, CRC(fd4d37c0) SHA1(ef91c6e7bb57c27a9a51729fffd1bfe3e806fb61) )
@ -1206,16 +1209,16 @@ ROM_START( cuebrickj )
ROM_LOAD16_BYTE( "903_e13.10s", 0x20000, 0x10000, CRC(4fb5fb80) SHA1(3a59dae3846341289c31aa106684ebc45488ca45) )
ROM_LOAD16_BYTE( "903_e12.8s", 0x20001, 0x10000, CRC(883e3097) SHA1(fe0fa1a2881a67223d741c400bb8c1a0c67946c1) )
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code (sound CPU)
ROM_LOAD( "903_d03.10a", 0x00000, 0x8000, CRC(455e855a) SHA1(cfdd54a5071862653ee94c0455301f4a7245fbd8) )
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "903_e14.d8", 0x0000, 0x4000, CRC(ddbebbd5) SHA1(df532f19a08cabb28d693e4cd445c47c9e35e5ff) ) /* Title screen graphics & characters */
ROM_REGION( 0x4000, "fixed", 0 ) // title screen graphics & characters
ROM_LOAD( "903_e14.d8", 0x0000, 0x4000, CRC(ddbebbd5) SHA1(df532f19a08cabb28d693e4cd445c47c9e35e5ff) )
ROM_REGION( 0x200000, "gfx2", ROMREGION_ERASE00 ) // gfx data used at runtime
ROM_REGION16_BE( 0x200000, "gfxrom", ROMREGION_ERASE00 ) // gfx data used at runtime
// unpopulated
ROM_REGION16_BE( 0x20000, "gfx3", 0 ) // tile data; mapped at 0x80000 on CPUB
ROM_REGION16_BE( 0x20000, "data", 0 ) // tile data; mapped at 0x80000 on CPUB
ROM_LOAD16_BYTE( "903_e11.10r", 0x00000, 0x10000, CRC(5c41faf8) SHA1(f9eee6a7b92d3b3aa4320747da6390310522a2cf) )
ROM_LOAD16_BYTE( "903_e10.8r", 0x00001, 0x10000, CRC(417576d4) SHA1(e84762743e3a1117b6ef7ea0b304877e4a719f75) )
@ -1230,12 +1233,14 @@ ROM_END
DRIVER_INIT_MEMBER(twin16_state,twin16)
{
m_custom_video = 0;
m_is_fround = false;
m_gfxrombank->configure_entries(0, 2, memregion("gfxrom")->base() + 0x100000, 0x80000);
m_gfxrombank->set_entry(0);
}
DRIVER_INIT_MEMBER(twin16_state,fround)
DRIVER_INIT_MEMBER(fround_state,fround)
{
m_custom_video = 1;
m_is_fround = true;
}
WRITE8_MEMBER(cuebrickj_state::nvram_bank_w)
@ -1245,6 +1250,8 @@ WRITE8_MEMBER(cuebrickj_state::nvram_bank_w)
DRIVER_INIT_MEMBER(cuebrickj_state,cuebrickj)
{
DRIVER_INIT_CALL(twin16);
address_space &space = m_maincpu->space(AS_PROGRAM);
space.install_readwrite_bank(0x0b0000, 0x0b03ff, "nvrambank");
@ -1255,8 +1262,6 @@ DRIVER_INIT_MEMBER(cuebrickj_state,cuebrickj)
machine().device<nvram_device>("nvram")->set_base(m_nvram, sizeof(m_nvram));
save_item(NAME(m_nvram));
m_custom_video = 0;
}
/* Game Drivers */
@ -1272,8 +1277,8 @@ GAME( 1988, gradius2, vulcan, twin16, gradius2, twin16_state, twin16,
GAME( 1988, gradius2a, vulcan, twin16, vulcan, twin16_state, twin16, ROT0, "Konami", "Gradius II - GOFER no Yabou (Japan Old Ver.)", GAME_SUPPORTS_SAVE )
GAME( 1988, gradius2b, vulcan, twin16, vulcan, twin16_state, twin16, ROT0, "Konami", "Gradius II - GOFER no Yabou (Japan Older Ver.)", GAME_SUPPORTS_SAVE )
GAME( 1988, fround, 0, fround, fround, twin16_state, fround, ROT0, "Konami", "The Final Round (version M)", GAME_SUPPORTS_SAVE )
GAME( 1988, froundl, fround, fround, fround, twin16_state, fround, ROT0, "Konami", "The Final Round (version L)", GAME_SUPPORTS_SAVE )
GAME( 1988, fround, 0, fround, fround, fround_state, fround, ROT0, "Konami", "The Final Round (version M)", GAME_SUPPORTS_SAVE )
GAME( 1988, froundl, fround, fround, fround, fround_state, fround, ROT0, "Konami", "The Final Round (version L)", GAME_SUPPORTS_SAVE )
GAME( 1988, hpuncher, fround, twin16, fround, twin16_state, twin16, ROT0, "Konami", "Hard Puncher (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1989, miaj, mia, miaj, miaj, twin16_state, twin16, ROT0, "Konami", "M.I.A. - Missing in Action (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1989, cuebrickj, cuebrick, cuebrickj, cuebrickj, cuebrickj_state, cuebrickj, ROT0, "Konami", "Cue Brick (Japan)", GAME_SUPPORTS_SAVE )

View File

@ -29,8 +29,7 @@ public:
m_audiocpu(*this, "audiocpu"),
m_oki1(*this, "oki1"),
m_oki2(*this, "oki2"),
m_region_maincpu(*this, "maincpu"),
m_region_oki1(*this, "oki1"),
m_rom_maincpu(*this, "maincpu"),
m_io_system(*this, "SYSTEM"),
m_io_p1(*this, "P1"),
m_io_p2(*this, "P2"),
@ -48,8 +47,7 @@ public:
optional_device<cpu_device> m_audiocpu;
optional_device<okim6295_device> m_oki1;
optional_device<okim6295_device> m_oki2;
required_memory_region m_region_maincpu;
optional_memory_region m_region_oki1;
required_rom_ptr<UINT16> m_rom_maincpu;
required_ioport m_io_system;
required_ioport m_io_p1;
required_ioport m_io_p2;
@ -64,7 +62,6 @@ public:
UINT16 m_ip_select_values[5];
UINT8 m_ignore_oki_status;
UINT16 m_protection_val;
int m_bank;
int m_scrollx[3];
int m_scrolly[3];
int m_active_layers;

View File

@ -7,76 +7,106 @@ class twin16_state : public driver_device
public:
twin16_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_spriteram(*this, "spriteram") ,
m_text_ram(*this, "text_ram"),
m_videoram(*this, "videoram"),
m_tile_gfx_ram(*this, "tile_gfx_ram"),
m_sprite_gfx_ram(*this, "sprite_gfx_ram"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_subcpu(*this, "sub"),
m_audiocpu(*this, "audiocpu"),
m_k007232(*this, "k007232"),
m_upd7759(*this, "upd"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette") { }
m_palette(*this, "palette"),
m_spriteram(*this, "spriteram"),
m_gfxrombank(*this, "gfxrombank"),
m_fixram(*this, "fixram"),
m_videoram(*this, "videoram"),
m_zipram(*this, "zipram"),
m_sprite_gfx_ram(*this, "sprite_gfx_ram"),
m_gfxrom(*this, "gfxrom") { }
required_device<buffered_spriteram16_device> m_spriteram;
required_shared_ptr<UINT16> m_text_ram;
required_shared_ptr<UINT16> m_videoram;
optional_shared_ptr<UINT16> m_tile_gfx_ram;
optional_shared_ptr<UINT16> m_sprite_gfx_ram;
UINT16 m_CPUA_register;
UINT16 m_CPUB_register;
UINT16 m_custom_video;
UINT16 *m_gfx_rom;
UINT16 m_sprite_buffer[0x800];
emu_timer *m_sprite_timer;
int m_sprite_busy;
int m_need_process_spriteram;
UINT16 m_gfx_bank;
UINT16 m_scrollx[3];
UINT16 m_scrolly[3];
UINT16 m_video_register;
tilemap_t *m_text_tilemap;
DECLARE_READ16_MEMBER(twin16_gfx_rom1_r);
DECLARE_READ16_MEMBER(twin16_gfx_rom2_r);
DECLARE_WRITE16_MEMBER(twin16_CPUA_register_w);
DECLARE_WRITE16_MEMBER(twin16_CPUB_register_w);
DECLARE_WRITE16_MEMBER(fround_CPU_register_w);
DECLARE_WRITE16_MEMBER(twin16_text_ram_w);
DECLARE_WRITE16_MEMBER(fround_gfx_bank_w);
DECLARE_WRITE16_MEMBER(twin16_video_register_w);
DECLARE_READ16_MEMBER(twin16_sprite_status_r);
DECLARE_READ8_MEMBER(twin16_upd_busy_r);
DECLARE_WRITE8_MEMBER(twin16_upd_reset_w);
DECLARE_WRITE8_MEMBER(twin16_upd_start_w);
DECLARE_DRIVER_INIT(twin16);
DECLARE_DRIVER_INIT(fround);
TILE_GET_INFO_MEMBER(get_text_tile_info);
DECLARE_MACHINE_START(twin16);
DECLARE_MACHINE_RESET(twin16);
DECLARE_VIDEO_START(twin16);
UINT32 screen_update_twin16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_twin16(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(CPUA_interrupt);
INTERRUPT_GEN_MEMBER(CPUB_interrupt);
TIMER_CALLBACK_MEMBER(twin16_sprite_tick);
int twin16_set_sprite_timer( );
void twin16_spriteram_process( );
void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap );
void draw_layer( screen_device &screen, bitmap_ind16 &bitmap, int opaque );
int twin16_spriteram_process_enable( );
DECLARE_WRITE8_MEMBER(volume_callback);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
optional_device<cpu_device> m_subcpu;
required_device<cpu_device> m_audiocpu;
required_device<k007232_device> m_k007232;
required_device<upd7759_device> m_upd7759;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_device<buffered_spriteram16_device> m_spriteram;
optional_memory_bank m_gfxrombank;
required_shared_ptr<UINT16> m_fixram;
required_shared_ptr_array<UINT16, 2> m_videoram;
optional_shared_ptr<UINT16> m_zipram;
optional_shared_ptr<UINT16> m_sprite_gfx_ram;
required_rom_ptr<UINT16> m_gfxrom;
UINT16 m_CPUA_register;
UINT16 m_CPUB_register;
bool m_is_fround;
UINT16 m_sprite_buffer[0x800];
emu_timer *m_sprite_timer;
int m_sprite_busy;
int m_need_process_spriteram;
UINT16 m_scrollx[3];
UINT16 m_scrolly[3];
UINT16 m_video_register;
tilemap_t *m_fixed_tmap;
tilemap_t *m_scroll_tmap[2];
DECLARE_WRITE16_MEMBER(CPUA_register_w);
DECLARE_WRITE16_MEMBER(CPUB_register_w);
DECLARE_READ16_MEMBER(sprite_status_r);
DECLARE_WRITE16_MEMBER(video_register_w);
DECLARE_WRITE16_MEMBER(fixram_w);
DECLARE_WRITE16_MEMBER(videoram0_w);
DECLARE_WRITE16_MEMBER(videoram1_w);
DECLARE_WRITE16_MEMBER(zipram_w);
DECLARE_READ8_MEMBER(upd_busy_r);
DECLARE_WRITE8_MEMBER(upd_reset_w);
DECLARE_WRITE8_MEMBER(upd_start_w);
DECLARE_DRIVER_INIT(twin16);
TILE_GET_INFO_MEMBER(fix_tile_info);
TILE_GET_INFO_MEMBER(layer0_tile_info);
TILE_GET_INFO_MEMBER(layer1_tile_info);
UINT32 screen_update_twin16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_twin16(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(CPUA_interrupt);
INTERRUPT_GEN_MEMBER(CPUB_interrupt);
TIMER_CALLBACK_MEMBER(sprite_tick);
int set_sprite_timer( );
void spriteram_process( );
void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap );
int spriteram_process_enable( );
DECLARE_WRITE8_MEMBER(volume_callback);
protected:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
virtual void tile_get_info(tile_data &tileinfo, UINT16 data, int color_base);
};
class fround_state : public twin16_state
{
public:
fround_state(const machine_config &mconfig, device_type type, const char *tag)
: twin16_state(mconfig, type, tag)
{}
DECLARE_WRITE16_MEMBER(fround_CPU_register_w);
DECLARE_WRITE16_MEMBER(gfx_bank_w);
DECLARE_DRIVER_INIT(fround);
protected:
virtual void video_start();
virtual void tile_get_info(tile_data &tileinfo, UINT16 data, int color_base);
private:
UINT8 m_gfx_bank[4];
};
class cuebrickj_state : public twin16_state

View File

@ -4,11 +4,10 @@
TODO:
- convert background to tilemap
- clean up sprite system
- bad sprites in devilw, eg. odd colours for the mud/lava monster in the 1st level,
or wrong sprite-sprite priority sometimes -- check real arcade first
- unsure about some sprite preprocessor attributes (see twin16_spriteram_process)
- unsure about some sprite preprocessor attributes (see spriteram_process)
*/
@ -40,35 +39,100 @@ enum
};
WRITE16_MEMBER(twin16_state::twin16_text_ram_w)
WRITE16_MEMBER(twin16_state::fixram_w)
{
COMBINE_DATA(&m_text_ram[offset]);
m_text_tilemap->mark_tile_dirty(offset);
COMBINE_DATA(&m_fixram[offset]);
m_fixed_tmap->mark_tile_dirty(offset);
}
WRITE16_MEMBER(twin16_state::fround_gfx_bank_w)
WRITE16_MEMBER(twin16_state::videoram0_w)
{
COMBINE_DATA(&m_gfx_bank);
COMBINE_DATA(&m_videoram[0][offset]);
m_scroll_tmap[0]->mark_tile_dirty(offset);
}
WRITE16_MEMBER(twin16_state::twin16_video_register_w)
WRITE16_MEMBER(twin16_state::videoram1_w)
{
COMBINE_DATA(&m_videoram[1][offset]);
m_scroll_tmap[1]->mark_tile_dirty(offset);
}
WRITE16_MEMBER(twin16_state::zipram_w)
{
UINT16 old = m_zipram[offset];
COMBINE_DATA(&m_zipram[offset]);
if (m_zipram[offset] != old)
m_gfxdecode->gfx(1)->mark_dirty(offset / 16);
}
WRITE16_MEMBER(fround_state::gfx_bank_w)
{
int changed = 0;
if (ACCESSING_BITS_0_7)
{
int oldbank0 = m_gfx_bank[0];
int oldbank1 = m_gfx_bank[1];
m_gfx_bank[0] = (data >> 0) & 0xf;
m_gfx_bank[1] = (data >> 4) & 0xf;
changed |= (oldbank0 ^ m_gfx_bank[0]) | (oldbank1 ^ m_gfx_bank[1]);
}
if (ACCESSING_BITS_8_15)
{
int oldbank2 = m_gfx_bank[2];
int oldbank3 = m_gfx_bank[3];
m_gfx_bank[2] = (data >> 8) & 0xf;
m_gfx_bank[3] = (data >> 12) & 0xf;
changed |= (oldbank2 ^ m_gfx_bank[2]) | (oldbank3 ^ m_gfx_bank[3]);
}
if (changed)
{
m_scroll_tmap[0]->mark_all_dirty();
m_scroll_tmap[1]->mark_all_dirty();
}
}
WRITE16_MEMBER(twin16_state::video_register_w)
{
int text_flip;
switch (offset)
{
case 0:
{
int old = m_video_register;
COMBINE_DATA( &m_video_register );
text_flip = (m_video_register&TWIN16_SCREEN_FLIPX) ? TILEMAP_FLIPX : 0;
text_flip |= (m_video_register&TWIN16_SCREEN_FLIPY) ? TILEMAP_FLIPY : 0;
m_text_tilemap->set_flip(text_flip);
int changed = old ^ m_video_register;
if (changed & (TWIN16_SCREEN_FLIPX | TWIN16_SCREEN_FLIPY))
{
int flip = (m_video_register&TWIN16_SCREEN_FLIPX) ? TILEMAP_FLIPX : 0;
flip |= (m_video_register&TWIN16_SCREEN_FLIPY) ? TILEMAP_FLIPY : 0;
machine().tilemap().set_flip_all(flip);
}
if (changed & (TWIN16_TILE_FLIPX | TWIN16_TILE_FLIPY))
{
m_scroll_tmap[0]->mark_all_dirty();
m_scroll_tmap[1]->mark_all_dirty();
}
break;
}
case 1: COMBINE_DATA( &m_scrollx[0] ); break;
case 2: COMBINE_DATA( &m_scrolly[0] ); break;
case 3: COMBINE_DATA( &m_scrollx[1] ); break;
case 4: COMBINE_DATA( &m_scrolly[1] ); break;
case 5: COMBINE_DATA( &m_scrollx[2] ); break;
case 6: COMBINE_DATA( &m_scrolly[2] ); break;
case 3:
COMBINE_DATA( &m_scrollx[1] );
m_scroll_tmap[0]->set_scrollx(0, m_scrollx[1]);
break;
case 4:
COMBINE_DATA( &m_scrolly[1] );
m_scroll_tmap[0]->set_scrolly(0, m_scrolly[1]);
break;
case 5:
COMBINE_DATA( &m_scrollx[2] );
m_scroll_tmap[1]->set_scrollx(0, m_scrollx[2]);
break;
case 6:
COMBINE_DATA( &m_scrolly[2] );
m_scroll_tmap[1]->set_scrolly(0, m_scrolly[2]);
break;
default:
logerror("unknown video_register write:%d", data );
@ -122,18 +186,18 @@ WRITE16_MEMBER(twin16_state::twin16_video_register_w)
* 3 | ------------xxxx | color
*/
READ16_MEMBER(twin16_state::twin16_sprite_status_r)
READ16_MEMBER(twin16_state::sprite_status_r)
{
// bit 0: busy, other bits: dunno
return m_sprite_busy;
}
TIMER_CALLBACK_MEMBER(twin16_state::twin16_sprite_tick)
TIMER_CALLBACK_MEMBER(twin16_state::sprite_tick)
{
m_sprite_busy = 0;
}
int twin16_state::twin16_set_sprite_timer( )
int twin16_state::set_sprite_timer( )
{
if (m_sprite_busy) return 1;
@ -144,7 +208,7 @@ int twin16_state::twin16_set_sprite_timer( )
return 0;
}
void twin16_state::twin16_spriteram_process( )
void twin16_state::spriteram_process( )
{
UINT16 *spriteram16 = m_spriteram->live();
UINT16 dx = m_scrollx[0];
@ -153,7 +217,7 @@ void twin16_state::twin16_spriteram_process( )
const UINT16 *source = &spriteram16[0x0000];
const UINT16 *finish = &spriteram16[0x1800];
twin16_set_sprite_timer();
set_sprite_timer();
memset(&spriteram16[0x1800],0xff,0x800*sizeof(UINT16));
while( source<finish )
@ -229,9 +293,9 @@ void twin16_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap )
int flipx = attributes&0x0100;
int priority = (attributes&0x4000)?TWIN16_SPRITE_PRI_L1:TWIN16_SPRITE_PRI_L2;
if( m_custom_video ) {
if( m_is_fround ) {
/* fround board */
pen_data = m_gfx_rom + 0x80000;
pen_data = m_gfxrom;
}
else
{
@ -239,15 +303,15 @@ void twin16_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap )
{
/* bank select */
case 0:
pen_data = m_gfx_rom;
pen_data = m_gfxrom;
break;
case 1:
pen_data = m_gfx_rom + 0x40000;
pen_data = m_gfxrom + 0x40000;
break;
case 2:
pen_data = m_gfx_rom + 0x80000;
pen_data = m_gfxrom + 0x80000;
if( code&0x4000 ) pen_data += 0x40000;
break;
@ -326,141 +390,9 @@ void twin16_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap )
}
void twin16_state::draw_layer( screen_device &screen, bitmap_ind16 &bitmap, int opaque )
TILE_GET_INFO_MEMBER(twin16_state::fix_tile_info)
{
UINT16 *videoram = m_videoram;
const UINT16 *gfx_base;
const UINT16 *source = videoram;
int i, xxor, yxor;
int bank_table[4];
int dx, dy, palette;
int tile_flipx = m_video_register&TWIN16_TILE_FLIPX;
int tile_flipy = m_video_register&TWIN16_TILE_FLIPY;
if( ((m_video_register&TWIN16_PLANE_ORDER)?1:0) != opaque ) {
source += 0x1000;
dx = m_scrollx[2];
dy = m_scrolly[2];
palette = 1;
}
else {
source += 0x0000;
dx = m_scrollx[1];
dy = m_scrolly[1];
palette = 0;
}
if( m_custom_video ) {
/* fround board */
gfx_base = m_gfx_rom;
bank_table[3] = (m_gfx_bank>>(4*3))&0xf;
bank_table[2] = (m_gfx_bank>>(4*2))&0xf;
bank_table[1] = (m_gfx_bank>>(4*1))&0xf;
bank_table[0] = (m_gfx_bank>>(4*0))&0xf;
}
else {
gfx_base = m_tile_gfx_ram;
bank_table[0] = 0;
bank_table[1] = 1;
bank_table[2] = 2;
bank_table[3] = 3;
}
if( m_video_register&TWIN16_SCREEN_FLIPX )
{
dx = 256-dx-64;
tile_flipx = !tile_flipx;
}
if( m_video_register&TWIN16_SCREEN_FLIPY )
{
dy = 256-dy;
tile_flipy = !tile_flipy;
}
xxor = tile_flipx ? 7 : 0;
yxor = tile_flipy ? 7 : 0;
for( i=0; i<64*64; i++ )
{
int y1, y2, x1, x2;
int sx = (i%64)*8;
int sy = (i/64)*8;
int xpos,ypos;
if( m_video_register&TWIN16_SCREEN_FLIPX ) sx = 63*8 - sx;
if( m_video_register&TWIN16_SCREEN_FLIPY ) sy = 63*8 - sy;
xpos = (sx-dx)&0x1ff;
ypos = (sy-dy)&0x1ff;
if( xpos>=320 ) xpos -= 512;
if( ypos>=256 ) ypos -= 512;
x1 = MAX(xpos, 0);
x2 = MIN(xpos+7, bitmap.width()-1);
y1 = MAX(ypos, 0);
y2 = MIN(ypos+7, bitmap.height()-1);
if (x1 <= x2 && y1 <= y2)
{
int code = source[i];
/* fedcba9876543210
xxx------------- color
---xx----------- tile bank
-----xxxxxxxxxxx tile number
*/
const UINT16 *gfx_data = gfx_base + (code&0x7ff)*16 + bank_table[(code>>11)&0x3]*0x8000;
int color = (code>>13);
int pal_base = 16*(0x20+color+8*palette);
int x, y;
if( opaque )
{
for (y = y1; y <= y2; y++)
{
const UINT16 *gfxptr = gfx_data + ((y - ypos) ^ yxor) * 2;
UINT16 *dest = &bitmap.pix16(y);
UINT8 *pdest = &screen.priority().pix8(y);
for (x = x1; x <= x2; x++)
{
int effx = (x - xpos) ^ xxor;
UINT16 data = gfxptr[effx / 4];
dest[x] = pal_base + ((data >> 4*(~effx & 3)) & 0x0f);
pdest[x] |= TWIN16_BG_LAYER1;
}
}
}
else
{
for (y = y1; y <= y2; y++)
{
const UINT16 *gfxptr = gfx_data + ((y - ypos) ^ yxor) * 2;
UINT16 *dest = &bitmap.pix16(y);
UINT8 *pdest = &screen.priority().pix8(y);
for (x = x1; x <= x2; x++)
{
int effx = (x - xpos) ^ xxor;
UINT16 data = gfxptr[effx / 4];
UINT8 pen = (data >> 4*(~effx & 3)) & 0x0f;
if (pen)
{
dest[x] = pal_base + pen;
pdest[x] |= TWIN16_BG_LAYER2;
}
}
}
}
}
}
}
TILE_GET_INFO_MEMBER(twin16_state::get_text_tile_info)
{
const UINT16 *source = m_text_ram;
int attr = source[tile_index];
int attr = m_fixram[tile_index];
/* fedcba9876543210
-x-------------- yflip
--x------------- xflip
@ -477,18 +409,62 @@ TILE_GET_INFO_MEMBER(twin16_state::get_text_tile_info)
SET_TILE_INFO_MEMBER(0, code, color, flags);
}
VIDEO_START_MEMBER(twin16_state,twin16)
void twin16_state::tile_get_info(tile_data &tileinfo, UINT16 data, int color_base)
{
m_gfx_rom = (UINT16 *)memregion("gfx2")->base();
/* fedcba9876543210
xxx------------- color
---xxxxxxxxxxxxx tile number
*/
int code = (data & 0x1fff);
int color = color_base + (data >> 13);
int flags = 0;
if (m_video_register & TWIN16_TILE_FLIPX) flags |= TILE_FLIPX;
if (m_video_register & TWIN16_TILE_FLIPY) flags |= TILE_FLIPY;
SET_TILE_INFO_MEMBER(1, code, color, flags);
}
m_text_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(twin16_state::get_text_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
m_text_tilemap->set_transparent_pen(0);
void fround_state::tile_get_info(tile_data &tileinfo, UINT16 data, int color_base)
{
/* fedcba9876543210
xxx------------- color
---xx----------- tile bank
-----xxxxxxxxxxx tile number
*/
int bank = (data >> 11) & 3;
int code = (m_gfx_bank[bank] << 11) | (data & 0x7ff);
int color = color_base | (data >> 13);
int flags = 0;
if (m_video_register & TWIN16_TILE_FLIPX) flags |= TILE_FLIPX;
if (m_video_register & TWIN16_TILE_FLIPY) flags |= TILE_FLIPY;
SET_TILE_INFO_MEMBER(1, code, color, flags);
}
TILE_GET_INFO_MEMBER(twin16_state::layer0_tile_info)
{
tile_get_info(tileinfo, m_videoram[0][tile_index], 0);
}
TILE_GET_INFO_MEMBER(twin16_state::layer1_tile_info)
{
tile_get_info(tileinfo, m_videoram[1][tile_index], 8);
}
void twin16_state::video_start()
{
m_fixed_tmap = &machine().tilemap().create(m_gfxdecode,tilemap_get_info_delegate(FUNC(twin16_state::fix_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
m_scroll_tmap[0] = &machine().tilemap().create(m_gfxdecode,tilemap_get_info_delegate(FUNC(twin16_state::layer0_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
m_scroll_tmap[1] = &machine().tilemap().create(m_gfxdecode,tilemap_get_info_delegate(FUNC(twin16_state::layer1_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
m_fixed_tmap->set_transparent_pen(0);
m_scroll_tmap[0]->set_transparent_pen(0);
m_scroll_tmap[1]->set_transparent_pen(0);
m_palette->set_shadow_factor(0.4); // screenshots estimate
memset(m_sprite_buffer,0xff,0x800*sizeof(UINT16));
m_video_register = 0;
m_sprite_busy = 0;
m_sprite_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(twin16_state::twin16_sprite_tick),this));
m_sprite_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(twin16_state::sprite_tick),this));
m_sprite_timer->adjust(attotime::never);
/* register for savestates */
@ -497,19 +473,26 @@ VIDEO_START_MEMBER(twin16_state,twin16)
save_item(NAME(m_scrolly));
save_item(NAME(m_need_process_spriteram));
save_item(NAME(m_gfx_bank));
save_item(NAME(m_video_register));
save_item(NAME(m_sprite_busy));
}
void fround_state::video_start()
{
twin16_state::video_start();
save_item(NAME(m_gfx_bank));
}
UINT32 twin16_state::screen_update_twin16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
screen.priority().fill(0, cliprect);
draw_layer( screen, bitmap, 1 );
draw_layer( screen, bitmap, 0 );
int layer = m_video_register & TWIN16_PLANE_ORDER ? 0 : 1;
m_scroll_tmap[layer]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, TWIN16_BG_LAYER1, 0);
m_scroll_tmap[layer^1]->draw(screen, bitmap, cliprect, 0, TWIN16_BG_LAYER2);
draw_sprites( screen, bitmap );
m_text_tilemap->draw(screen, bitmap, cliprect, 0, 0);
m_fixed_tmap->draw(screen, bitmap, cliprect, 0);
return 0;
}
@ -518,10 +501,10 @@ void twin16_state::screen_eof_twin16(screen_device &screen, bool state)
// rising edge
if (state)
{
twin16_set_sprite_timer();
set_sprite_timer();
if (twin16_spriteram_process_enable()) {
if (m_need_process_spriteram) twin16_spriteram_process();
if (spriteram_process_enable()) {
if (m_need_process_spriteram) spriteram_process();
m_need_process_spriteram = 1;
/* if the sprite preprocessor is used, sprite ram is copied to an external buffer first,