mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
Make Dooyong tilemap generator into a device, move a whole lot of stuff from video start to machine config
This commit is contained in:
parent
0c2fb3c289
commit
8c6c3e4650
@ -112,8 +112,8 @@ MACHINE_RESET_MEMBER(dooyong_z80_ym2203_state, sound_ym2203)
|
||||
static ADDRESS_MAP_START( lastday_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
|
||||
AM_RANGE(0xc000, 0xc007) AM_WRITE(bgscroll_w)
|
||||
AM_RANGE(0xc008, 0xc00f) AM_WRITE(fgscroll_w)
|
||||
AM_RANGE(0xc000, 0xc007) AM_DEVWRITE("bg", dooyong_rom_tilemap_device, ctrl_w)
|
||||
AM_RANGE(0xc008, 0xc00f) AM_DEVWRITE("fg", dooyong_rom_tilemap_device, ctrl_w)
|
||||
AM_RANGE(0xc010, 0xc010) AM_READ_PORT("SYSTEM")
|
||||
AM_RANGE(0xc010, 0xc010) AM_WRITE(lastday_ctrl_w) /* coin counter, flip screen */
|
||||
AM_RANGE(0xc011, 0xc011) AM_READ_PORT("P1")
|
||||
@ -141,8 +141,8 @@ static ADDRESS_MAP_START( pollux_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
|
||||
AM_RANGE(0xf004, 0xf004) AM_READ_PORT("SYSTEM")
|
||||
AM_RANGE(0xf008, 0xf008) AM_WRITE(pollux_ctrl_w) /* coin counter, flip screen */
|
||||
AM_RANGE(0xf010, 0xf010) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
|
||||
AM_RANGE(0xf018, 0xf01f) AM_WRITE(bgscroll_w)
|
||||
AM_RANGE(0xf020, 0xf027) AM_WRITE(fgscroll_w)
|
||||
AM_RANGE(0xf018, 0xf01f) AM_DEVWRITE("bg", dooyong_rom_tilemap_device, ctrl_w)
|
||||
AM_RANGE(0xf020, 0xf027) AM_DEVWRITE("fg", dooyong_rom_tilemap_device, ctrl_w)
|
||||
AM_RANGE(0xf800, 0xffff) AM_READWRITE(paletteram_flytiger_r, paletteram_flytiger_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -160,8 +160,8 @@ static ADDRESS_MAP_START( gulfstrm_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state
|
||||
AM_RANGE(0xf004, 0xf004) AM_READ_PORT("SYSTEM")
|
||||
AM_RANGE(0xf008, 0xf008) AM_WRITE(pollux_ctrl_w) /* coin counter, flip screen */
|
||||
AM_RANGE(0xf010, 0xf010) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
|
||||
AM_RANGE(0xf018, 0xf01f) AM_WRITE(bgscroll_w)
|
||||
AM_RANGE(0xf020, 0xf027) AM_WRITE(fgscroll_w)
|
||||
AM_RANGE(0xf018, 0xf01f) AM_DEVWRITE("bg", dooyong_rom_tilemap_device, ctrl_w)
|
||||
AM_RANGE(0xf020, 0xf027) AM_DEVWRITE("fg", dooyong_rom_tilemap_device, ctrl_w)
|
||||
AM_RANGE(0xf800, 0xffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -176,9 +176,9 @@ static ADDRESS_MAP_START( bluehawk_map, AS_PROGRAM, 8, dooyong_z80_state )
|
||||
AM_RANGE(0xc004, 0xc004) AM_READ_PORT("SYSTEM")
|
||||
AM_RANGE(0xc008, 0xc008) AM_WRITE(bankswitch_w)
|
||||
AM_RANGE(0xc010, 0xc010) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
|
||||
AM_RANGE(0xc018, 0xc01f) AM_WRITE(fg2scroll_w)
|
||||
AM_RANGE(0xc040, 0xc047) AM_WRITE(bgscroll_w)
|
||||
AM_RANGE(0xc048, 0xc04f) AM_WRITE(fgscroll_w)
|
||||
AM_RANGE(0xc018, 0xc01f) AM_DEVWRITE("fg2", dooyong_rom_tilemap_device, ctrl_w)
|
||||
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(0xe000, 0xefff) AM_RAM AM_SHARE("spriteram")
|
||||
@ -198,8 +198,8 @@ static ADDRESS_MAP_START( flytiger_map, AS_PROGRAM, 8, dooyong_z80_state )
|
||||
AM_RANGE(0xe008, 0xe008) AM_READ_PORT("DSWB")
|
||||
AM_RANGE(0xe010, 0xe010) AM_WRITE(flytiger_ctrl_w) /* coin counter, flip screen */
|
||||
AM_RANGE(0xe020, 0xe020) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
|
||||
AM_RANGE(0xe030, 0xe037) AM_WRITE(bgscroll_w)
|
||||
AM_RANGE(0xe040, 0xe047) AM_WRITE(fgscroll_w)
|
||||
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")
|
||||
ADDRESS_MAP_END
|
||||
@ -218,8 +218,8 @@ static ADDRESS_MAP_START( primella_map, AS_PROGRAM, 8, dooyong_z80_state )
|
||||
AM_RANGE(0xf820, 0xf820) AM_READ_PORT("P1")
|
||||
AM_RANGE(0xf830, 0xf830) AM_READ_PORT("P2")
|
||||
AM_RANGE(0xf840, 0xf840) AM_READ_PORT("SYSTEM")
|
||||
AM_RANGE(0xfc00, 0xfc07) AM_WRITE(bgscroll_w)
|
||||
AM_RANGE(0xfc08, 0xfc0f) AM_WRITE(fgscroll_w)
|
||||
AM_RANGE(0xfc00, 0xfc07) AM_DEVWRITE("bg", dooyong_rom_tilemap_device, ctrl_w)
|
||||
AM_RANGE(0xfc08, 0xfc0f) AM_DEVWRITE("fg", dooyong_rom_tilemap_device, ctrl_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( rshark_map, AS_PROGRAM, 16, dooyong_68k_state )
|
||||
@ -270,11 +270,11 @@ static ADDRESS_MAP_START( popbingo_map, AS_PROGRAM, 16, dooyong_68k_state )
|
||||
AM_RANGE(0x0c0012, 0x0c0013) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
|
||||
AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(ctrl_w)
|
||||
AM_RANGE(0x0c0018, 0x0c001b) AM_WRITENOP // ?
|
||||
AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE8(bgscroll_w, 0x00ff)
|
||||
AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE8(bg2scroll_w, 0x00ff)
|
||||
AM_RANGE(0x0c4000, 0x0c400f) AM_DEVWRITE8("bg", dooyong_rom_tilemap_device, ctrl_w, 0x00ff)
|
||||
AM_RANGE(0x0c4010, 0x0c401f) AM_DEVWRITE8("bg2", dooyong_rom_tilemap_device, ctrl_w, 0x00ff)
|
||||
AM_RANGE(0x0c8000, 0x0c8fff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
|
||||
AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE8(fgscroll_w, 0x00ff) // not used atm
|
||||
AM_RANGE(0x0cc010, 0x0cc01f) AM_WRITE8(fg2scroll_w, 0x00ff) // not used atm
|
||||
//AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE8(fgscroll_w, 0x00ff) // not used atm
|
||||
//AM_RANGE(0x0cc010, 0x0cc01f) AM_WRITE8(fg2scroll_w, 0x00ff) // not used atm
|
||||
AM_RANGE(0x0dc000, 0x0dc01f) AM_RAM // registers of some kind?
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -840,6 +840,9 @@ static MACHINE_CONFIG_START( lastday, dooyong_z80_ym2203_state )
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", lastday)
|
||||
MCFG_PALETTE_ADD("palette", 1024)
|
||||
MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
|
||||
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_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, lastday)
|
||||
|
||||
@ -888,6 +891,9 @@ static MACHINE_CONFIG_START( gulfstrm, dooyong_z80_ym2203_state )
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", lastday)
|
||||
MCFG_PALETTE_ADD("palette", 1024)
|
||||
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
|
||||
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_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, gulfstrm)
|
||||
|
||||
@ -923,6 +929,9 @@ static MACHINE_CONFIG_START( pollux, dooyong_z80_ym2203_state )
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", lastday)
|
||||
MCFG_PALETTE_ADD("palette", 1024*2)
|
||||
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
|
||||
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_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, pollux)
|
||||
|
||||
@ -957,6 +966,11 @@ static MACHINE_CONFIG_START( bluehawk, dooyong_z80_state )
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", bluehawk)
|
||||
MCFG_PALETTE_ADD("palette", 1024)
|
||||
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_ADD("bg", "gfxdecode", 2, "gfx3", 0x78000)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_ADD("fg", "gfxdecode", 3, "gfx4", 0x78000)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_ADD("fg2", "gfxdecode", 4, "gfx5", 0x38000)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, bluehawk)
|
||||
|
||||
@ -991,6 +1005,10 @@ static MACHINE_CONFIG_START( flytiger, dooyong_z80_state )
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", flytiger)
|
||||
MCFG_PALETTE_ADD("palette", 1024*2)
|
||||
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_ADD("bg", "gfxdecode", 2, "gfx3", 0x78000)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_ADD("fg", "gfxdecode", 3, "gfx4", 0x78000)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, flytiger)
|
||||
|
||||
@ -1022,6 +1040,11 @@ static MACHINE_CONFIG_START( primella, dooyong_z80_state )
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", primella)
|
||||
MCFG_PALETTE_ADD("palette", 1024)
|
||||
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_ADD("bg", "gfxdecode", 1, "gfx2", -0x8000)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_PRIMELLA_CODE_BITS(10)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_ADD("fg", "gfxdecode", 2, "gfx3", -0x8000)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(15)
|
||||
MCFG_DOOYONG_ROM_TILEMAP_PRIMELLA_CODE_BITS(10)
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, primella)
|
||||
|
||||
@ -1131,6 +1154,10 @@ static MACHINE_CONFIG_START( popbingo, dooyong_68k_state )
|
||||
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)
|
||||
|
||||
|
@ -1,7 +1,59 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nicola Salmoria
|
||||
// copyright-holders:Nicola Salmoria,Vas Crabb
|
||||
#include "video/bufsprite.h"
|
||||
|
||||
#define MCFG_DOOYONG_ROM_TILEMAP_ADD(tag, gfx, num, rom, offset) \
|
||||
MCFG_DEVICE_ADD(tag, DOOYONG_ROM_TILEMAP, 0) \
|
||||
dooyong_rom_tilemap_device::static_set_gfxdecode_tag(*device, "^" gfx); \
|
||||
dooyong_rom_tilemap_device::static_set_tilerom_tag(*device, "^" rom); \
|
||||
dooyong_rom_tilemap_device::static_set_gfxnum(*device, (num)); \
|
||||
dooyong_rom_tilemap_device::static_set_tilerom_offset(*device, (offset));
|
||||
#define MCFG_DOOYONG_ROM_TILEMAP_TRANSPARENT_PEN(pen) \
|
||||
dooyong_rom_tilemap_device::static_set_transparent_pen(*device, (pen));
|
||||
#define MCFG_DOOYONG_ROM_TILEMAP_PRIMELLA_CODE_BITS(bits) \
|
||||
dooyong_rom_tilemap_device::static_set_primella_code_bits(*device, (bits));
|
||||
|
||||
extern device_type const DOOYONG_ROM_TILEMAP;
|
||||
|
||||
class dooyong_rom_tilemap_device : public device_t
|
||||
{
|
||||
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:
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
TILE_GET_INFO_MEMBER(tile_info);
|
||||
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_region_ptr<UINT8> 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 dooyong_state : public driver_device
|
||||
{
|
||||
public:
|
||||
@ -11,52 +63,18 @@ public:
|
||||
, m_audiocpu(*this, "audiocpu")
|
||||
, m_gfxdecode(*this, "gfxdecode")
|
||||
, m_palette(*this, "palette")
|
||||
, m_bg(*this, "bg")
|
||||
, m_bg2(*this, "bg2")
|
||||
{ }
|
||||
|
||||
DECLARE_WRITE8_MEMBER(bgscroll_w);
|
||||
DECLARE_WRITE8_MEMBER(bg2scroll_w);
|
||||
DECLARE_WRITE8_MEMBER(fgscroll_w);
|
||||
DECLARE_WRITE8_MEMBER(fg2scroll_w);
|
||||
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_bg2_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_fg_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_fg2_tile_info);
|
||||
inline void get_tile_info(tile_data &tileinfo, int tile_index, UINT8 const *tilerom, UINT8 const *scroll, int graphics);
|
||||
inline void scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map);
|
||||
|
||||
void clear_video_regs()
|
||||
{
|
||||
std::fill(std::begin(m_bgscroll8), std::end(m_bgscroll8), 0);
|
||||
std::fill(std::begin(m_bg2scroll8), std::end(m_bg2scroll8), 0);
|
||||
std::fill(std::begin(m_fgscroll8), std::end(m_fgscroll8), 0);
|
||||
std::fill(std::begin(m_fg2scroll8), std::end(m_fg2scroll8), 0);
|
||||
m_palette_bank = 0;
|
||||
}
|
||||
|
||||
tilemap_t *m_bg_tilemap = nullptr;
|
||||
tilemap_t *m_bg2_tilemap = nullptr;
|
||||
tilemap_t *m_fg_tilemap = nullptr;
|
||||
tilemap_t *m_fg2_tilemap = nullptr;
|
||||
tilemap_t *m_tx_tilemap = nullptr;
|
||||
UINT8 m_bgscroll8[0x10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
UINT8 m_bg2scroll8[0x10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
UINT8 m_fgscroll8[0x10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
UINT8 m_fg2scroll8[0x10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
UINT8 *m_bg_tilerom = nullptr;
|
||||
UINT8 *m_bg2_tilerom = nullptr;
|
||||
UINT8 *m_fg_tilerom = nullptr;
|
||||
UINT8 *m_fg2_tilerom = nullptr;
|
||||
int m_bg_gfx = 0;
|
||||
int m_bg2_gfx = 0;
|
||||
int m_fg_gfx = 0;
|
||||
int m_fg2_gfx = 0;
|
||||
UINT8 m_palette_bank = 0;
|
||||
int m_bg_fg_tilemap_mode = 0;
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
optional_device<dooyong_rom_tilemap_device> m_bg;
|
||||
optional_device<dooyong_rom_tilemap_device> m_bg2;
|
||||
};
|
||||
|
||||
class dooyong_z80_state : public dooyong_state
|
||||
@ -65,6 +83,8 @@ public:
|
||||
dooyong_z80_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: dooyong_state(mconfig, type, tag)
|
||||
, m_txvideoram(*this, "txvideoram")
|
||||
, m_fg(*this, "fg")
|
||||
, m_fg2(*this, "fg2")
|
||||
, m_spriteram(*this, "spriteram")
|
||||
{ }
|
||||
|
||||
@ -98,8 +118,11 @@ public:
|
||||
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;
|
||||
|
||||
optional_device<dooyong_rom_tilemap_device> m_fg;
|
||||
optional_device<dooyong_rom_tilemap_device> m_fg2;
|
||||
optional_device<buffered_spriteram8_device> m_spriteram;
|
||||
};
|
||||
|
||||
@ -138,6 +161,20 @@ public:
|
||||
, m_spriteram(*this, "spriteram")
|
||||
{ }
|
||||
|
||||
void clear_video_regs()
|
||||
{
|
||||
std::fill(std::begin(m_bgscroll8), std::end(m_bgscroll8), 0);
|
||||
std::fill(std::begin(m_bg2scroll8), std::end(m_bg2scroll8), 0);
|
||||
std::fill(std::begin(m_fgscroll8), std::end(m_fgscroll8), 0);
|
||||
std::fill(std::begin(m_fg2scroll8), std::end(m_fg2scroll8), 0);
|
||||
}
|
||||
|
||||
DECLARE_WRITE8_MEMBER(bgscroll_w);
|
||||
DECLARE_WRITE8_MEMBER(bg2scroll_w);
|
||||
DECLARE_WRITE8_MEMBER(fgscroll_w);
|
||||
DECLARE_WRITE8_MEMBER(fg2scroll_w);
|
||||
inline void scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map);
|
||||
|
||||
DECLARE_WRITE16_MEMBER(ctrl_w);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(scanline);
|
||||
TILE_GET_INFO_MEMBER(rshark_get_bg_tile_info);
|
||||
@ -151,10 +188,26 @@ public:
|
||||
DECLARE_VIDEO_START(rshark);
|
||||
DECLARE_VIDEO_START(popbingo);
|
||||
|
||||
tilemap_t *m_bg_tilemap = nullptr;
|
||||
tilemap_t *m_bg2_tilemap = nullptr;
|
||||
tilemap_t *m_fg_tilemap = nullptr;
|
||||
tilemap_t *m_fg2_tilemap = nullptr;
|
||||
UINT8 m_bgscroll8[0x10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
UINT8 m_bg2scroll8[0x10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
UINT8 m_fgscroll8[0x10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
UINT8 m_fg2scroll8[0x10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
UINT8 *m_bg_tilerom = nullptr;
|
||||
UINT8 *m_bg_tilerom2 = nullptr;
|
||||
UINT8 *m_bg2_tilerom = nullptr;
|
||||
UINT8 *m_bg2_tilerom2 = nullptr;
|
||||
UINT8 *m_fg_tilerom = nullptr;
|
||||
UINT8 *m_fg_tilerom2 = nullptr;
|
||||
UINT8 *m_fg2_tilerom = nullptr;
|
||||
UINT8 *m_fg2_tilerom2 = nullptr;
|
||||
int m_bg_gfx = 0;
|
||||
int m_bg2_gfx = 0;
|
||||
int m_fg_gfx = 0;
|
||||
int m_fg2_gfx = 0;
|
||||
UINT16 m_bg2_priority = 0;
|
||||
|
||||
bitmap_ind16 m_bg_bitmap;
|
||||
|
@ -1,10 +1,178 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nicola Salmoria
|
||||
// copyright-holders:Nicola Salmoria,Vas Crabb
|
||||
#include "emu.h"
|
||||
#include "includes/dooyong.h"
|
||||
|
||||
|
||||
inline void dooyong_state::scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map)
|
||||
/* These games all have ROM-based tilemaps for the backgrounds, title
|
||||
screens and sometimes "bosses" and special attacks. There are three
|
||||
schemes for tilemap encoding. The scheme is chosen based on the
|
||||
contents of the tilemap control variables declared above.
|
||||
Note that although the tilemaps are arbitrarily wide (hundreds of
|
||||
thousands of pixels, depending on the size of the ROM), we only
|
||||
decode a 1024 pixel wide block at a time, and invalidate the tilemap
|
||||
when the x scroll moves out of range (trying to decode the whole lot
|
||||
at once uses hundreds of megabytes of RAM). */
|
||||
|
||||
device_type const DOOYONG_ROM_TILEMAP = &device_creator<dooyong_rom_tilemap_device>;
|
||||
|
||||
|
||||
dooyong_rom_tilemap_device::dooyong_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, DOOYONG_ROM_TILEMAP, "Dooyong ROM Tilemap", tag, owner, clock, "dooyong_rom_tilemap", __FILE__)
|
||||
, 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;
|
||||
}
|
||||
|
||||
void dooyong_rom_tilemap_device::static_set_transparent_pen(device_t &device, unsigned pen)
|
||||
{
|
||||
downcast<dooyong_rom_tilemap_device &>(device).m_transparent_pen = pen;
|
||||
}
|
||||
|
||||
void dooyong_rom_tilemap_device::static_set_primella_code_bits(device_t &device, unsigned bits)
|
||||
{
|
||||
dooyong_rom_tilemap_device &tilemap_device(downcast<dooyong_rom_tilemap_device &>(device));
|
||||
tilemap_device.m_primella_code_mask = (1U << bits) - 1U;
|
||||
tilemap_device.m_primella_color_mask = ((1U << 14) - 1) & ~tilemap_device.m_primella_code_mask;
|
||||
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)
|
||||
{
|
||||
UINT8 const old = m_registers[offset];
|
||||
if (old != data)
|
||||
{
|
||||
m_registers[offset] = data;
|
||||
switch (offset)
|
||||
{
|
||||
case 0: // Low byte of x scroll - scroll tilemap
|
||||
m_tilemap->set_scrollx(0, data);
|
||||
break;
|
||||
case 1: // High byte of x scroll - mark tilemap dirty so new tile gfx will be loaded
|
||||
m_tilemap->mark_all_dirty();
|
||||
break;
|
||||
case 3: // Low byte of y scroll
|
||||
case 4: // High byte of y scroll
|
||||
m_tilemap->set_scrolly(0, m_registers[3] | (unsigned(m_registers[4]) << 8));
|
||||
break;
|
||||
case 6: // Tilemap enable and mode control
|
||||
m_tilemap->enable(!BIT(data, 4));
|
||||
if (BIT(data ^ old, 5)) // This sets the tilemap data format
|
||||
m_tilemap->mark_all_dirty();
|
||||
break;
|
||||
default: // Other addresses are used but function is unknown
|
||||
// 0x05 and 0x07 are initialised on startup
|
||||
// 0x02 is initialised on startup by some games and written to continuously by others
|
||||
// printf("Unknown %s tilemap control: 0x%02x = 0x%02x\n", tag(), unsigned(offset), unsigned(data));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
m_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode,
|
||||
tilemap_get_info_delegate(FUNC(dooyong_rom_tilemap_device::tile_info), this),
|
||||
TILEMAP_SCAN_COLS,
|
||||
32, 32,
|
||||
32, 8);
|
||||
if (~m_transparent_pen)
|
||||
m_tilemap->set_transparent_pen(m_transparent_pen);
|
||||
|
||||
if (m_tilerom_offset < 0)
|
||||
m_tilerom_offset = m_tilerom.length() + m_tilerom_offset;
|
||||
|
||||
std::fill(std::begin(m_registers), std::end(m_registers), 0);
|
||||
m_palette_bank = 0U;
|
||||
|
||||
save_item(NAME(m_registers));
|
||||
save_item(NAME(m_palette_bank));
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(dooyong_rom_tilemap_device::tile_info)
|
||||
{
|
||||
tilemap_memory_index const offs = (tile_index + (unsigned(m_registers[1]) << 6)) << 1;
|
||||
unsigned const attr = m_tilerom[m_tilerom_offset + offs];
|
||||
unsigned code, color, flags;
|
||||
if (BIT(m_registers[6], 5))
|
||||
{ // lastday/gulfstrm/pollux/flytiger
|
||||
/* Tiles take two bytes in ROM:
|
||||
MSB LSB
|
||||
[offs + 0x00] cCCC CYXc (bit 9 of gfx code, bits 3-0 of color, Y flip, X flip, bit 8 of gfx code)
|
||||
[offs + 0x01] cccc cccc (bits 7-0 of gfx code)
|
||||
c = gfx code
|
||||
C = color code
|
||||
X = x flip
|
||||
Y = y flip */
|
||||
code = m_tilerom[m_tilerom_offset + offs + 1] | (BIT(attr, 0) << 8) | (BIT(attr, 7) << 9);
|
||||
color = m_palette_bank | ((attr >> 3) & 0x0fU);
|
||||
flags = TILE_FLIPYX((attr >> 1) & 0x03U);
|
||||
}
|
||||
else
|
||||
{ // primella/popbingo
|
||||
/* Tiles take two bytes in ROM:
|
||||
MSB LSB
|
||||
[offs + 0x00] YXCC CCcc (Y flip, X flip, bits 3-0 of color code, bits 9-8 of gfx code)
|
||||
[offs + 0x01] cccc cccc (bits 7-0 of gfx code)
|
||||
c = gfx code
|
||||
C = color code
|
||||
X = x flip
|
||||
Y = y flip */
|
||||
code = (attr << 8) | m_tilerom[m_tilerom_offset + offs + 1];
|
||||
color = (code & m_primella_color_mask) >> m_primella_color_shift;
|
||||
flags = TILE_FLIPYX((attr >> 6) & 0x03U);
|
||||
code &= m_primella_code_mask;
|
||||
}
|
||||
|
||||
tileinfo.set(m_gfxnum, code, color, flags);
|
||||
}
|
||||
|
||||
|
||||
inline void dooyong_68k_state::scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map)
|
||||
{
|
||||
UINT8 const old = scroll[offset];
|
||||
if (old != data)
|
||||
@ -48,22 +216,22 @@ inline void dooyong_state::scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, t
|
||||
/* These handle writes to the tilemap scroll registers.
|
||||
There is one per tilemap, wrapping the above function that does the work. */
|
||||
|
||||
WRITE8_MEMBER(dooyong_state::bgscroll_w)
|
||||
WRITE8_MEMBER(dooyong_68k_state::bgscroll_w)
|
||||
{
|
||||
scroll8_w(offset, data, m_bgscroll8, m_bg_tilemap);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(dooyong_state::bg2scroll_w)
|
||||
WRITE8_MEMBER(dooyong_68k_state::bg2scroll_w)
|
||||
{
|
||||
scroll8_w(offset, data, m_bg2scroll8, m_bg2_tilemap);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(dooyong_state::fgscroll_w)
|
||||
WRITE8_MEMBER(dooyong_68k_state::fgscroll_w)
|
||||
{
|
||||
scroll8_w(offset, data, m_fgscroll8, m_fg_tilemap);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(dooyong_state::fg2scroll_w)
|
||||
WRITE8_MEMBER(dooyong_68k_state::fg2scroll_w)
|
||||
{
|
||||
scroll8_w(offset, data, m_fg2scroll8, m_fg2_tilemap);
|
||||
}
|
||||
@ -115,8 +283,8 @@ WRITE8_MEMBER(dooyong_z80_ym2203_state::pollux_ctrl_w)
|
||||
if (m_paletteram_flytiger) m_palette_bank = BIT(data, 1);
|
||||
if (last_palbank != m_palette_bank)
|
||||
{
|
||||
m_bg_tilemap->mark_all_dirty();
|
||||
m_fg_tilemap->mark_all_dirty();
|
||||
m_bg->set_palette_bank(m_palette_bank << 6);
|
||||
m_fg->set_palette_bank(m_palette_bank << 6);
|
||||
m_tx_tilemap->mark_all_dirty();
|
||||
}
|
||||
|
||||
@ -173,8 +341,8 @@ WRITE8_MEMBER(dooyong_z80_state::flytiger_ctrl_w)
|
||||
m_palette_bank = BIT(data, 3);
|
||||
if (last_palbank != m_palette_bank)
|
||||
{
|
||||
m_bg_tilemap->mark_all_dirty();
|
||||
m_fg_tilemap->mark_all_dirty();
|
||||
m_bg->set_palette_bank(m_palette_bank << 6);
|
||||
m_fg->set_palette_bank(m_palette_bank << 6);
|
||||
m_tx_tilemap->mark_all_dirty();
|
||||
}
|
||||
|
||||
@ -183,85 +351,6 @@ WRITE8_MEMBER(dooyong_z80_state::flytiger_ctrl_w)
|
||||
}
|
||||
|
||||
|
||||
/* These games all have ROM-based tilemaps for the backgrounds, title
|
||||
screens and sometimes "bosses" and special attacks. There are three
|
||||
schemes for tilemap encoding. The scheme is chosen based on the
|
||||
contents of the tilemap control variables declared above.
|
||||
Note that although the tilemaps are arbitrarily wide (hundreds of
|
||||
thousands of pixels, depending on the size of the ROM), we only
|
||||
decode a 1024 pixel wide block at a time, and invalidate the tilemap
|
||||
when the x scroll moves out of range (trying to decode the whole lot
|
||||
at once uses hundreds of megabytes of RAM). */
|
||||
|
||||
inline void dooyong_state::get_tile_info(tile_data &tileinfo, int tile_index,
|
||||
UINT8 const *tilerom, UINT8 const *scroll, int graphics)
|
||||
{
|
||||
int const offs = (tile_index + ((int)scroll[1] << 6)) * 2;
|
||||
int const attr = tilerom[offs];
|
||||
int code, color, flags;
|
||||
if (scroll[6] & 0x20)
|
||||
{ /* lastday/gulfstrm/pollux/flytiger */
|
||||
/* Tiles take two bytes in ROM:
|
||||
MSB LSB
|
||||
[offs + 0x00] cCCC CYXc (bit 9 of gfx code, bits 3-0 of color, Y flip, X flip, bit 8 of gfx code)
|
||||
[offs + 0x01] cccc cccc (bits 7-0 of gfx code)
|
||||
c = gfx code
|
||||
C = color code
|
||||
X = x flip
|
||||
Y = y flip */
|
||||
code = tilerom[offs + 1] | ((attr & 0x01) << 8) | ((attr & 0x80) << 2);
|
||||
color = (attr & 0x78) >> 3;
|
||||
color |= m_palette_bank << 6;
|
||||
flags = TILE_FLIPYX((attr & 0x06) >> 1);
|
||||
}
|
||||
else
|
||||
{ /* primella/popbingo */
|
||||
/* Tiles take two bytes in ROM:
|
||||
MSB LSB
|
||||
[offs + 0x00] YXCC CCcc (Y flip, X flip, bits 3-0 of color code, bits 9-8 of gfx code)
|
||||
[offs + 0x01] cccc cccc (bits 7-0 of gfx code)
|
||||
c = gfx code
|
||||
C = color code
|
||||
X = x flip
|
||||
Y = y flip */
|
||||
int codemask = 0x03;
|
||||
int palmask = 0x3c;
|
||||
|
||||
if (m_bg_fg_tilemap_mode == 1)
|
||||
{
|
||||
// pop bingo has an 8bpp layer and uses what would be the low palette bit to address more tiles (girls 4,5,6 in bonus game)
|
||||
codemask = 0x07;
|
||||
palmask = 0x00;
|
||||
}
|
||||
|
||||
code = tilerom[offs + 1] | ((attr & codemask) << 8);
|
||||
color = (attr & palmask) >> 2;
|
||||
flags = TILE_FLIPYX((attr & 0xC0) >> 6);
|
||||
}
|
||||
|
||||
tileinfo.set(graphics, code, color, flags);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(dooyong_state::get_bg_tile_info)
|
||||
{
|
||||
get_tile_info(tileinfo, tile_index, m_bg_tilerom, m_bgscroll8, m_bg_gfx);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(dooyong_state::get_bg2_tile_info)
|
||||
{
|
||||
get_tile_info(tileinfo, tile_index, m_bg2_tilerom, m_bg2scroll8, m_bg2_gfx);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(dooyong_state::get_fg_tile_info)
|
||||
{
|
||||
get_tile_info(tileinfo, tile_index, m_fg_tilerom, m_fgscroll8, m_fg_gfx);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(dooyong_state::get_fg2_tile_info)
|
||||
{
|
||||
get_tile_info(tileinfo, tile_index, m_fg2_tilerom, m_fg2scroll8, m_fg2_gfx);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(dooyong_z80_state::get_tx_tile_info)
|
||||
{
|
||||
/* Each tile takes two bytes of memory:
|
||||
@ -385,8 +474,8 @@ UINT32 dooyong_z80_ym2203_state::screen_update_lastday(screen_device &screen, bi
|
||||
else
|
||||
m_tx_tilemap->set_scrolly(0, -8);
|
||||
|
||||
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
|
||||
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
|
||||
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);
|
||||
|
||||
if (!m_sprites_disabled)
|
||||
@ -406,8 +495,8 @@ UINT32 dooyong_z80_ym2203_state::screen_update_gulfstrm(screen_device &screen, b
|
||||
else
|
||||
m_tx_tilemap->set_scrolly(0, -8);
|
||||
|
||||
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
|
||||
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
|
||||
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);
|
||||
|
||||
draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT);
|
||||
@ -420,8 +509,8 @@ UINT32 dooyong_z80_ym2203_state::screen_update_pollux(screen_device &screen, bit
|
||||
bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
screen.priority().fill(0, cliprect);
|
||||
|
||||
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
|
||||
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
|
||||
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);
|
||||
|
||||
draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT);
|
||||
@ -436,13 +525,13 @@ UINT32 dooyong_z80_state::screen_update_flytiger(screen_device &screen, bitmap_i
|
||||
|
||||
if (m_flytiger_pri)
|
||||
{
|
||||
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
|
||||
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
|
||||
m_fg->draw(screen, bitmap, cliprect, 0, 1);
|
||||
m_bg->draw(screen, bitmap, cliprect, 0, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
|
||||
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
|
||||
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);
|
||||
|
||||
@ -457,9 +546,9 @@ UINT32 dooyong_z80_state::screen_update_bluehawk(screen_device &screen, bitmap_i
|
||||
bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
screen.priority().fill(0, cliprect);
|
||||
|
||||
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
|
||||
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
|
||||
m_fg2_tilemap->draw(screen, bitmap, cliprect, 0, 4);
|
||||
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);
|
||||
|
||||
draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT | SPRITE_YSHIFT_BLUEHAWK);
|
||||
@ -471,9 +560,9 @@ UINT32 dooyong_z80_state::screen_update_primella(screen_device &screen, bitmap_i
|
||||
{
|
||||
bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
|
||||
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_bg->draw(screen, bitmap, cliprect, 0, 0);
|
||||
if (m_tx_pri) m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_fg_tilemap->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);
|
||||
|
||||
return 0;
|
||||
@ -484,33 +573,17 @@ UINT32 dooyong_z80_state::screen_update_primella(screen_device &screen, bitmap_i
|
||||
VIDEO_START_MEMBER(dooyong_z80_ym2203_state, lastday)
|
||||
{
|
||||
/* Configure tilemap callbacks */
|
||||
m_bg_tilerom = memregion("gfx5")->base();
|
||||
m_fg_tilerom = memregion("gfx6")->base();
|
||||
m_bg_gfx = 2;
|
||||
m_fg_gfx = 3;
|
||||
m_bg_fg_tilemap_mode = 0;
|
||||
m_tx_tilemap_mode = 0;
|
||||
|
||||
/* Create tilemaps */
|
||||
m_bg_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
m_fg_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
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_fg_tilemap->set_transparent_pen(15);
|
||||
m_tx_tilemap->set_transparent_pen(15);
|
||||
|
||||
clear_video_regs();
|
||||
|
||||
/* Register for save/restore */
|
||||
save_item(NAME(m_bgscroll8));
|
||||
save_item(NAME(m_fgscroll8));
|
||||
save_item(NAME(m_sprites_disabled));
|
||||
save_item(NAME(m_interrupt_line_1));
|
||||
save_item(NAME(m_interrupt_line_2));
|
||||
@ -519,33 +592,19 @@ VIDEO_START_MEMBER(dooyong_z80_ym2203_state, lastday)
|
||||
VIDEO_START_MEMBER(dooyong_z80_ym2203_state, gulfstrm)
|
||||
{
|
||||
/* Configure tilemap callbacks */
|
||||
m_bg_tilerom = memregion("gfx5")->base();
|
||||
m_fg_tilerom = memregion("gfx6")->base();
|
||||
m_bg_gfx = 2;
|
||||
m_fg_gfx = 3;
|
||||
m_bg_fg_tilemap_mode = 0;
|
||||
m_tx_tilemap_mode = 0;
|
||||
|
||||
/* Create tilemaps */
|
||||
m_bg_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
m_fg_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
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_fg_tilemap->set_transparent_pen(15);
|
||||
m_tx_tilemap->set_transparent_pen(15);
|
||||
|
||||
clear_video_regs();
|
||||
m_palette_bank = 0;
|
||||
|
||||
/* Register for save/restore */
|
||||
save_item(NAME(m_bgscroll8));
|
||||
save_item(NAME(m_fgscroll8));
|
||||
save_item(NAME(m_palette_bank));
|
||||
save_item(NAME(m_interrupt_line_1));
|
||||
save_item(NAME(m_interrupt_line_2));
|
||||
@ -554,36 +613,22 @@ VIDEO_START_MEMBER(dooyong_z80_ym2203_state, gulfstrm)
|
||||
VIDEO_START_MEMBER(dooyong_z80_ym2203_state, pollux)
|
||||
{
|
||||
/* Configure tilemap callbacks */
|
||||
m_bg_tilerom = memregion("gfx5")->base();
|
||||
m_fg_tilerom = memregion("gfx6")->base();
|
||||
m_bg_gfx = 2;
|
||||
m_fg_gfx = 3;
|
||||
m_bg_fg_tilemap_mode = 0;
|
||||
m_tx_tilemap_mode = 0;
|
||||
|
||||
m_paletteram_flytiger = make_unique_clear<UINT8[]>(0x1000);
|
||||
save_pointer(NAME(m_paletteram_flytiger.get()), 0x1000);
|
||||
|
||||
/* Create tilemaps */
|
||||
m_bg_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
m_fg_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
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_fg_tilemap->set_transparent_pen(15);
|
||||
m_tx_tilemap->set_transparent_pen(15);
|
||||
|
||||
clear_video_regs();
|
||||
m_palette_bank = 0;
|
||||
|
||||
/* Register for save/restore */
|
||||
save_item(NAME(m_bgscroll8));
|
||||
save_item(NAME(m_fgscroll8));
|
||||
save_item(NAME(m_palette_bank));
|
||||
save_item(NAME(m_interrupt_line_1));
|
||||
save_item(NAME(m_interrupt_line_2));
|
||||
@ -592,76 +637,36 @@ VIDEO_START_MEMBER(dooyong_z80_ym2203_state, pollux)
|
||||
VIDEO_START_MEMBER(dooyong_z80_state, bluehawk)
|
||||
{
|
||||
/* Configure tilemap callbacks */
|
||||
m_bg_tilerom = memregion("gfx3")->base() + 0x78000;
|
||||
m_fg_tilerom = memregion("gfx4")->base() + 0x78000;
|
||||
m_fg2_tilerom = memregion("gfx5")->base() + 0x38000;
|
||||
m_bg_gfx = 2;
|
||||
m_fg_gfx = 3;
|
||||
m_fg2_gfx = 4;
|
||||
m_bg_fg_tilemap_mode = 0;
|
||||
m_tx_tilemap_mode = 1;
|
||||
|
||||
/* Create tilemaps */
|
||||
m_bg_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
m_fg_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
m_fg2_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg2_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
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_fg_tilemap->set_transparent_pen(15);
|
||||
m_fg2_tilemap->set_transparent_pen(15);
|
||||
m_tx_tilemap->set_transparent_pen(15);
|
||||
|
||||
clear_video_regs();
|
||||
|
||||
/* Register for save/restore */
|
||||
save_item(NAME(m_bgscroll8));
|
||||
save_item(NAME(m_fgscroll8));
|
||||
save_item(NAME(m_fg2scroll8));
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(dooyong_z80_state, flytiger)
|
||||
{
|
||||
/* Configure tilemap callbacks */
|
||||
m_bg_tilerom = memregion("gfx3")->base() + 0x78000;
|
||||
m_fg_tilerom = memregion("gfx4")->base() + 0x78000;
|
||||
m_bg_gfx = 2;
|
||||
m_fg_gfx = 3;
|
||||
m_bg_fg_tilemap_mode = 0;
|
||||
m_tx_tilemap_mode = 0;
|
||||
|
||||
m_paletteram_flytiger = make_unique_clear<UINT8[]>(0x1000);
|
||||
save_pointer(NAME(m_paletteram_flytiger.get()), 0x1000);
|
||||
|
||||
/* Create tilemaps */
|
||||
m_bg_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
m_fg_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
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_bg_tilemap->set_transparent_pen(15);
|
||||
m_fg_tilemap->set_transparent_pen(15);
|
||||
m_tx_tilemap->set_transparent_pen(15);
|
||||
|
||||
clear_video_regs();
|
||||
m_palette_bank = 0;
|
||||
|
||||
/* Register for save/restore */
|
||||
save_item(NAME(m_bgscroll8));
|
||||
save_item(NAME(m_fgscroll8));
|
||||
save_item(NAME(m_palette_bank));
|
||||
save_item(NAME(m_flytiger_pri));
|
||||
}
|
||||
@ -669,33 +674,17 @@ VIDEO_START_MEMBER(dooyong_z80_state, flytiger)
|
||||
VIDEO_START_MEMBER(dooyong_z80_state, primella)
|
||||
{
|
||||
/* Configure tilemap callbacks */
|
||||
m_bg_tilerom = memregion("gfx2")->base() + memregion("gfx2")->bytes() - 0x8000;
|
||||
m_fg_tilerom = memregion("gfx3")->base() + memregion("gfx3")->bytes() - 0x8000;
|
||||
m_bg_gfx = 1;
|
||||
m_fg_gfx = 2;
|
||||
m_bg_fg_tilemap_mode = 0;
|
||||
m_tx_tilemap_mode = 1;
|
||||
|
||||
/* Create tilemaps */
|
||||
m_bg_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
m_fg_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
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_fg_tilemap->set_transparent_pen(15);
|
||||
m_tx_tilemap->set_transparent_pen(15);
|
||||
|
||||
clear_video_regs();
|
||||
|
||||
/* Register for save/restore */
|
||||
save_item(NAME(m_bgscroll8));
|
||||
save_item(NAME(m_fgscroll8));
|
||||
save_item(NAME(m_tx_pri));
|
||||
}
|
||||
|
||||
@ -841,10 +830,10 @@ UINT32 dooyong_68k_state::screen_update_popbingo(screen_device &screen, bitmap_i
|
||||
screen.priority().fill(0, cliprect);
|
||||
|
||||
m_bg_bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
m_bg_tilemap->draw(screen, m_bg_bitmap, cliprect, 0, 1);
|
||||
m_bg->draw(screen, m_bg_bitmap, cliprect, 0, 1);
|
||||
|
||||
m_bg2_bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
m_bg2_tilemap->draw(screen, m_bg2_bitmap, cliprect, 0, 1);
|
||||
m_bg2->draw(screen, m_bg2_bitmap, cliprect, 0, 1);
|
||||
|
||||
for (int y = cliprect.min_y; cliprect.max_y >= y; y++)
|
||||
{
|
||||
@ -877,7 +866,6 @@ VIDEO_START_MEMBER(dooyong_68k_state, rshark)
|
||||
m_bg2_gfx = 3;
|
||||
m_fg_gfx = 2;
|
||||
m_fg2_gfx = 1;
|
||||
m_bg_fg_tilemap_mode = 0;
|
||||
|
||||
/* Create tilemaps */
|
||||
m_bg_tilemap = &machine().tilemap().create(
|
||||
@ -910,30 +898,13 @@ VIDEO_START_MEMBER(dooyong_68k_state, rshark)
|
||||
|
||||
VIDEO_START_MEMBER(dooyong_68k_state, popbingo)
|
||||
{
|
||||
/* Configure tilemap callbacks */
|
||||
m_bg_tilerom = memregion("gfx2")->base();
|
||||
m_bg2_tilerom = memregion("gfx3")->base();
|
||||
m_bg_gfx = 1;
|
||||
m_bg2_gfx = 2;
|
||||
m_bg_fg_tilemap_mode = 1;
|
||||
|
||||
/* Create tilemaps */
|
||||
m_bg_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
m_bg2_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg2_tile_info),this), TILEMAP_SCAN_COLS,
|
||||
32, 32, 32, 8);
|
||||
|
||||
m_screen->register_screen_bitmap(m_bg_bitmap);
|
||||
m_screen->register_screen_bitmap(m_bg2_bitmap);
|
||||
|
||||
clear_video_regs();
|
||||
|
||||
/* Register for save/restore */
|
||||
save_item(NAME(m_bgscroll8));
|
||||
save_item(NAME(m_bg2scroll8));
|
||||
save_item(NAME(m_fgscroll8)); // Not used atm
|
||||
save_item(NAME(m_fg2scroll8)); // Not used atm
|
||||
save_item(NAME(m_bg2_priority));
|
||||
save_item(NAME(m_fgscroll8)); // Not used atm
|
||||
save_item(NAME(m_fg2scroll8)); // Not used atm
|
||||
save_item(NAME(m_bg2_priority)); // Not used atm
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user