Haze: Converted capteven to using generic functions in deco16ic.c (no whatsnew)

This commit is contained in:
Scott Stone 2011-03-24 23:06:24 +00:00
parent 9bf7f29b6a
commit 719bac990c
20 changed files with 146 additions and 164 deletions

View File

@ -414,7 +414,7 @@ static int backfire_bank_callback( int bank )
static const deco16ic_interface backfire_deco16ic_intf = static const deco16ic_interface backfire_deco16ic_intf =
{ {
"lscreen", "lscreen",
0, 0, 1, 0, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0x00, 0x40, 0x10, 0x50, /* color base */ 0x00, 0x40, 0x10, 0x50, /* color base */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -311,7 +311,7 @@ static int boogwing_bank_callback2( const int bank )
static const deco16ic_interface boogwing_deco16ic_intf = static const deco16ic_interface boogwing_deco16ic_intf =
{ {
"screen", "screen",
0, 0, 1, 0, 0, 1, 1,
0x0f, 0x1f, 0x0f, 0x0f, /* trans masks (pf2 has 5bpp graphics) */ 0x0f, 0x1f, 0x0f, 0x0f, /* trans masks (pf2 has 5bpp graphics) */
0, 0, 0, 16, /* color base (pf2 is non default) */ 0, 0, 0, 16, /* color base (pf2 is non default) */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -283,7 +283,7 @@ static int twocrude_bank_callback( const int bank )
static const deco16ic_interface twocrude_deco16ic_intf = static const deco16ic_interface twocrude_deco16ic_intf =
{ {
"screen", "screen",
0, 0, 1, 0, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0x00, 0x20, 0x30, 0x40, /* color base (default values) */ 0x00, 0x20, 0x30, 0x40, /* color base (default values) */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -777,7 +777,7 @@ static int mutantf_2_bank_callback( const int bank )
static const deco16ic_interface cninja_deco16ic_intf = static const deco16ic_interface cninja_deco16ic_intf =
{ {
"screen", "screen",
0, 1, 1, 0, 1, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 48, /* color base */ 0, 16, 0, 48, /* color base */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */
@ -790,7 +790,7 @@ static const deco16ic_interface cninja_deco16ic_intf =
static const deco16ic_interface edrandy_deco16ic_intf = static const deco16ic_interface edrandy_deco16ic_intf =
{ {
"screen", "screen",
0, 0, 1, 0, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 48, /* color base */ 0, 16, 0, 48, /* color base */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */
@ -803,7 +803,7 @@ static const deco16ic_interface edrandy_deco16ic_intf =
static const deco16ic_interface robocop2_deco16ic_intf = static const deco16ic_interface robocop2_deco16ic_intf =
{ {
"screen", "screen",
0, 0, 1, 0, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 48, /* color base */ 0, 16, 0, 48, /* color base */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */
@ -816,7 +816,7 @@ static const deco16ic_interface robocop2_deco16ic_intf =
static const deco16ic_interface mutantf_deco16ic_intf = static const deco16ic_interface mutantf_deco16ic_intf =
{ {
"screen", "screen",
0, 0, 1, 0, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 0x30, 0x20, 0x40, /* color base */ 0, 0x30, 0x20, 0x40, /* color base */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -541,7 +541,7 @@ static int dassault_bank_callback( const int bank )
static const deco16ic_interface dassault_deco16ic_intf = static const deco16ic_interface dassault_deco16ic_intf =
{ {
"screen", "screen",
0, 0, 1, 0, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 16, /* color base (default values) */ 0, 16, 0, 16, /* color base (default values) */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -543,7 +543,7 @@ static int dblewing_bank_callback( const int bank )
static const deco16ic_interface dblewing_deco16ic_intf = static const deco16ic_interface dblewing_deco16ic_intf =
{ {
"screen", "screen",
1, 0, 1, 1, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 16, /* color base (default values) */ 0, 16, 0, 16, /* color base (default values) */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -315,7 +315,7 @@ static int deco156_bank_callback(const int bank)
static const deco16ic_interface deco156_deco16ic_intf = static const deco16ic_interface deco156_deco16ic_intf =
{ {
"screen", "screen",
1, 0, 1, 1, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 16, /* color base (default values) */ 0, 16, 0, 16, /* color base (default values) */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -253,7 +253,7 @@ static int fghthist_bank_callback( int bank )
static const deco16ic_interface fghthist_deco16ic_intf = static const deco16ic_interface fghthist_deco16ic_intf =
{ {
"screen", "screen",
0, 0, 1, 0, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0x00, 0x10, 0x20, 0x30, /* color base */ 0x00, 0x10, 0x20, 0x30, /* color base */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */
@ -728,6 +728,19 @@ static WRITE32_HANDLER( deco32_buffer_spriteram2_w )
memcpy(state->spriteram16_2_buffered, state->spriteram16_2, 0x1000); memcpy(state->spriteram16_2_buffered, state->spriteram16_2, 0x1000);
} }
static READ32_HANDLER( deco32_pf1_rowscroll_r ) { deco32_state *state = space->machine->driver_data<deco32_state>(); return state->pf1_rowscroll[offset] ^ 0xffff0000; }
static READ32_HANDLER( deco32_pf2_rowscroll_r ) { deco32_state *state = space->machine->driver_data<deco32_state>(); return state->pf2_rowscroll[offset] ^ 0xffff0000; }
static READ32_HANDLER( deco32_pf3_rowscroll_r ) { deco32_state *state = space->machine->driver_data<deco32_state>(); return state->pf3_rowscroll[offset] ^ 0xffff0000; }
static READ32_HANDLER( deco32_pf4_rowscroll_r ) { deco32_state *state = space->machine->driver_data<deco32_state>(); return state->pf4_rowscroll[offset] ^ 0xffff0000; }
static WRITE32_HANDLER( deco32_pf1_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
static WRITE32_HANDLER( deco32_pf2_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
static WRITE32_HANDLER( deco32_pf3_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf3_rowscroll[offset]); }
static WRITE32_HANDLER( deco32_pf4_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf4_rowscroll[offset]); }
static ADDRESS_MAP_START( captaven_map, ADDRESS_SPACE_PROGRAM, 32 ) static ADDRESS_MAP_START( captaven_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_RANGE(0x000000, 0x0fffff) AM_ROM
@ -746,30 +759,21 @@ static ADDRESS_MAP_START( captaven_map, ADDRESS_SPACE_PROGRAM, 32 )
AM_RANGE(0x178000, 0x178003) AM_WRITE(deco32_pri_w) AM_RANGE(0x178000, 0x178003) AM_WRITE(deco32_pri_w)
AM_RANGE(0x180000, 0x18001f) AM_RAM_WRITE(deco32_pf12_control_w) AM_BASE_MEMBER(deco32_state, pf12_control) AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("deco_custom", deco16ic_pf12_control_dword_r, deco16ic_pf12_control_dword_w)
AM_RANGE(0x190000, 0x191fff) AM_RAM_WRITE(deco32_pf1_data_w) AM_BASE_MEMBER(deco32_state, pf1_data) AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
AM_RANGE(0x192000, 0x193fff) AM_WRITE(deco32_pf1_data_w) /* Mirror address - bug in program code */ AM_RANGE(0x192000, 0x193fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) /* Mirror address - bug in program code */
AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(deco32_pf2_data_w) AM_BASE_MEMBER(deco32_state, pf2_data) AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
AM_RANGE(0x1a0000, 0x1a1fff) AM_RAM AM_BASE_MEMBER(deco32_state, pf1_rowscroll32) AM_RANGE(0x1a0000, 0x1a1fff) AM_READWRITE(deco32_pf1_rowscroll_r, deco32_pf1_rowscroll_w)
AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM AM_BASE_MEMBER(deco32_state, pf2_rowscroll32) AM_RANGE(0x1a4000, 0x1a5fff) AM_READWRITE(deco32_pf2_rowscroll_r, deco32_pf2_rowscroll_w)
AM_RANGE(0x1c0000, 0x1c001f) AM_RAM_WRITE(deco32_pf34_control_w) AM_BASE_MEMBER(deco32_state, pf34_control) AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("deco_custom", deco16ic_pf34_control_dword_r, deco16ic_pf34_control_dword_w)
AM_RANGE(0x1d0000, 0x1d1fff) AM_RAM_WRITE(deco32_pf3_data_w) AM_BASE_MEMBER(deco32_state, pf3_data) AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf3_data_dword_r, deco16ic_pf3_data_dword_w)
AM_RANGE(0x1e0000, 0x1e1fff) AM_RAM AM_BASE_MEMBER(deco32_state, pf3_rowscroll32) AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("deco_custom", deco16ic_pf4_data_dword_r, deco16ic_pf4_data_dword_w) // unused
AM_RANGE(0x1e0000, 0x1e1fff) AM_READWRITE(deco32_pf3_rowscroll_r, deco32_pf3_rowscroll_w)
AM_RANGE(0x1e4000, 0x1e5fff) AM_READWRITE(deco32_pf4_rowscroll_r, deco32_pf4_rowscroll_w) // unused
ADDRESS_MAP_END ADDRESS_MAP_END
static READ32_HANDLER( deco32_pf1_rowscroll_r ) { deco32_state *state = space->machine->driver_data<deco32_state>(); return state->pf1_rowscroll[offset] ^ 0xffff0000; }
static READ32_HANDLER( deco32_pf2_rowscroll_r ) { deco32_state *state = space->machine->driver_data<deco32_state>(); return state->pf2_rowscroll[offset] ^ 0xffff0000; }
static READ32_HANDLER( deco32_pf3_rowscroll_r ) { deco32_state *state = space->machine->driver_data<deco32_state>(); return state->pf3_rowscroll[offset] ^ 0xffff0000; }
static READ32_HANDLER( deco32_pf4_rowscroll_r ) { deco32_state *state = space->machine->driver_data<deco32_state>(); return state->pf4_rowscroll[offset] ^ 0xffff0000; }
static WRITE32_HANDLER( deco32_pf1_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
static WRITE32_HANDLER( deco32_pf2_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
static WRITE32_HANDLER( deco32_pf3_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf3_rowscroll[offset]); }
static WRITE32_HANDLER( deco32_pf4_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf4_rowscroll[offset]); }
static ADDRESS_MAP_START( fghthist_map, ADDRESS_SPACE_PROGRAM, 32 ) static ADDRESS_MAP_START( fghthist_map, ADDRESS_SPACE_PROGRAM, 32 )
// AM_RANGE(0x000000, 0x001fff) AM_ROM AM_WRITE(deco32_pf1_data_w) // wtf?? // AM_RANGE(0x000000, 0x001fff) AM_ROM AM_WRITE(deco32_pf1_data_w) // wtf??
AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_RANGE(0x000000, 0x0fffff) AM_ROM
@ -1640,9 +1644,9 @@ static const gfx_layout spritelayout5 =
}; };
static GFXDECODE_START( captaven ) static GFXDECODE_START( captaven )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 512, 32 ) /* Characters 8x8 */ GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 128 ) /* Characters 8x8 */
GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 512, 32 ) /* Tiles 16x16 */ GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0, 128 ) /* Tiles 16x16 */
GFXDECODE_ENTRY( "gfx2", 0, tilelayout2, 1024, 4 ) /* Tiles 16x16 */ GFXDECODE_ENTRY( "gfx2", 0, tilelayout2, 0, 128 ) /* Tiles 16x16 */
GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0, 32 ) /* Sprites 16x16 */ GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0, 32 ) /* Sprites 16x16 */
GFXDECODE_END GFXDECODE_END
@ -1760,6 +1764,29 @@ UINT16 captaven_pri_callback(UINT16 x)
} }
} }
static int captaven_bank_callback( int bank )
{
bank = bank >> 4;
bank = (bank & 2) >> 1;
return bank * 0x4000;
}
// pf4 not used (pf3 is in 8bpp mode)
static const deco16ic_interface captaven_deco16ic_intf =
{
"screen",
0, 0, 1, 0, // pf12only, split, fullwidth12 / fullwidth34
0x0f, 0x0f, 0xff, 0x00, /* trans masks (default values) */
0x20, 0x20, 0x10, 0x00, /* color base */
0x0f, 0x0f, 0x0f, 0x00, /* color masks (default values) */
0,
0,
captaven_bank_callback,
NULL,
};
static MACHINE_CONFIG_START( captaven, deco32_state ) static MACHINE_CONFIG_START( captaven, deco32_state )
/* basic machine hardware */ /* basic machine hardware */
@ -1785,6 +1812,8 @@ static MACHINE_CONFIG_START( captaven, deco32_state )
MCFG_GFXDECODE(captaven) MCFG_GFXDECODE(captaven)
MCFG_PALETTE_LENGTH(2048) MCFG_PALETTE_LENGTH(2048)
MCFG_DECO16IC_ADD("deco_custom", captaven_deco16ic_intf)
MCFG_DEVICE_ADD("spritegen", decospr_, 0) MCFG_DEVICE_ADD("spritegen", decospr_, 0)
decospr_device_config::set_gfx_region(device, 3); decospr_device_config::set_gfx_region(device, 3);
decospr_device_config::set_pri_callback(device, captaven_pri_callback); decospr_device_config::set_pri_callback(device, captaven_pri_callback);

View File

@ -180,7 +180,7 @@ static int dietgo_bank_callback(const int bank)
static const deco16ic_interface dietgo_deco16ic_intf = static const deco16ic_interface dietgo_deco16ic_intf =
{ {
"screen", "screen",
1, 0, 1, 1, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 16, /* color base (default values) */ 0, 16, 0, 16, /* color base (default values) */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -289,7 +289,7 @@ static const ym2151_interface ym2151_config =
static const deco16ic_interface funkyjet_deco16ic_intf = static const deco16ic_interface funkyjet_deco16ic_intf =
{ {
"screen", "screen",
1, 0, 1, 1, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 16, /* color base (default values) */ 0, 16, 0, 16, /* color base (default values) */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -290,7 +290,7 @@ static int mirage_bank_callback( const int bank )
static const deco16ic_interface mirage_deco16ic_intf = static const deco16ic_interface mirage_deco16ic_intf =
{ {
"screen", "screen",
1, 0, 1, 1, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 16, /* color base (default values) */ 0, 16, 0, 16, /* color base (default values) */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -300,7 +300,7 @@ static int pktgaldx_bank_callback( const int bank )
static const deco16ic_interface pktgaldx_deco16ic_intf = static const deco16ic_interface pktgaldx_deco16ic_intf =
{ {
"screen", "screen",
1, 0, 1, 1, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 16, /* color base (default values) */ 0, 16, 0, 16, /* color base (default values) */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -749,7 +749,7 @@ static int rohga_bank_callback( const int bank )
static const deco16ic_interface rohga_deco16ic_intf = static const deco16ic_interface rohga_deco16ic_intf =
{ {
"screen", "screen",
0, 0, 1, 0, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 16, /* color base (default values) */ 0, 16, 0, 16, /* color base (default values) */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */
@ -762,7 +762,7 @@ static const deco16ic_interface rohga_deco16ic_intf =
static const deco16ic_interface nitrobal_deco16ic_intf = static const deco16ic_interface nitrobal_deco16ic_intf =
{ {
"screen", "screen",
0, 0, 0, 0, 0, 0, 0,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 0, /* color base (pf4 is not default) */ 0, 16, 0, 0, /* color base (pf4 is not default) */
0x0f, 0x0f, 0, 0, /* color masks */ 0x0f, 0x0f, 0, 0, /* color masks */

View File

@ -407,7 +407,7 @@ static int simpl156_bank_callback(const int bank)
static const deco16ic_interface simpl156_deco16ic_intf = static const deco16ic_interface simpl156_deco16ic_intf =
{ {
"screen", "screen",
1, 0, 1, 1, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 16, /* color base (default values) */ 0, 16, 0, 16, /* color base (default values) */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -323,7 +323,7 @@ static const ym2151_interface ym2151_config =
static const deco16ic_interface supbtime_deco16ic_intf = static const deco16ic_interface supbtime_deco16ic_intf =
{ {
"screen", "screen",
1, 0, 1, 1, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 16, /* color base (default values) */ 0, 16, 0, 16, /* color base (default values) */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -288,7 +288,7 @@ static const ym2151_interface ym2151_config =
static const deco16ic_interface tumblep_deco16ic_intf = static const deco16ic_interface tumblep_deco16ic_intf =
{ {
"screen", "screen",
1, 0, 1, 1, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0, 16, 0, 16, /* color base (default values) */ 0, 16, 0, 16, /* color base (default values) */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -219,7 +219,7 @@ static int vaportra_bank_callback( const int bank )
static const deco16ic_interface vaportra_deco16ic_intf = static const deco16ic_interface vaportra_deco16ic_intf =
{ {
"screen", "screen",
0, 0, 1, 0, 0, 1, 1,
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
0x00, 0x20, 0x30, 0x40, /* color base */ 0x00, 0x20, 0x30, 0x40, /* color base */
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */ 0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */

View File

@ -149,22 +149,7 @@ Rowscroll style:
#include "video/deco16ic.h" #include "video/deco16ic.h"
#include "ui.h" #include "ui.h"
#if 0 /* Note, each device should have 2 tilemaps, not 4.. games with 4 chips use 2 devices.. this should be fixed here! */
void deco16ic_set_vram( const device_config *device, UINT8 *ram_bank )
{
deco16ic_state *deco16ic = get_safe_token(device);
deco16ic->vram = ram_bank;
}
UINT8 *deco16icvdp_get_vram( const device_config *device )
{
deco16ic_state *deco16ic = get_safe_token(device);
return deco16ic->vram;
}
#endif
typedef struct _deco16ic_state deco16ic_state; typedef struct _deco16ic_state deco16ic_state;
struct _deco16ic_state struct _deco16ic_state
@ -199,6 +184,8 @@ struct _deco16ic_state
int pf1_trans_mask, pf2_trans_mask, pf3_trans_mask, pf4_trans_mask; int pf1_trans_mask, pf2_trans_mask, pf3_trans_mask, pf4_trans_mask;
int pf12_last_small, pf12_last_big, pf34_last_big; int pf12_last_small, pf12_last_big, pf34_last_big;
int pf3_8bpp_mode;
}; };
/***************************************************************************** /*****************************************************************************
@ -349,12 +336,26 @@ static TILE_GET_INFO_DEVICE( get_pf3_tile_info )
} }
} }
if (deco16ic->pf3_8bpp_mode)
{
// Captain America operates this chip in 8bpp mode.
// In 8bpp mode you appear to only get 1 layer, not 2, but you also
// have an extra 2 tile bits, and 2 less colour bits.
SET_TILE_INFO_DEVICE(
deco16ic->pf34_16x16_gfx_bank,
(tile & 0x3fff) | deco16ic->pf3_bank,
((colour & deco16ic->pf3_colourmask) + deco16ic->pf3_colour_bank)>>2,
flags);
}
else
{
SET_TILE_INFO_DEVICE( SET_TILE_INFO_DEVICE(
deco16ic->pf34_16x16_gfx_bank, deco16ic->pf34_16x16_gfx_bank,
(tile & 0xfff) | deco16ic->pf3_bank, (tile & 0xfff) | deco16ic->pf3_bank,
(colour & deco16ic->pf3_colourmask) + deco16ic->pf3_colour_bank, ((colour & deco16ic->pf3_colourmask) + deco16ic->pf3_colour_bank),
flags); flags);
} }
}
static TILE_GET_INFO_DEVICE( get_pf2_tile_info ) static TILE_GET_INFO_DEVICE( get_pf2_tile_info )
{ {
@ -481,6 +482,7 @@ static TILE_GET_INFO_DEVICE( get_pf1_tile_info_b )
static void custom_tilemap_draw( static void custom_tilemap_draw(
device_t *device, device_t *device,
bitmap_t *bitmap, bitmap_t *bitmap,
const rectangle *cliprect,
tilemap_t *tilemap0_8x8, tilemap_t *tilemap0_8x8,
tilemap_t *tilemap0_16x16, tilemap_t *tilemap0_16x16,
tilemap_t *tilemap1_8x8, tilemap_t *tilemap1_8x8,
@ -513,11 +515,15 @@ static void custom_tilemap_draw(
if (!BIT(control0, 7)) if (!BIT(control0, 7))
return; return;
int starty = cliprect->min_y;
int endy = cliprect->max_y+1;
width_mask = src_bitmap0->width - 1; width_mask = src_bitmap0->width - 1;
height_mask = src_bitmap0->height - 1; height_mask = src_bitmap0->height - 1;
src_y = scrolly + 8; src_y = scrolly + starty;
for (y = 8; y < 248; y++)
for (y = starty; y < endy; y++)
{ {
if (rowscroll_ptr && BIT(control1, 6)) if (rowscroll_ptr && BIT(control1, 6))
src_x = scrollx + rowscroll_ptr[src_y / row_type]; src_x = scrollx + rowscroll_ptr[src_y / row_type];
@ -587,6 +593,13 @@ static void custom_tilemap_draw(
/******************************************************************************/ /******************************************************************************/
/* captain america seems to have a similar 8bpp feature to robocop2, investigate merging */
void deco16ic_set_pf3_8bpp_mode(device_t *device, int mode)
{
deco16ic_state *deco16ic = get_safe_token(device);
deco16ic->pf3_8bpp_mode = mode;
}
/* robocop 2 can switch between 2 tilemaps at 4bpp, or 1 at 8bpp */ /* robocop 2 can switch between 2 tilemaps at 4bpp, or 1 at 8bpp */
void deco16ic_set_tilemap_colour_mask( device_t *device, int tmap, int mask ) void deco16ic_set_tilemap_colour_mask( device_t *device, int tmap, int mask )
{ {
@ -716,12 +729,14 @@ WRITE16_DEVICE_HANDLER( deco16ic_pf12_control_w )
{ {
deco16ic_state *deco16ic = get_safe_token(device); deco16ic_state *deco16ic = get_safe_token(device);
COMBINE_DATA(&deco16ic->pf12_control[offset]); COMBINE_DATA(&deco16ic->pf12_control[offset]);
device->machine->primary_screen->update_partial(device->machine->primary_screen->vpos());
} }
WRITE16_DEVICE_HANDLER( deco16ic_pf34_control_w ) WRITE16_DEVICE_HANDLER( deco16ic_pf34_control_w )
{ {
deco16ic_state *deco16ic = get_safe_token(device); deco16ic_state *deco16ic = get_safe_token(device);
COMBINE_DATA(&deco16ic->pf34_control[offset]); COMBINE_DATA(&deco16ic->pf34_control[offset]);
device->machine->primary_screen->update_partial(device->machine->primary_screen->vpos());
} }
READ16_DEVICE_HANDLER( deco16ic_pf12_control_r ) READ16_DEVICE_HANDLER( deco16ic_pf12_control_r )
@ -799,18 +814,6 @@ WRITE32_DEVICE_HANDLER( deco16ic_pf4_data_dword_w )
} }
#if 0
void deco_allocate_sprite_bitmap(running_machine *machine)
{
/* Allow sprite bitmap to be used by Deco32 games as well */
int width = machine->primary_screen->width();
int height = machine->primary_screen->height();
sprite_priority_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16 );
}
#endif
/*****************************************************************************************/ /*****************************************************************************************/
static int deco16_pf_update( static int deco16_pf_update(
@ -1168,7 +1171,7 @@ void deco16ic_tilemap_1_draw( device_t *device, bitmap_t *bitmap, const rectangl
if (deco16ic->use_custom_pf1) if (deco16ic->use_custom_pf1)
{ {
custom_tilemap_draw(device, bitmap, deco16ic->pf1_tilemap_8x8, deco16ic->pf1_tilemap_16x16, 0, 0, deco16ic->pf1_rowscroll_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff, 0, 0, deco16ic->pf1_trans_mask, flags, priority); custom_tilemap_draw(device, bitmap, cliprect, deco16ic->pf1_tilemap_8x8, deco16ic->pf1_tilemap_16x16, 0, 0, deco16ic->pf1_rowscroll_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff, 0, 0, deco16ic->pf1_trans_mask, flags, priority);
} }
else else
{ {
@ -1185,7 +1188,7 @@ void deco16ic_tilemap_2_draw(device_t *device, bitmap_t *bitmap, const rectangle
if (deco16ic->use_custom_pf2) if (deco16ic->use_custom_pf2)
{ {
custom_tilemap_draw(device, bitmap, deco16ic->pf2_tilemap_8x8, deco16ic->pf2_tilemap_16x16, 0, 0, deco16ic->pf2_rowscroll_ptr, deco16ic->pf12_control[3], deco16ic->pf12_control[4], deco16ic->pf12_control[5] >> 8, deco16ic->pf12_control[6] >> 8, 0, 0, deco16ic->pf2_trans_mask, flags, priority); custom_tilemap_draw(device, bitmap, cliprect, deco16ic->pf2_tilemap_8x8, deco16ic->pf2_tilemap_16x16, 0, 0, deco16ic->pf2_rowscroll_ptr, deco16ic->pf12_control[3], deco16ic->pf12_control[4], deco16ic->pf12_control[5] >> 8, deco16ic->pf12_control[6] >> 8, 0, 0, deco16ic->pf2_trans_mask, flags, priority);
} }
else else
{ {
@ -1201,7 +1204,7 @@ void deco16ic_tilemap_3_draw(device_t *device, bitmap_t *bitmap, const rectangle
deco16ic_state *deco16ic = get_safe_token(device); deco16ic_state *deco16ic = get_safe_token(device);
if (deco16ic->use_custom_pf3) if (deco16ic->use_custom_pf3)
custom_tilemap_draw(device, bitmap, 0, deco16ic->pf3_tilemap_16x16, 0, 0, deco16ic->pf3_rowscroll_ptr, deco16ic->pf34_control[1], deco16ic->pf34_control[2], deco16ic->pf34_control[5] & 0xff, deco16ic->pf34_control[6] & 0xff, 0, 0, deco16ic->pf3_trans_mask, flags, priority); custom_tilemap_draw(device, bitmap, cliprect, 0, deco16ic->pf3_tilemap_16x16, 0, 0, deco16ic->pf3_rowscroll_ptr, deco16ic->pf34_control[1], deco16ic->pf34_control[2], deco16ic->pf34_control[5] & 0xff, deco16ic->pf34_control[6] & 0xff, 0, 0, deco16ic->pf3_trans_mask, flags, priority);
else if (deco16ic->pf3_tilemap_16x16) else if (deco16ic->pf3_tilemap_16x16)
tilemap_draw(bitmap, cliprect, deco16ic->pf3_tilemap_16x16, flags, priority); tilemap_draw(bitmap, cliprect, deco16ic->pf3_tilemap_16x16, flags, priority);
} }
@ -1211,7 +1214,7 @@ void deco16ic_tilemap_4_draw(device_t *device, bitmap_t *bitmap, const rectangle
deco16ic_state *deco16ic = get_safe_token(device); deco16ic_state *deco16ic = get_safe_token(device);
if (deco16ic->use_custom_pf4) if (deco16ic->use_custom_pf4)
custom_tilemap_draw(device, bitmap, 0, deco16ic->pf4_tilemap_16x16, 0, 0, deco16ic->pf4_rowscroll_ptr, deco16ic->pf34_control[3], deco16ic->pf34_control[4], deco16ic->pf34_control[5] >> 8, deco16ic->pf34_control[6] >> 8, 0, 0, deco16ic->pf4_trans_mask, flags, priority); custom_tilemap_draw(device, bitmap, cliprect, 0, deco16ic->pf4_tilemap_16x16, 0, 0, deco16ic->pf4_rowscroll_ptr, deco16ic->pf34_control[3], deco16ic->pf34_control[4], deco16ic->pf34_control[5] >> 8, deco16ic->pf34_control[6] >> 8, 0, 0, deco16ic->pf4_trans_mask, flags, priority);
else if (deco16ic->pf4_tilemap_16x16) else if (deco16ic->pf4_tilemap_16x16)
tilemap_draw(bitmap, cliprect, deco16ic->pf4_tilemap_16x16, flags, priority); tilemap_draw(bitmap, cliprect, deco16ic->pf4_tilemap_16x16, flags, priority);
} }
@ -1222,7 +1225,7 @@ void deco16ic_tilemap_4_draw(device_t *device, bitmap_t *bitmap, const rectangle
void deco16ic_tilemap_34_combine_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority) void deco16ic_tilemap_34_combine_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority)
{ {
deco16ic_state *deco16ic = get_safe_token(device); deco16ic_state *deco16ic = get_safe_token(device);
custom_tilemap_draw(device, bitmap, 0, deco16ic->pf3_tilemap_16x16, 0, deco16ic->pf4_tilemap_16x16, deco16ic->pf3_rowscroll_ptr, deco16ic->pf34_control[1], deco16ic->pf34_control[2], deco16ic->pf34_control[5] & 0xff, deco16ic->pf34_control[6] & 0xff, 0xf, 4, 0xff, flags, priority); custom_tilemap_draw(device, bitmap, cliprect, 0, deco16ic->pf3_tilemap_16x16, 0, deco16ic->pf4_tilemap_16x16, deco16ic->pf3_rowscroll_ptr, deco16ic->pf34_control[1], deco16ic->pf34_control[2], deco16ic->pf34_control[5] & 0xff, deco16ic->pf34_control[6] & 0xff, 0xf, 4, 0xff, flags, priority);
} }
@ -1266,16 +1269,16 @@ static DEVICE_START( deco16ic )
deco16ic->pf1_tilemap_8x8 = tilemap_create_device(device, get_pf1_tile_info_b, tilemap_scan_rows, 8, 8, 64, 32); deco16ic->pf1_tilemap_8x8 = tilemap_create_device(device, get_pf1_tile_info_b, tilemap_scan_rows, 8, 8, 64, 32);
if (intf->split) if (intf->split)
deco16ic->pf2_tilemap_16x16 = tilemap_create_device(device, get_pf2_tile_info, deco16_scan_rows, 16, 16, intf->full_width ? 64 : 32, 32); deco16ic->pf2_tilemap_16x16 = tilemap_create_device(device, get_pf2_tile_info, deco16_scan_rows, 16, 16, intf->full_width12 ? 64 : 32, 32);
else else
deco16ic->pf2_tilemap_16x16 = tilemap_create_device(device, get_pf2_tile_info, deco16_scan_rows, 16, 16, intf->full_width ? 64 : 32, 32); deco16ic->pf2_tilemap_16x16 = tilemap_create_device(device, get_pf2_tile_info, deco16_scan_rows, 16, 16, intf->full_width12 ? 64 : 32, 32);
deco16ic->pf2_tilemap_8x8 = tilemap_create_device(device, get_pf2_tile_info_b, tilemap_scan_rows, 8, 8, intf->full_width ? 64 : 32, 32); deco16ic->pf2_tilemap_8x8 = tilemap_create_device(device, get_pf2_tile_info_b, tilemap_scan_rows, 8, 8, intf->full_width12 ? 64 : 32, 32);
if (!intf->pf12_only) if (!intf->pf12_only)
{ {
deco16ic->pf4_tilemap_16x16 = tilemap_create_device(device, get_pf4_tile_info, deco16_scan_rows, 16, 16, intf->full_width ? 64 : 32, 32); deco16ic->pf4_tilemap_16x16 = tilemap_create_device(device, get_pf4_tile_info, deco16_scan_rows, 16, 16, intf->full_width34 ? 64 : 32, 32);
deco16ic->pf3_tilemap_16x16 = tilemap_create_device(device, get_pf3_tile_info, deco16_scan_rows, 16, 16, intf->full_width ? 64 : 32, 32); deco16ic->pf3_tilemap_16x16 = tilemap_create_device(device, get_pf3_tile_info, deco16_scan_rows, 16, 16, intf->full_width34 ? 64 : 32, 32);
} }
else else
{ {
@ -1297,6 +1300,7 @@ static DEVICE_START( deco16ic )
tilemap_set_transparent_pen(deco16ic->pf4_tilemap_16x16, 0); tilemap_set_transparent_pen(deco16ic->pf4_tilemap_16x16, 0);
} }
deco16ic->pf3_8bpp_mode = 0;
deco16ic->dirty_palette = auto_alloc_array_clear(device->machine, UINT8, 4096); deco16ic->dirty_palette = auto_alloc_array_clear(device->machine, UINT8, 4096);
deco16ic->raster_display_list = auto_alloc_array_clear(device->machine, UINT16, 20 * 256 / 2); deco16ic->raster_display_list = auto_alloc_array_clear(device->machine, UINT16, 20 * 256 / 2);
@ -1324,6 +1328,7 @@ static DEVICE_START( deco16ic )
device->save_item(NAME(deco16ic->pf12_last_small)); device->save_item(NAME(deco16ic->pf12_last_small));
device->save_item(NAME(deco16ic->pf12_last_big)); device->save_item(NAME(deco16ic->pf12_last_big));
device->save_item(NAME(deco16ic->pf34_last_big)); device->save_item(NAME(deco16ic->pf34_last_big));
device->save_item(NAME(deco16ic->pf3_8bpp_mode));
device->save_pointer(NAME(deco16ic->dirty_palette), 4096); device->save_pointer(NAME(deco16ic->dirty_palette), 4096);
device->save_pointer(NAME(deco16ic->raster_display_list), 20 * 256 / 2); device->save_pointer(NAME(deco16ic->raster_display_list), 20 * 256 / 2);

View File

@ -26,7 +26,8 @@ struct _deco16ic_interface
const char *screen; const char *screen;
int pf12_only; int pf12_only;
int split; int split;
int full_width; int full_width12;
int full_width34;
int trans_mask1, trans_mask2, trans_mask3, trans_mask4; int trans_mask1, trans_mask2, trans_mask3, trans_mask4;
int col_base1, col_base2, col_base3, col_base4; int col_base1, col_base2, col_base3, col_base4;
@ -118,6 +119,9 @@ void deco16ic_pdrawgfx(
void deco16ic_set_tilemap_colour_mask(device_t *device, int tmap, int mask); void deco16ic_set_tilemap_colour_mask(device_t *device, int tmap, int mask);
void deco16ic_pf34_set_gfxbank(device_t *device, int small, int big); void deco16ic_pf34_set_gfxbank(device_t *device, int small, int big);
/* used by captaven */
void deco16ic_set_pf3_8bpp_mode(device_t *device, int mode);
/* used by stoneage */ /* used by stoneage */
void deco16ic_set_scrolldx(device_t *device, int tmap, int size, int dx, int dx_if_flipped); void deco16ic_set_scrolldx(device_t *device, int tmap, int size, int dx, int dx_if_flipped);

View File

@ -647,13 +647,6 @@ static TILE_GET_INFO( get_pf4_tile_info )
SET_TILE_INFO(2,(tile&0xfff)|state->pf4_bank,colour+state->pf4_colourbank,flags); SET_TILE_INFO(2,(tile&0xfff)|state->pf4_bank,colour+state->pf4_colourbank,flags);
} }
/* Captain America tilemap chip 2 has different banking and colour from normal */
static TILE_GET_INFO( get_ca_pf3_tile_info )
{
deco32_state *state = machine->driver_data<deco32_state>();
int tile=state->pf3_data[tile_index];
SET_TILE_INFO(2,(tile&0x3fff)+state->pf3_bank,(tile >> 14)&3,0);
}
static TILE_GET_INFO( get_ll_pf3_tile_info ) static TILE_GET_INFO( get_ll_pf3_tile_info )
{ {
@ -690,38 +683,14 @@ static TILE_GET_INFO( get_ll_pf4_tile_info )
VIDEO_START( captaven ) VIDEO_START( captaven )
{ {
deco32_state *state = machine->driver_data<deco32_state>(); deco32_state *state = machine->driver_data<deco32_state>();
state->pf1_tilemap = tilemap_create(machine, get_pf1_tile_info, tilemap_scan_rows, 8, 8,64,32);
state->pf1a_tilemap =tilemap_create(machine, get_pf1a_tile_info, deco16_scan_rows,16,16,64,32);
state->pf2_tilemap = tilemap_create(machine, get_pf2_tile_info, deco16_scan_rows,16,16,64,32);
state->pf3_tilemap = tilemap_create(machine, get_ca_pf3_tile_info, tilemap_scan_rows,16,16,32,32);
tilemap_set_transparent_pen(state->pf1_tilemap,0);
tilemap_set_transparent_pen(state->pf1a_tilemap,0);
tilemap_set_transparent_pen(state->pf2_tilemap,0);
tilemap_set_transparent_pen(state->pf3_tilemap,0);
state->pf2_colourbank=16;
state->pf4_colourbank=0;
state->has_ace_ram=0; state->has_ace_ram=0;
} }
VIDEO_START( fghthist ) VIDEO_START( fghthist )
{ {
deco32_state *state = machine->driver_data<deco32_state>(); deco32_state *state = machine->driver_data<deco32_state>();
//state->pf1_tilemap = tilemap_create(machine, get_pf1_tile_info, tilemap_scan_rows, 8, 8,64,32);
//state->pf2_tilemap = tilemap_create(machine, get_pf2_tile_info, deco16_scan_rows, 16,16,64,32);
//state->pf3_tilemap = tilemap_create(machine, get_pf3_tile_info, deco16_scan_rows, 16,16,64,32);
//state->pf4_tilemap = tilemap_create(machine, get_pf4_tile_info, deco16_scan_rows, 16,16,64,32);
//state->pf1a_tilemap =0;
state->dirty_palette = auto_alloc_array(machine, UINT8, 4096); state->dirty_palette = auto_alloc_array(machine, UINT8, 4096);
machine->device<decospr_device>("spritegen")->alloc_sprite_bitmap(machine); machine->device<decospr_device>("spritegen")->alloc_sprite_bitmap(machine);
//tilemap_set_transparent_pen(state->pf1_tilemap,0);
//tilemap_set_transparent_pen(state->pf2_tilemap,0);
//tilemap_set_transparent_pen(state->pf3_tilemap,0);
//state->pf2_colourbank=state->pf4_colourbank=0;
state->has_ace_ram=0; state->has_ace_ram=0;
} }
@ -925,57 +894,32 @@ static void combined_tilemap_draw(running_machine* machine, bitmap_t *bitmap, co
SCREEN_UPDATE( captaven ) SCREEN_UPDATE( captaven )
{ {
deco32_state *state = screen->machine->driver_data<deco32_state>(); deco32_state *state = screen->machine->driver_data<deco32_state>();
int pf1_enable,pf2_enable,pf3_enable; state->deco16ic = screen->machine->device("deco_custom");
flip_screen_set(screen->machine, state->pf12_control[0]&0x80);
tilemap_set_flip_all(screen->machine,flip_screen_get(screen->machine) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); tilemap_set_flip_all(screen->machine,flip_screen_get(screen->machine) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
deco32_setup_scroll(state->pf1_tilemap, 256,(state->pf12_control[5]>>0)&0xff,(state->pf12_control[6]>>0)&0xff,state->pf12_control[2],state->pf12_control[1],state->pf1_rowscroll32,state->pf1_rowscroll32+0x200);
deco32_setup_scroll(state->pf1a_tilemap,512,(state->pf12_control[5]>>0)&0xff,(state->pf12_control[6]>>0)&0xff,state->pf12_control[2],state->pf12_control[1],state->pf1_rowscroll32,state->pf1_rowscroll32+0x200);
deco32_setup_scroll(state->pf2_tilemap, 512,(state->pf12_control[5]>>8)&0xff,(state->pf12_control[6]>>8)&0xff,state->pf12_control[4],state->pf12_control[3],state->pf2_rowscroll32,state->pf2_rowscroll32+0x200);
deco32_setup_scroll(state->pf3_tilemap, 512,(state->pf34_control[5]>>0)&0xff,(state->pf34_control[6]>>0)&0xff,state->pf34_control[4],state->pf34_control[3],state->pf3_rowscroll32,state->pf3_rowscroll32+0x200);
/* PF1 & PF2 only have enough roms for 1 bank */
state->pf1_bank=0;//(state->pf12_control[7]>> 4)&0xf;
state->pf2_bank=0;//(state->pf12_control[7]>>12)&0xf;
state->pf3_bank=(state->pf34_control[7]>> 4)&0xf;
if (state->pf34_control[7]&0x0020) state->pf3_bank=0x4000; else state->pf3_bank=0;
if (state->pf3_bank!=state->last_pf3_bank) tilemap_mark_all_tiles_dirty(state->pf3_tilemap);
state->last_pf3_bank=state->pf3_bank;
pf1_enable=state->pf12_control[5]&0x0080;
pf2_enable=state->pf12_control[5]&0x8000;
pf3_enable=state->pf34_control[5]&0x0080;
tilemap_set_enable(state->pf1_tilemap,pf1_enable);
tilemap_set_enable(state->pf1a_tilemap,pf1_enable);
tilemap_set_enable(state->pf2_tilemap,pf2_enable);
tilemap_set_enable(state->pf3_tilemap,pf3_enable);
bitmap_fill(screen->machine->priority_bitmap,cliprect,0); bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
if ((state->pri&1)==0) { bitmap_fill(bitmap,cliprect,screen->machine->pens[0x000]); // Palette index not confirmed
if (pf3_enable)
tilemap_draw(bitmap,cliprect,state->pf3_tilemap,TILEMAP_DRAW_OPAQUE,1);
else
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
tilemap_draw(bitmap,cliprect,state->pf2_tilemap,0,2); deco16ic_set_pf3_8bpp_mode(state->deco16ic, 1);
} else {
if (pf2_enable) { deco16ic_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll);
tilemap_draw(bitmap,cliprect,state->pf2_tilemap,0,1); deco16ic_pf34_update(state->deco16ic, state->pf3_rowscroll, state->pf4_rowscroll);
// pf4 not used (because pf3 is in 8bpp mode)
if ((state->pri&1)==0)
{
deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 1);
deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 2);
} }
else else
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); {
deco16ic_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 1);
tilemap_draw(bitmap,cliprect,state->pf3_tilemap,0,2); deco16ic_tilemap_3_draw(state->deco16ic, bitmap, cliprect, 0, 2);
} }
/* PF1 can be in 8x8 mode or 16x16 mode */ deco16ic_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 4);
if (state->pf12_control[6]&0x80)
tilemap_draw(bitmap,cliprect,state->pf1_tilemap,0,4);
else
tilemap_draw(bitmap,cliprect,state->pf1a_tilemap,0,4);
screen->machine->device<decospr_device>("spritegen")->set_alt_format(true); screen->machine->device<decospr_device>("spritegen")->set_alt_format(true);
screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram16_buffered, 0x400); screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram16_buffered, 0x400);