dooyong.cpp: clean up, encapsulate stuff, use derived machine configs, better represent the 16-bit text layer block on 8-bit machines

This commit is contained in:
Vas Crabb 2016-08-29 18:22:37 +10:00
parent 7d652e945f
commit 25b8ea2e48
3 changed files with 319 additions and 289 deletions

View File

@ -123,7 +123,7 @@ static ADDRESS_MAP_START( lastday_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
AM_RANGE(0xc013, 0xc013) AM_READ_PORT("DSWA")
AM_RANGE(0xc014, 0xc014) AM_READ_PORT("DSWB")
AM_RANGE(0xc800, 0xcfff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
AM_RANGE(0xd000, 0xdfff) AM_READWRITE(lastday_tx_r, lastday_tx_w)
AM_RANGE(0xe000, 0xefff) AM_RAM
AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE("spriteram")
ADDRESS_MAP_END
@ -133,7 +133,7 @@ static ADDRESS_MAP_START( pollux_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
AM_RANGE(0xc000, 0xcfff) AM_RAM
AM_RANGE(0xd000, 0xdfff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
AM_RANGE(0xe000, 0xefff) AM_READWRITE(lastday_tx_r, lastday_tx_w)
AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSWA") AM_WRITE(bankswitch_w)
AM_RANGE(0xf001, 0xf001) AM_READ_PORT("DSWB")
AM_RANGE(0xf002, 0xf002) AM_READ_PORT("P1")
@ -151,7 +151,7 @@ static ADDRESS_MAP_START( gulfstrm_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
AM_RANGE(0xc000, 0xcfff) AM_RAM
AM_RANGE(0xd000, 0xdfff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
AM_RANGE(0xe000, 0xefff) AM_READWRITE(lastday_tx_r, lastday_tx_w)
AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSWA")
AM_RANGE(0xf000, 0xf000) AM_WRITE(bankswitch_w)
AM_RANGE(0xf001, 0xf001) AM_READ_PORT("DSWB")
@ -180,7 +180,7 @@ static ADDRESS_MAP_START( bluehawk_map, AS_PROGRAM, 8, dooyong_z80_state )
AM_RANGE(0xc040, 0xc047) AM_DEVWRITE("bg", dooyong_rom_tilemap_device, ctrl_w)
AM_RANGE(0xc048, 0xc04f) AM_DEVWRITE("fg", dooyong_rom_tilemap_device, ctrl_w)
AM_RANGE(0xc800, 0xcfff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
AM_RANGE(0xd000, 0xdfff) AM_READWRITE(bluehawk_tx_r, bluehawk_tx_w)
AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xf000, 0xffff) AM_RAM
ADDRESS_MAP_END
@ -201,7 +201,7 @@ static ADDRESS_MAP_START( flytiger_map, AS_PROGRAM, 8, dooyong_z80_state )
AM_RANGE(0xe030, 0xe037) AM_DEVWRITE("bg", dooyong_rom_tilemap_device, ctrl_w)
AM_RANGE(0xe040, 0xe047) AM_DEVWRITE("fg", dooyong_rom_tilemap_device, ctrl_w)
AM_RANGE(0xe800, 0xefff) AM_READWRITE(paletteram_flytiger_r, paletteram_flytiger_w)
AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
AM_RANGE(0xf000, 0xffff) AM_READWRITE(lastday_tx_r, lastday_tx_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( primella_map, AS_PROGRAM, 8, dooyong_z80_state )
@ -209,7 +209,7 @@ static ADDRESS_MAP_START( primella_map, AS_PROGRAM, 8, dooyong_z80_state )
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
AM_RANGE(0xc000, 0xcfff) AM_RAM
AM_RANGE(0xd000, 0xd3ff) AM_RAM /* what is this? looks like a palette? scratchpad RAM maybe? */
AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
AM_RANGE(0xe000, 0xefff) AM_READWRITE(bluehawk_tx_r, bluehawk_tx_w)
AM_RANGE(0xf000, 0xf7ff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xf800, 0xf800) AM_READ_PORT("DSWA")
AM_RANGE(0xf800, 0xf800) AM_WRITE(primella_ctrl_w) /* bank switch, flip screen etc */
@ -843,6 +843,7 @@ static MACHINE_CONFIG_START( lastday, dooyong_z80_ym2203_state )
MCFG_DOOYONG_ROM_TILEMAP_ADD("bg", "gfxdecode", 2, "gfx5", 0x00000)
MCFG_DOOYONG_ROM_TILEMAP_ADD("fg", "gfxdecode", 3, "gfx6", 0x00000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
MCFG_DOOYONG_RAM_TILEMAP_ADD("tx", "gfxdecode", 0)
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, lastday)
@ -894,6 +895,7 @@ static MACHINE_CONFIG_START( gulfstrm, dooyong_z80_ym2203_state )
MCFG_DOOYONG_ROM_TILEMAP_ADD("bg", "gfxdecode", 2, "gfx5", 0x00000)
MCFG_DOOYONG_ROM_TILEMAP_ADD("fg", "gfxdecode", 3, "gfx6", 0x00000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
MCFG_DOOYONG_RAM_TILEMAP_ADD("tx", "gfxdecode", 0)
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, gulfstrm)
@ -932,6 +934,7 @@ static MACHINE_CONFIG_START( pollux, dooyong_z80_ym2203_state )
MCFG_DOOYONG_ROM_TILEMAP_ADD("bg", "gfxdecode", 2, "gfx5", 0x00000)
MCFG_DOOYONG_ROM_TILEMAP_ADD("fg", "gfxdecode", 3, "gfx6", 0x00000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
MCFG_DOOYONG_RAM_TILEMAP_ADD("tx", "gfxdecode", 0)
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, pollux)
@ -971,6 +974,7 @@ static MACHINE_CONFIG_START( bluehawk, dooyong_z80_state )
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
MCFG_DOOYONG_ROM_TILEMAP_ADD("fg2", "gfxdecode", 4, "gfx5", 0x1c000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
MCFG_DOOYONG_RAM_TILEMAP_ADD("tx", "gfxdecode", 0)
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, bluehawk)
@ -1009,6 +1013,7 @@ static MACHINE_CONFIG_START( flytiger, dooyong_z80_state )
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
MCFG_DOOYONG_ROM_TILEMAP_ADD("fg", "gfxdecode", 3, "gfx4", 0x3c000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
MCFG_DOOYONG_RAM_TILEMAP_ADD("tx", "gfxdecode", 0)
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, flytiger)
@ -1045,6 +1050,7 @@ static MACHINE_CONFIG_START( primella, dooyong_z80_state )
MCFG_DOOYONG_ROM_TILEMAP_ADD("fg", "gfxdecode", 2, "gfx3", -0x4000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
MCFG_DOOYONG_ROM_TILEMAP_PRIMELLA_CODE_BITS(10)
MCFG_DOOYONG_RAM_TILEMAP_ADD("tx", "gfxdecode", 0)
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, primella)
@ -1065,120 +1071,93 @@ TIMER_DEVICE_CALLBACK_MEMBER(dooyong_68k_state::scanline)
}
static MACHINE_CONFIG_START( rshark, dooyong_68k_state )
static MACHINE_CONFIG_START( dooyong_68k, rshark_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 8000000) /* measured on super-x */
// basic machine hardware
MCFG_CPU_ADD("maincpu", M68000, XTAL_8MHz) // 8MHz measured on Super-X
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_68k_state, scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_8MHz/2) // 4MHz measured on Super-X
MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
// video hardware
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1)
MCFG_SCREEN_UPDATE_DRIVER(rshark_state, screen_update_rshark)
MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram16_device, vblank_copy_rising)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", rshark)
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
MCFG_RSHARK_ROM_TILEMAP_ADD("bg", "gfxdecode", 4, "gfx5", 0x00000, "gfx6", 0x60000)
MCFG_RSHARK_ROM_TILEMAP_ADD("bg2", "gfxdecode", 3, "gfx4", 0x00000, "gfx6", 0x40000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15);
MCFG_RSHARK_ROM_TILEMAP_ADD("fg", "gfxdecode", 2, "gfx3", 0x00000, "gfx6", 0x20000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15);
MCFG_RSHARK_ROM_TILEMAP_ADD("fg2", "gfxdecode", 1, "gfx2", 0x00000, "gfx6", 0x00000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15);
MCFG_VIDEO_START_OVERRIDE(rshark_state, rshark)
// sound hardware
MCFG_FRAGMENT_ADD(sound_2151_4mhz)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( rshark, dooyong_68k )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(rshark_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_68k_state, scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* measured on super-x */
MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
/* video hardware */
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
MCFG_SCREEN_UPDATE_DRIVER(dooyong_68k_state, screen_update_rshark)
MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram16_device, vblank_copy_rising)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", rshark)
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
MCFG_RSHARK_ROM_TILEMAP_ADD("bg", "gfxdecode", 4, "gfx5", 0x00000, "gfx6", 0x60000)
MCFG_RSHARK_ROM_TILEMAP_ADD("bg2", "gfxdecode", 3, "gfx4", 0x00000, "gfx6", 0x40000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15);
MCFG_RSHARK_ROM_TILEMAP_ADD("fg", "gfxdecode", 2, "gfx3", 0x00000, "gfx6", 0x20000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15);
MCFG_RSHARK_ROM_TILEMAP_ADD("fg2", "gfxdecode", 1, "gfx2", 0x00000, "gfx6", 0x00000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15);
MCFG_VIDEO_START_OVERRIDE(dooyong_68k_state, rshark)
/* sound hardware */
MCFG_FRAGMENT_ADD( sound_2151_4mhz )
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( superx, dooyong_68k_state ) // dif mem map
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_8MHz) /* 8MHz measured */
static MACHINE_CONFIG_DERIVED( superx, dooyong_68k )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(superx_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_68k_state, scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_8MHz/2) /* 4MHz measured */
MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
/* video hardware */
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
MCFG_SCREEN_UPDATE_DRIVER(dooyong_68k_state, screen_update_rshark)
MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram16_device, vblank_copy_rising)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", rshark)
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
MCFG_RSHARK_ROM_TILEMAP_ADD("bg", "gfxdecode", 4, "gfx5", 0x00000, "gfx6", 0x60000)
MCFG_RSHARK_ROM_TILEMAP_ADD("bg2", "gfxdecode", 3, "gfx4", 0x00000, "gfx6", 0x40000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15);
MCFG_RSHARK_ROM_TILEMAP_ADD("fg", "gfxdecode", 2, "gfx3", 0x00000, "gfx6", 0x20000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15);
MCFG_RSHARK_ROM_TILEMAP_ADD("fg2", "gfxdecode", 1, "gfx2", 0x00000, "gfx6", 0x00000)
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15);
MCFG_VIDEO_START_OVERRIDE(dooyong_68k_state, rshark)
/* sound hardware */
MCFG_FRAGMENT_ADD( sound_2151_4mhz )
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( popbingo, dooyong_68k_state )
static MACHINE_CONFIG_START( popbingo, popbingo_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_20MHz/2) /* 10MHz measured */
// basic machine hardware
MCFG_CPU_ADD("maincpu", M68000, XTAL_20MHz/2) // 10MHz measured
MCFG_CPU_PROGRAM_MAP(popbingo_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_68k_state, scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_16MHz/4) /* 4MHz measured */
MCFG_CPU_ADD("audiocpu", Z80, XTAL_16MHz/4) // 4MHz measured
MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
/* video hardware */
// video hardware
MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
MCFG_SCREEN_UPDATE_DRIVER(dooyong_68k_state, screen_update_popbingo)
MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1)
MCFG_SCREEN_UPDATE_DRIVER(popbingo_state, screen_update_popbingo)
MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram16_device, vblank_copy_rising)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", popbingo)
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
MCFG_DOOYONG_ROM_TILEMAP_ADD("bg", "gfxdecode", 1, "gfx2", 0x00000)
MCFG_DOOYONG_ROM_TILEMAP_PRIMELLA_CODE_BITS(11)
MCFG_DOOYONG_ROM_TILEMAP_ADD("bg2", "gfxdecode", 2, "gfx3", 0x00000)
MCFG_DOOYONG_ROM_TILEMAP_PRIMELLA_CODE_BITS(11)
MCFG_VIDEO_START_OVERRIDE(dooyong_68k_state, popbingo)
MCFG_VIDEO_START_OVERRIDE(popbingo_state, popbingo)
/* sound hardware */
MCFG_FRAGMENT_ADD( sound_2151_4mhz )
// sound hardware
MCFG_FRAGMENT_ADD(sound_2151_4mhz)
MACHINE_CONFIG_END
/***************************************************************************
ROM definition(s)
@ -2109,9 +2088,9 @@ ROM_END
/* The differences between the two lastday sets are only in the sound program and graphics. The main program is the same. */
GAME( 1990, lastday, 0, lastday, lastday, driver_device, 0, ROT270, "Dooyong", "The Last Day (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1990, lastdaya, lastday, lastday, lastday, driver_device, 0, ROT270, "Dooyong", "The Last Day (set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1990, ddaydoo, lastday, lastday, lastday, driver_device, 0, ROT270, "Dooyong", "Chulgyeok D-Day (Korea)", MACHINE_SUPPORTS_SAVE )
GAME( 1990, lastday, 0, lastday, lastday, driver_device, 0, ROT270, "Dooyong", "The Last Day (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1990, lastdaya, lastday, lastday, lastday, driver_device, 0, ROT270, "Dooyong", "The Last Day (set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1990, ddaydoo, lastday, lastday, lastday, driver_device, 0, ROT270, "Dooyong", "Chulgyeok D-Day (Korea)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, gulfstrm, 0, gulfstrm, gulfstrm, driver_device, 0, ROT270, "Dooyong", "Gulf Storm (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, gulfstrma,gulfstrm, gulfstrm, gulfstrm, driver_device, 0, ROT270, "Dooyong", "Gulf Storm (set 2)", MACHINE_SUPPORTS_SAVE )
@ -2119,10 +2098,10 @@ GAME( 1991, gulfstrmb,gulfstrm, gulfstrm, gulfstrm, driver_device, 0, ROT270, "D
GAME( 1991, gulfstrmm,gulfstrm, gulfstrm, gulfstrm, driver_device, 0, ROT270, "Dooyong (Media Shoji license)", "Gulf Storm (Media Shoji)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, gulfstrmk,gulfstrm, gulfstrm, gulfstrm, driver_device, 0, ROT270, "Dooyong", "Gulf Storm (Korea)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, pollux, 0, pollux, pollux, driver_device, 0, ROT270, "Dooyong", "Pollux (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, polluxa, pollux, pollux, pollux, driver_device, 0, ROT270, "Dooyong", "Pollux (set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, polluxa2, pollux, pollux, pollux, driver_device, 0, ROT270, "Dooyong", "Pollux (set 3)", MACHINE_SUPPORTS_SAVE ) /* Original Dooyong Board distributed by TCH */
GAME( 1991, polluxn, pollux, pollux, pollux, driver_device, 0, ROT270, "Dooyong (NTC / Atlus license)", "Pollux (Japan, NTC license, distributed by Atlus)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, pollux, 0, pollux, pollux, driver_device, 0, ROT270, "Dooyong", "Pollux (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, polluxa, pollux, pollux, pollux, driver_device, 0, ROT270, "Dooyong", "Pollux (set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, polluxa2, pollux, pollux, pollux, driver_device, 0, ROT270, "Dooyong", "Pollux (set 3)", MACHINE_SUPPORTS_SAVE ) // Original Dooyong Board distributed by TCH
GAME( 1991, polluxn, pollux, pollux, pollux, driver_device, 0, ROT270, "Dooyong (NTC / Atlus license)", "Pollux (Japan, NTC license, distributed by Atlus)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, flytiger, 0, flytiger, flytiger, driver_device, 0, ROT270, "Dooyong", "Flying Tiger (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, flytigera,flytiger, flytiger, flytiger, driver_device, 0, ROT270, "Dooyong", "Flying Tiger (set 2)", MACHINE_SUPPORTS_SAVE )
@ -2130,14 +2109,14 @@ GAME( 1992, flytigera,flytiger, flytiger, flytiger, driver_device, 0, ROT270, "D
GAME( 1993, bluehawk, 0, bluehawk, bluehawk, driver_device, 0, ROT270, "Dooyong", "Blue Hawk", MACHINE_SUPPORTS_SAVE )
GAME( 1993, bluehawkn,bluehawk, bluehawk, bluehawk, driver_device, 0, ROT270, "Dooyong (NTC license)", "Blue Hawk (NTC)", MACHINE_SUPPORTS_SAVE )
GAME( 1993, sadari, 0, primella, sadari, driver_device, 0, ROT0, "Dooyong (NTC license)", "Sadari", MACHINE_SUPPORTS_SAVE )
GAME( 1993, sadari, 0, primella, sadari, driver_device, 0, ROT0, "Dooyong (NTC license)", "Sadari", MACHINE_SUPPORTS_SAVE )
GAME( 1994, gundl94, 0, primella, primella, driver_device, 0, ROT0, "Dooyong", "Gun Dealer '94", MACHINE_SUPPORTS_SAVE )
GAME( 1994, primella, gundl94, primella, primella, driver_device, 0, ROT0, "Dooyong (NTC license)", "Primella", MACHINE_SUPPORTS_SAVE )
GAME( 1994, superx, 0, superx, superx, driver_device, 0, ROT270, "Dooyong (NTC license)", "Super-X (NTC)", MACHINE_SUPPORTS_SAVE )
GAME( 1994, superxm, superx, superx, superx, driver_device, 0, ROT270, "Dooyong (Mitchell license)", "Super-X (Mitchell)", MACHINE_SUPPORTS_SAVE )
GAME( 1994, superx, 0, superx, superx, driver_device, 0, ROT270, "Dooyong (NTC license)", "Super-X (NTC)", MACHINE_SUPPORTS_SAVE )
GAME( 1994, superxm, superx, superx, superx, driver_device, 0, ROT270, "Dooyong (Mitchell license)", "Super-X (Mitchell)", MACHINE_SUPPORTS_SAVE )
GAME( 1995, rshark, 0, rshark, rshark, driver_device, 0, ROT270, "Dooyong", "R-Shark", MACHINE_SUPPORTS_SAVE )
GAME( 1995, rshark, 0, rshark, rshark, driver_device, 0, ROT270, "Dooyong", "R-Shark", MACHINE_SUPPORTS_SAVE )
GAME( 1996, popbingo, 0, popbingo, popbingo, driver_device, 0, ROT0, "Dooyong", "Pop Bingo", MACHINE_SUPPORTS_SAVE )

View File

@ -23,27 +23,58 @@
rshark_rom_tilemap_device::static_set_colorrom_tag(*device, "^" rom2); \
rshark_rom_tilemap_device::static_set_colorrom_offset(*device, (offset2));
#define MCFG_DOOYONG_RAM_TILEMAP_ADD(tag, gfx, num) \
MCFG_DEVICE_ADD(tag, DOOYONG_RAM_TILEMAP, 0) \
dooyong_rom_tilemap_device::static_set_gfxdecode_tag(*device, "^" gfx); \
dooyong_rom_tilemap_device::static_set_gfxnum(*device, (num));
extern device_type const DOOYONG_ROM_TILEMAP;
extern device_type const RSHARK_ROM_TILEMAP;
extern device_type const DOOYONG_RAM_TILEMAP;
class dooyong_rom_tilemap_device : public device_t
class dooyong_tilemap_device_base : public device_t
{
public:
static void static_set_gfxdecode_tag(device_t &device, char const *tag);
static void static_set_gfxnum(device_t &device, int gfxnum);
void draw(screen_device &screen, bitmap_ind16 &dest, rectangle const &cliprect, UINT32 flags, UINT8 priority);
void set_palette_bank(UINT16 bank);
protected:
dooyong_tilemap_device_base(
machine_config const &mconfig,
device_type type,
char const *name,
char const *tag,
device_t *owner,
UINT32 clock,
char const *shortname,
char const *source);
gfx_element const &gfx() const { return *m_gfxdecode->gfx(m_gfxnum); }
required_device<gfxdecode_device> m_gfxdecode;
int m_gfxnum;
tilemap_t *m_tilemap;
UINT16 m_palette_bank;
};
class dooyong_rom_tilemap_device : public dooyong_tilemap_device_base
{
public:
dooyong_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock);
static void static_set_gfxdecode_tag(device_t &device, char const *tag);
static void static_set_tilerom_tag(device_t &device, char const *tag);
static void static_set_gfxnum(device_t &device, int gfxnum);
static void static_set_tilerom_offset(device_t &device, int offset);
static void static_set_transparent_pen(device_t &device, unsigned pen);
static void static_set_primella_code_bits(device_t &device, unsigned bits);
void draw(screen_device &screen, bitmap_ind16 &dest, rectangle const &cliprect, UINT32 flags, UINT8 priority);
DECLARE_WRITE8_MEMBER(ctrl_w);
void set_palette_bank(UINT16 bank);
protected:
dooyong_rom_tilemap_device(
@ -60,31 +91,22 @@ protected:
virtual TILE_GET_INFO_MEMBER(tile_info);
gfx_element const &gfx() const
{ return *m_gfxdecode->gfx(m_gfxnum); }
tilemap_memory_index adjust_tile_index(tilemap_memory_index tile_index) const
{ return tile_index + ((unsigned(m_registers[1]) * 256U / gfx().width()) * m_rows); }
int m_rows;
private:
required_device<gfxdecode_device> m_gfxdecode;
required_region_ptr<UINT16> m_tilerom;
int m_gfxnum;
int m_tilerom_offset;
unsigned m_transparent_pen;
unsigned m_primella_code_mask;
unsigned m_primella_color_mask;
unsigned m_primella_color_shift;
tilemap_t *m_tilemap;
UINT8 m_registers[0x10];
UINT16 m_palette_bank;
};
class rshark_rom_tilemap_device : public dooyong_rom_tilemap_device
{
public:
@ -103,6 +125,24 @@ private:
int m_colorrom_offset;
};
class dooyong_ram_tilemap_device : public dooyong_tilemap_device_base
{
public:
dooyong_ram_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock);
DECLARE_READ16_MEMBER(tileram_r) { return m_tileram[offset & ((64U * 32U) - 1)]; }
DECLARE_WRITE16_MEMBER(tileram_w);
void set_scrolly(int value) { m_tilemap->set_scrolly(value); }
protected:
virtual void device_start() override;
private:
TILE_GET_INFO_MEMBER(tile_info);
std::unique_ptr<UINT16[]> m_tileram;
};
class dooyong_state : public driver_device
{
@ -117,9 +157,8 @@ public:
, m_bg2(*this, "bg2")
, m_fg(*this, "fg")
, m_fg2(*this, "fg2")
{ }
tilemap_t *m_tx_tilemap = nullptr;
{
}
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
@ -136,9 +175,10 @@ class dooyong_z80_state : public dooyong_state
public:
dooyong_z80_state(const machine_config &mconfig, device_type type, const char *tag)
: dooyong_state(mconfig, type, tag)
, m_txvideoram(*this, "txvideoram")
, m_tx(*this, "tx")
, m_spriteram(*this, "spriteram")
{ }
{
}
enum
{
@ -150,7 +190,10 @@ public:
DECLARE_WRITE8_MEMBER(flip_screen_w);
DECLARE_WRITE8_MEMBER(bankswitch_w);
DECLARE_WRITE8_MEMBER(txvideoram_w);
DECLARE_READ8_MEMBER(lastday_tx_r);
DECLARE_WRITE8_MEMBER(lastday_tx_w);
DECLARE_READ8_MEMBER(bluehawk_tx_r);
DECLARE_WRITE8_MEMBER(bluehawk_tx_w);
DECLARE_WRITE8_MEMBER(primella_ctrl_w);
DECLARE_READ8_MEMBER(paletteram_flytiger_r);
DECLARE_WRITE8_MEMBER(paletteram_flytiger_w);
@ -165,14 +208,13 @@ public:
DECLARE_VIDEO_START(flytiger);
DECLARE_VIDEO_START(primella);
required_shared_ptr<UINT8> m_txvideoram;
std::unique_ptr<UINT8[]> m_paletteram_flytiger;
UINT8 m_sprites_disabled = 0;
UINT8 m_flytiger_pri = 0;
UINT8 m_tx_pri = 0;
UINT8 m_palette_bank = 0;
int m_tx_tilemap_mode = 0;
required_device<dooyong_ram_tilemap_device> m_tx;
optional_device<buffered_spriteram8_device> m_spriteram;
};
@ -181,7 +223,8 @@ class dooyong_z80_ym2203_state : public dooyong_z80_state
public:
dooyong_z80_ym2203_state(const machine_config &mconfig, device_type type, const char *tag)
: dooyong_z80_state(mconfig, type, tag)
{ }
{
}
DECLARE_WRITE8_MEMBER(lastday_ctrl_w);
DECLARE_WRITE8_MEMBER(pollux_ctrl_w);
@ -205,25 +248,49 @@ class dooyong_68k_state : public dooyong_state
public:
dooyong_68k_state(const machine_config &mconfig, device_type type, const char *tag)
: dooyong_state(mconfig, type, tag)
, m_bg_bitmap()
, m_bg2_bitmap()
, m_screen(*this, "screen")
, m_spriteram(*this, "spriteram")
{ }
{
}
DECLARE_WRITE16_MEMBER(ctrl_w);
TIMER_DEVICE_CALLBACK_MEMBER(scanline);
protected:
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_VIDEO_START(rshark);
DECLARE_VIDEO_START(popbingo);
UINT16 m_bg2_priority = 0;
required_device<buffered_spriteram16_device> m_spriteram;
};
class rshark_state : public dooyong_68k_state
{
public:
rshark_state(const machine_config &mconfig, device_type type, const char *tag)
: dooyong_68k_state(mconfig, type, tag)
{
}
UINT32 screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_VIDEO_START(rshark);
};
class popbingo_state : public dooyong_68k_state
{
public:
popbingo_state(const machine_config &mconfig, device_type type, const char *tag)
: dooyong_68k_state(mconfig, type, tag)
, m_bg_bitmap()
, m_bg2_bitmap()
, m_screen(*this, "screen")
{
}
UINT32 screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_VIDEO_START(popbingo);
protected:
bitmap_ind16 m_bg_bitmap;
bitmap_ind16 m_bg2_bitmap;
required_device<screen_device> m_screen;
required_device<buffered_spriteram16_device> m_spriteram;
};

View File

@ -16,6 +16,49 @@
device_type const DOOYONG_ROM_TILEMAP = &device_creator<dooyong_rom_tilemap_device>;
device_type const RSHARK_ROM_TILEMAP = &device_creator<rshark_rom_tilemap_device>;
device_type const DOOYONG_RAM_TILEMAP = &device_creator<dooyong_ram_tilemap_device>;
dooyong_tilemap_device_base::dooyong_tilemap_device_base(
machine_config const &mconfig,
device_type type,
char const *name,
char const *tag,
device_t *owner,
UINT32 clock,
char const *shortname,
char const *source)
: device_t(mconfig, type, name, tag, owner, clock, shortname, source)
, m_gfxdecode(*this, finder_base::DUMMY_TAG)
, m_gfxnum(0)
, m_tilemap(nullptr)
, m_palette_bank(0)
{
}
void dooyong_tilemap_device_base::static_set_gfxdecode_tag(device_t &device, char const *tag)
{
downcast<dooyong_tilemap_device_base &>(device).m_gfxdecode.set_tag(tag);
}
void dooyong_tilemap_device_base::static_set_gfxnum(device_t &device, int gfxnum)
{
downcast<dooyong_tilemap_device_base &>(device).m_gfxnum = gfxnum;
}
void dooyong_tilemap_device_base::draw(screen_device &screen, bitmap_ind16 &dest, rectangle const &cliprect, UINT32 flags, UINT8 priority)
{
m_tilemap->draw(screen, dest, cliprect, flags, priority);
}
void dooyong_tilemap_device_base::set_palette_bank(UINT16 bank)
{
if (bank != m_palette_bank)
{
m_palette_bank = bank;
m_tilemap->mark_all_dirty();
}
}
dooyong_rom_tilemap_device::dooyong_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock)
@ -32,37 +75,23 @@ dooyong_rom_tilemap_device::dooyong_rom_tilemap_device(
UINT32 clock,
char const *shortname,
char const *source)
: device_t(mconfig, type, name, tag, owner, clock, shortname, source)
: dooyong_tilemap_device_base(mconfig, type, name, tag, owner, clock, shortname, source)
, m_rows(8)
, m_gfxdecode(*this, finder_base::DUMMY_TAG)
, m_tilerom(*this, finder_base::DUMMY_TAG)
, m_gfxnum(0)
, m_tilerom_offset(0)
, m_transparent_pen(~0U)
, m_primella_code_mask(0x03ff)
, m_primella_color_mask(0x3c00)
, m_primella_color_shift(10)
, m_tilemap(nullptr)
, m_registers{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
, m_palette_bank(0)
{
}
void dooyong_rom_tilemap_device::static_set_gfxdecode_tag(device_t &device, char const *tag)
{
downcast<dooyong_rom_tilemap_device &>(device).m_gfxdecode.set_tag(tag);
}
void dooyong_rom_tilemap_device::static_set_tilerom_tag(device_t &device, char const *tag)
{
downcast<dooyong_rom_tilemap_device &>(device).m_tilerom.set_tag(tag);
}
void dooyong_rom_tilemap_device::static_set_gfxnum(device_t &device, int gfxnum)
{
downcast<dooyong_rom_tilemap_device &>(device).m_gfxnum = gfxnum;
}
void dooyong_rom_tilemap_device::static_set_tilerom_offset(device_t &device, int offset)
{
downcast<dooyong_rom_tilemap_device &>(device).m_tilerom_offset = offset;
@ -81,13 +110,9 @@ void dooyong_rom_tilemap_device::static_set_primella_code_bits(device_t &device,
tilemap_device.m_primella_color_shift = bits;
}
void dooyong_rom_tilemap_device::draw(screen_device &screen, bitmap_ind16 &dest, rectangle const &cliprect, UINT32 flags, UINT8 priority)
{
m_tilemap->draw(screen, dest, cliprect, flags, priority);
}
WRITE8_MEMBER(dooyong_rom_tilemap_device::ctrl_w)
{
offset &= 0x07U;
UINT8 const old = m_registers[offset];
if (old != data)
{
@ -118,15 +143,6 @@ WRITE8_MEMBER(dooyong_rom_tilemap_device::ctrl_w)
}
}
void dooyong_rom_tilemap_device::set_palette_bank(UINT16 bank)
{
if (bank != m_palette_bank)
{
m_palette_bank = bank;
m_tilemap->mark_all_dirty();
}
}
void dooyong_rom_tilemap_device::device_start()
{
if (!m_gfxdecode->started())
@ -146,7 +162,7 @@ void dooyong_rom_tilemap_device::device_start()
if (0 > m_tilerom_offset)
m_tilerom_offset = m_tilerom.length() + m_tilerom_offset;
std::fill(std::begin(m_registers), std::end(m_registers), 0);
std::fill(std::begin(m_registers), std::end(m_registers), 0U);
m_palette_bank = 0U;
save_item(NAME(m_registers));
@ -182,7 +198,7 @@ TILE_GET_INFO_MEMBER(dooyong_rom_tilemap_device::tile_info)
// X = x flip
// Y = y flip
// ? = unused?
color = (attr & m_primella_color_mask) >> m_primella_color_shift;
color = m_palette_bank | ((attr & m_primella_color_mask) >> m_primella_color_shift);
flags = TILE_FLIPYX((attr >> 14) & 0x03U);
code = attr & m_primella_code_mask;
}
@ -226,18 +242,83 @@ TILE_GET_INFO_MEMBER(rshark_rom_tilemap_device::tile_info)
}
WRITE8_MEMBER(dooyong_z80_state::txvideoram_w)
dooyong_ram_tilemap_device::dooyong_ram_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock)
: dooyong_tilemap_device_base(mconfig, DOOYONG_RAM_TILEMAP, "Dooyong RAM Tilemap", tag, owner, clock, "dooyong_ram_tilemap", __FILE__)
, m_tileram()
{
if (m_txvideoram[offset] != data)
}
WRITE16_MEMBER(dooyong_ram_tilemap_device::tileram_w)
{
offset &= (64U * 32U) - 1U;
UINT16 value(m_tileram[offset]);
COMBINE_DATA(&value);
if (value != m_tileram[offset])
{
m_txvideoram[offset] = data;
if (m_tx_tilemap_mode == 0)
m_tx_tilemap->mark_tile_dirty(offset & 0x07ff);
else
m_tx_tilemap->mark_tile_dirty(offset >> 1);
m_tileram[offset] = value;
m_tilemap->mark_tile_dirty(offset);
}
}
void dooyong_ram_tilemap_device::device_start()
{
if (!m_gfxdecode->started())
throw device_missing_dependencies();
m_tilemap = &machine().tilemap().create(
*m_gfxdecode,
tilemap_get_info_delegate(FUNC(dooyong_ram_tilemap_device::tile_info), this),
TILEMAP_SCAN_COLS,
8,
8,
64,
32);
m_tilemap->set_transparent_pen(15);
m_tileram.reset(new UINT16[64 * 32]);
std::fill(m_tileram.get(), m_tileram.get() + (64 * 32), 0U);
m_palette_bank = 0U;
save_pointer(NAME(m_tileram.get()), 64 * 32);
save_item(NAME(m_palette_bank));
}
TILE_GET_INFO_MEMBER(dooyong_ram_tilemap_device::tile_info)
{
// Each tile takes one word of memory:
// MSB LSB
// CCCC cccc cccc cccc (bits 3-0 of color code, bits 11-0 of gfx code)
// c = gfx code
// C = color code
unsigned const attr(m_tileram[tile_index]);
tileinfo.set(m_gfxnum, attr & 0x0fffU, m_palette_bank | ((attr >> 12) & 0x0fU), 0);
}
READ8_MEMBER(dooyong_z80_state::lastday_tx_r)
{
bool const lane(BIT(offset, 11));
return m_tx->tileram_r(space, offset & 0x07ffU) >> (lane ? 8 : 0);
}
WRITE8_MEMBER(dooyong_z80_state::lastday_tx_w)
{
bool const lane(BIT(offset, 11));
m_tx->tileram_w(space, offset & 0x07ffU, UINT16(data) << (lane ? 8 : 0), lane ? 0xff00U : 0x00ffU);
}
READ8_MEMBER(dooyong_z80_state::bluehawk_tx_r)
{
bool const lane(BIT(offset, 0));
return m_tx->tileram_r(space, offset >> 1) >> (lane ? 8 : 0);
}
WRITE8_MEMBER(dooyong_z80_state::bluehawk_tx_w)
{
bool const lane(BIT(offset, 0));
m_tx->tileram_w(space, offset >> 1, UINT16(data) << (lane ? 8 : 0), lane ? 0xff00U : 0x00ffU);
}
/* Control registers seem to be different on every game */
@ -274,7 +355,7 @@ WRITE8_MEMBER(dooyong_z80_ym2203_state::pollux_ctrl_w)
{
m_bg->set_palette_bank(m_palette_bank << 6);
m_fg->set_palette_bank(m_palette_bank << 6);
m_tx_tilemap->mark_all_dirty();
m_tx->set_palette_bank(m_palette_bank << 6);
}
/* bit 2 is continuously toggled (unknown) */
@ -332,7 +413,7 @@ WRITE8_MEMBER(dooyong_z80_state::flytiger_ctrl_w)
{
m_bg->set_palette_bank(m_palette_bank << 6);
m_fg->set_palette_bank(m_palette_bank << 6);
m_tx_tilemap->mark_all_dirty();
m_tx->set_palette_bank(m_palette_bank << 6);
}
/* bit 4 changes tilemaps priority */
@ -340,32 +421,6 @@ WRITE8_MEMBER(dooyong_z80_state::flytiger_ctrl_w)
}
TILE_GET_INFO_MEMBER(dooyong_z80_state::get_tx_tile_info)
{
/* Each tile takes two bytes of memory:
MSB LSB
[offs + 0x00] cccc cccc (bits 7-0 of gfx code)
[offs + 0x01] CCCC cccc (bits 3-0 of color code, bits 11-8 of gfx code)
c = gfx code
C = color code */
unsigned offs, attr;
if (m_tx_tilemap_mode == 0)
{ /* lastday/gulfstrm/pollux/flytiger */
offs = tile_index;
attr = m_txvideoram[offs | 0x0800];
}
else
{ /* bluehawk/primella */
offs = tile_index * 2;
attr = m_txvideoram[offs + 1];
}
int const code = m_txvideoram[offs] | ((attr & 0x0f) << 8);
int const color = (attr & 0xf0) >> 4;
tileinfo.set(0, code, color | (m_palette_bank << 6), 0);
}
void dooyong_z80_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, unsigned extensions)
{
/* Sprites take 32 bytes each in memory:
@ -458,14 +513,11 @@ UINT32 dooyong_z80_ym2203_state::screen_update_lastday(screen_device &screen, bi
screen.priority().fill(0, cliprect);
/* Text layer is offset on this machine */
if (!flip_screen())
m_tx_tilemap->set_scrolly(0, 8);
else
m_tx_tilemap->set_scrolly(0, -8);
m_tx->set_scrolly(flip_screen() ? -8 : 8);
m_bg->draw(screen, bitmap, cliprect, 0, 1);
m_fg->draw(screen, bitmap, cliprect, 0, 2);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
m_tx->draw(screen, bitmap, cliprect, 0, 4);
if (!m_sprites_disabled)
draw_sprites(screen, bitmap, cliprect);
@ -479,14 +531,11 @@ UINT32 dooyong_z80_ym2203_state::screen_update_gulfstrm(screen_device &screen, b
screen.priority().fill(0, cliprect);
/* Text layer is offset on this machine */
if (!flip_screen())
m_tx_tilemap->set_scrolly(0, 8);
else
m_tx_tilemap->set_scrolly(0, -8);
m_tx->set_scrolly(flip_screen() ? -8 : 8);
m_bg->draw(screen, bitmap, cliprect, 0, 1);
m_fg->draw(screen, bitmap, cliprect, 0, 2);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
m_tx->draw(screen, bitmap, cliprect, 0, 4);
draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT);
@ -500,7 +549,7 @@ UINT32 dooyong_z80_ym2203_state::screen_update_pollux(screen_device &screen, bit
m_bg->draw(screen, bitmap, cliprect, 0, 1);
m_fg->draw(screen, bitmap, cliprect, 0, 2);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
m_tx->draw(screen, bitmap, cliprect, 0, 4);
draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT);
@ -522,7 +571,7 @@ UINT32 dooyong_z80_state::screen_update_flytiger(screen_device &screen, bitmap_i
m_bg->draw(screen, bitmap, cliprect, 0, 1);
m_fg->draw(screen, bitmap, cliprect, 0, 2);
}
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
m_tx->draw(screen, bitmap, cliprect, 0, 4);
draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT | SPRITE_YSHIFT_FLYTIGER);
@ -538,7 +587,7 @@ UINT32 dooyong_z80_state::screen_update_bluehawk(screen_device &screen, bitmap_i
m_bg->draw(screen, bitmap, cliprect, 0, 1);
m_fg->draw(screen, bitmap, cliprect, 0, 2);
m_fg2->draw(screen, bitmap, cliprect, 0, 4);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
m_tx->draw(screen, bitmap, cliprect, 0, 4);
draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT | SPRITE_YSHIFT_BLUEHAWK);
@ -550,9 +599,9 @@ UINT32 dooyong_z80_state::screen_update_primella(screen_device &screen, bitmap_i
bitmap.fill(m_palette->black_pen(), cliprect);
m_bg->draw(screen, bitmap, cliprect, 0, 0);
if (m_tx_pri) m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
if (m_tx_pri) m_tx->draw(screen, bitmap, cliprect, 0, 0);
m_fg->draw(screen, bitmap, cliprect, 0, 0);
if (!m_tx_pri) m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
if (!m_tx_pri) m_tx->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
@ -561,17 +610,6 @@ UINT32 dooyong_z80_state::screen_update_primella(screen_device &screen, bitmap_i
VIDEO_START_MEMBER(dooyong_z80_ym2203_state, lastday)
{
/* Configure tilemap callbacks */
m_tx_tilemap_mode = 0;
/* Create tilemaps */
m_tx_tilemap = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8, 8, 64, 32);
/* Configure tilemap transparency */
m_tx_tilemap->set_transparent_pen(15);
/* Register for save/restore */
save_item(NAME(m_sprites_disabled));
save_item(NAME(m_interrupt_line_1));
@ -580,17 +618,6 @@ VIDEO_START_MEMBER(dooyong_z80_ym2203_state, lastday)
VIDEO_START_MEMBER(dooyong_z80_ym2203_state, gulfstrm)
{
/* Configure tilemap callbacks */
m_tx_tilemap_mode = 0;
/* Create tilemaps */
m_tx_tilemap = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8, 8, 64, 32);
/* Configure tilemap transparency */
m_tx_tilemap->set_transparent_pen(15);
m_palette_bank = 0;
/* Register for save/restore */
@ -601,20 +628,9 @@ VIDEO_START_MEMBER(dooyong_z80_ym2203_state, gulfstrm)
VIDEO_START_MEMBER(dooyong_z80_ym2203_state, pollux)
{
/* Configure tilemap callbacks */
m_tx_tilemap_mode = 0;
m_paletteram_flytiger = make_unique_clear<UINT8[]>(0x1000);
save_pointer(NAME(m_paletteram_flytiger.get()), 0x1000);
/* Create tilemaps */
m_tx_tilemap = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8, 8, 64, 32);
/* Configure tilemap transparency */
m_tx_tilemap->set_transparent_pen(15);
m_palette_bank = 0;
/* Register for save/restore */
@ -625,34 +641,13 @@ VIDEO_START_MEMBER(dooyong_z80_ym2203_state, pollux)
VIDEO_START_MEMBER(dooyong_z80_state, bluehawk)
{
/* Configure tilemap callbacks */
m_tx_tilemap_mode = 1;
/* Create tilemaps */
m_tx_tilemap = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8, 8, 64, 32);
/* Configure tilemap transparency */
m_tx_tilemap->set_transparent_pen(15);
}
VIDEO_START_MEMBER(dooyong_z80_state, flytiger)
{
/* Configure tilemap callbacks */
m_tx_tilemap_mode = 0;
m_paletteram_flytiger = make_unique_clear<UINT8[]>(0x1000);
save_pointer(NAME(m_paletteram_flytiger.get()), 0x1000);
/* Create tilemaps */
m_tx_tilemap = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8, 8, 64, 32);
/* Configure tilemap transparency */
m_tx_tilemap->set_transparent_pen(15);
m_palette_bank = 0;
/* Register for save/restore */
@ -662,17 +657,6 @@ VIDEO_START_MEMBER(dooyong_z80_state, flytiger)
VIDEO_START_MEMBER(dooyong_z80_state, primella)
{
/* Configure tilemap callbacks */
m_tx_tilemap_mode = 1;
/* Create tilemaps */
m_tx_tilemap = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
8, 8, 64, 32);
/* Configure tilemap transparency */
m_tx_tilemap->set_transparent_pen(15);
/* Register for save/restore */
save_item(NAME(m_tx_pri));
}
@ -757,7 +741,8 @@ void dooyong_68k_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap
}
}
UINT32 dooyong_68k_state::screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
UINT32 rshark_state::screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(m_palette->black_pen(), cliprect);
screen.priority().fill(0, cliprect);
@ -772,7 +757,14 @@ UINT32 dooyong_68k_state::screen_update_rshark(screen_device &screen, bitmap_ind
return 0;
}
UINT32 dooyong_68k_state::screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
VIDEO_START_MEMBER(rshark_state, rshark)
{
/* Register for save/restore */
save_item(NAME(m_bg2_priority));
}
UINT32 popbingo_state::screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(m_palette->black_pen(), cliprect);
screen.priority().fill(0, cliprect);
@ -797,15 +789,7 @@ UINT32 dooyong_68k_state::screen_update_popbingo(screen_device &screen, bitmap_i
return 0;
}
VIDEO_START_MEMBER(dooyong_68k_state, rshark)
{
/* Register for save/restore */
save_item(NAME(m_bg2_priority));
}
VIDEO_START_MEMBER(dooyong_68k_state, popbingo)
VIDEO_START_MEMBER(popbingo_state, popbingo)
{
m_screen->register_screen_bitmap(m_bg_bitmap);
m_screen->register_screen_bitmap(m_bg2_bitmap);