mirror of
https://github.com/holub/mame
synced 2025-06-07 05:13:46 +03:00
Merge pull request #4853 from cam900/tc0480scp_intgfx
tc0480scp.cpp : Updates
This commit is contained in:
commit
1ff2bb92d4
@ -232,7 +232,7 @@ void galastrm_state::galastrm(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(3);
|
||||
m_tc0480scp->set_palette(m_palette);
|
||||
m_tc0480scp->set_offsets(-40, -3);
|
||||
m_tc0480scp->set_gfxdecode_tag(m_gfxdecode);
|
||||
|
||||
|
@ -282,7 +282,7 @@ void groundfx_state::groundfx(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(4);
|
||||
m_tc0480scp->set_palette(m_palette);
|
||||
m_tc0480scp->set_offsets(0x24, 0);
|
||||
m_tc0480scp->set_offsets_tx(-1, 0);
|
||||
m_tc0480scp->set_gfxdecode_tag(m_gfxdecode);
|
||||
|
@ -263,7 +263,7 @@ void gunbustr_state::gunbustr(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(2);
|
||||
m_tc0480scp->set_palette(m_palette);
|
||||
m_tc0480scp->set_offsets(0x20, 0x07);
|
||||
m_tc0480scp->set_offsets_tx(-1, -1);
|
||||
m_tc0480scp->set_offsets_flip(-1, 0);
|
||||
|
@ -454,7 +454,7 @@ void slapshot_state::slapshot(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(2);
|
||||
m_tc0480scp->set_palette(m_palette);
|
||||
m_tc0480scp->set_offsets(30 + 3, 9);
|
||||
m_tc0480scp->set_offsets_tx(-1, -1);
|
||||
m_tc0480scp->set_offsets_flip(0, 2);
|
||||
@ -522,7 +522,7 @@ void slapshot_state::opwolf3(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(2);
|
||||
m_tc0480scp->set_palette(m_palette);
|
||||
m_tc0480scp->set_offsets(30 + 3, 9);
|
||||
m_tc0480scp->set_offsets_tx(-1, -1);
|
||||
m_tc0480scp->set_offsets_flip(0, 2);
|
||||
|
@ -268,7 +268,7 @@ void superchs_state::superchs(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(2);
|
||||
m_tc0480scp->set_palette(m_palette);
|
||||
m_tc0480scp->set_offsets(0x20, 0x08);
|
||||
m_tc0480scp->set_offsets_tx(-1, 0);
|
||||
m_tc0480scp->set_gfxdecode_tag(m_gfxdecode);
|
||||
|
@ -3242,7 +3242,7 @@ void taitof2_state::footchmp(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(2);
|
||||
m_tc0480scp->set_palette(m_palette);
|
||||
m_tc0480scp->set_offsets(0x1d + 3, 0x08);
|
||||
m_tc0480scp->set_offsets_tx(-1, 0);
|
||||
m_tc0480scp->set_offsets_flip(-1, 0);
|
||||
@ -3276,7 +3276,7 @@ void taitof2_state::hthero(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(2);
|
||||
m_tc0480scp->set_palette(m_palette);
|
||||
m_tc0480scp->set_offsets(0x33 + 3, -0x04);
|
||||
m_tc0480scp->set_offsets_tx(-1, 0);
|
||||
m_tc0480scp->set_offsets_flip(-1, 0);
|
||||
@ -3442,7 +3442,7 @@ void taitof2_state::metalb(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(2);
|
||||
m_tc0480scp->set_palette(m_palette);
|
||||
m_tc0480scp->set_offsets(0x32 + 3, -0x04);
|
||||
m_tc0480scp->set_offsets_tx(1, 0);
|
||||
m_tc0480scp->set_offsets_flip(-1, 0);
|
||||
@ -3513,7 +3513,7 @@ void taitof2_state::deadconx(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(2);
|
||||
m_tc0480scp->set_palette(m_palette);
|
||||
m_tc0480scp->set_offsets(0x1e + 3, 0x08);
|
||||
m_tc0480scp->set_offsets_tx(-1, 0);
|
||||
m_tc0480scp->set_offsets_flip(-1, 0);
|
||||
@ -3536,7 +3536,7 @@ void taitof2_state::deadconxj(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(2);
|
||||
m_tc0480scp->set_palette(m_palette);
|
||||
m_tc0480scp->set_offsets(0x34 + 3, -0x05);
|
||||
m_tc0480scp->set_offsets_tx(-1, 0);
|
||||
m_tc0480scp->set_offsets_flip(-1, 0);
|
||||
|
@ -3807,7 +3807,7 @@ void taitoz_state::dblaxle(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(2);
|
||||
m_tc0480scp->set_palette("palette");
|
||||
m_tc0480scp->set_offsets(0x1f, 0x08);
|
||||
m_tc0480scp->set_gfxdecode_tag(m_gfxdecode);
|
||||
|
||||
@ -3879,7 +3879,7 @@ void taitoz_state::racingb(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(2);
|
||||
m_tc0480scp->set_palette("palette");
|
||||
m_tc0480scp->set_offsets(0x1f, 0x08);
|
||||
m_tc0480scp->set_gfxdecode_tag(m_gfxdecode);
|
||||
|
||||
|
@ -608,7 +608,7 @@ void undrfire_state::undrfire(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(4);
|
||||
m_tc0480scp->set_palette(m_palette);
|
||||
m_tc0480scp->set_offsets(0x24, 0);
|
||||
m_tc0480scp->set_offsets_tx(-1, 0);
|
||||
m_tc0480scp->set_gfxdecode_tag(m_gfxdecode);
|
||||
@ -670,7 +670,7 @@ void undrfire_state::cbombers(machine_config &config)
|
||||
|
||||
TC0480SCP(config, m_tc0480scp, 0);
|
||||
m_tc0480scp->set_gfx_region(1);
|
||||
m_tc0480scp->set_tx_region(4);
|
||||
m_tc0480scp->set_palette(m_palette);
|
||||
m_tc0480scp->set_offsets(0x24, 0);
|
||||
m_tc0480scp->set_offsets_tx(-1, 0);
|
||||
m_tc0480scp->set_col_base(4096);
|
||||
|
@ -152,14 +152,12 @@ Control registers
|
||||
|
||||
DEFINE_DEVICE_TYPE(TC0480SCP, tc0480scp_device, "tc0480scp", "Taito TC0480SCP")
|
||||
|
||||
tc0480scp_device::tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
tc0480scp_device::tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: device_t(mconfig, TC0480SCP, tag, owner, clock),
|
||||
m_tx_ram(nullptr),
|
||||
m_char_ram(nullptr),
|
||||
device_gfx_interface(mconfig, *this),
|
||||
m_pri_reg(0),
|
||||
m_dblwidth(0),
|
||||
m_gfxnum(0),
|
||||
m_txnum(0),
|
||||
m_x_offset(0),
|
||||
m_y_offset(0),
|
||||
m_text_xoffs(0),
|
||||
@ -173,7 +171,6 @@ tc0480scp_device::tc0480scp_device(const machine_config &mconfig, const char *ta
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
m_bg_ram[i] = nullptr;
|
||||
m_bgscroll_ram[i] = nullptr;
|
||||
m_rowzoom_ram[i] = nullptr;
|
||||
m_bgcolumn_ram[i] = nullptr;
|
||||
@ -206,18 +203,18 @@ void tc0480scp_device::device_start()
|
||||
|
||||
|
||||
/* Single width versions */
|
||||
m_tilemap[0][0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg0_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_tilemap[1][0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_tilemap[2][0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_tilemap[3][0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg3_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_tilemap[4][0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||
m_tilemap[0][0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg_tile_info<0x0000>),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_tilemap[1][0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg_tile_info<0x0800>),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_tilemap[2][0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg_tile_info<0x1000>),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_tilemap[3][0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg_tile_info<0x1800>),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_tilemap[4][0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||
|
||||
/* Double width versions */
|
||||
m_tilemap[0][1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg0_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
|
||||
m_tilemap[1][1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
|
||||
m_tilemap[2][1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
|
||||
m_tilemap[3][1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg3_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
|
||||
m_tilemap[4][1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||
m_tilemap[0][1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg_tile_info<0x0000>),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
|
||||
m_tilemap[1][1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg_tile_info<0x1000>),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
|
||||
m_tilemap[2][1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg_tile_info<0x2000>),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
|
||||
m_tilemap[3][1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg_tile_info<0x3000>),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
|
||||
m_tilemap[4][1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(tc0480scp_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
@ -277,7 +274,7 @@ void tc0480scp_device::device_start()
|
||||
set_layer_ptrs();
|
||||
|
||||
/* create the char set (gfx will then be updated dynamically from RAM) */
|
||||
m_gfxdecode->set_gfx(m_txnum, std::make_unique<gfx_element>(&m_gfxdecode->palette(), tc0480scp_charlayout, (uint8_t *)m_char_ram, NATIVE_ENDIAN_VALUE_LE_BE(8,0), 64, m_col_base));
|
||||
set_gfx(0, std::make_unique<gfx_element>(&palette(), tc0480scp_charlayout, (u8 *)&m_ram[0x7000], NATIVE_ENDIAN_VALUE_LE_BE(8,0), 64, m_col_base)); //e000
|
||||
m_gfxdecode->gfx(m_gfxnum)->set_colorbase(m_col_base);
|
||||
|
||||
save_item(NAME(m_ram));
|
||||
@ -305,69 +302,31 @@ void tc0480scp_device::device_reset()
|
||||
DEVICE HANDLERS
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
void tc0480scp_device::common_get_tc0480bg_tile_info( tile_data &tileinfo, int tile_index, u16 *ram, int gfxnum )
|
||||
template<unsigned Offset>
|
||||
TILE_GET_INFO_MEMBER(tc0480scp_device::get_bg_tile_info)
|
||||
{
|
||||
int code = ram[2 * tile_index + 1] & 0x7fff;
|
||||
int attr = ram[2 * tile_index];
|
||||
SET_TILE_INFO_MEMBER(gfxnum,
|
||||
int code = m_ram[(2 * tile_index) + 1 + Offset] & 0x7fff;
|
||||
int attr = m_ram[(2 * tile_index) + Offset];
|
||||
SET_TILE_INFO_MEMBER(m_gfxnum,
|
||||
code,
|
||||
(attr & 0xff),
|
||||
TILE_FLIPYX((attr & 0xc000) >> 14));
|
||||
}
|
||||
|
||||
void tc0480scp_device::common_get_tc0480tx_tile_info( tile_data &tileinfo, int tile_index, u16 *ram, int gfxnum )
|
||||
TILE_GET_INFO_MEMBER(tc0480scp_device::get_tx_tile_info)
|
||||
{
|
||||
int attr = ram[tile_index];
|
||||
SET_TILE_INFO_MEMBER(gfxnum,
|
||||
int attr = m_ram[0x6000 + tile_index]; //c000
|
||||
SET_TILE_INFO_MEMBER(0,
|
||||
attr & 0xff,
|
||||
((attr & 0x3f00) >> 8),
|
||||
TILE_FLIPYX((attr & 0xc000) >> 14));
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(tc0480scp_device::get_bg0_tile_info)
|
||||
{
|
||||
common_get_tc0480bg_tile_info(tileinfo, tile_index, m_bg_ram[0], m_gfxnum );
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(tc0480scp_device::get_bg1_tile_info)
|
||||
{
|
||||
common_get_tc0480bg_tile_info(tileinfo, tile_index, m_bg_ram[1], m_gfxnum);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(tc0480scp_device::get_bg2_tile_info)
|
||||
{
|
||||
common_get_tc0480bg_tile_info(tileinfo, tile_index, m_bg_ram[2], m_gfxnum);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(tc0480scp_device::get_bg3_tile_info)
|
||||
{
|
||||
common_get_tc0480bg_tile_info(tileinfo, tile_index, m_bg_ram[3], m_gfxnum);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(tc0480scp_device::get_tx_tile_info)
|
||||
{
|
||||
common_get_tc0480tx_tile_info(tileinfo, tile_index, m_tx_ram, m_txnum);
|
||||
}
|
||||
|
||||
void tc0480scp_device::dirty_tilemaps()
|
||||
{
|
||||
m_tilemap[0][m_dblwidth]->mark_all_dirty();
|
||||
m_tilemap[1][m_dblwidth]->mark_all_dirty();
|
||||
m_tilemap[2][m_dblwidth]->mark_all_dirty();
|
||||
m_tilemap[3][m_dblwidth]->mark_all_dirty();
|
||||
m_tilemap[4][m_dblwidth]->mark_all_dirty();
|
||||
}
|
||||
|
||||
|
||||
void tc0480scp_device::set_layer_ptrs()
|
||||
{
|
||||
if (!m_dblwidth)
|
||||
{
|
||||
m_bg_ram[0] = &m_ram[0x0000]; //0000
|
||||
m_bg_ram[1] = &m_ram[0x0800]; //1000
|
||||
m_bg_ram[2] = &m_ram[0x1000]; //2000
|
||||
m_bg_ram[3] = &m_ram[0x1800]; //3000
|
||||
m_bgscroll_ram[0] = &m_ram[0x2000]; //4000
|
||||
m_bgscroll_ram[1] = &m_ram[0x2200]; //4400
|
||||
m_bgscroll_ram[2] = &m_ram[0x2400]; //4800
|
||||
@ -376,15 +335,9 @@ void tc0480scp_device::set_layer_ptrs()
|
||||
m_rowzoom_ram[3] = &m_ram[0x3200]; //6400
|
||||
m_bgcolumn_ram[2] = &m_ram[0x3400]; //6800
|
||||
m_bgcolumn_ram[3] = &m_ram[0x3600]; //6c00
|
||||
m_tx_ram = &m_ram[0x6000]; //c000
|
||||
m_char_ram = &m_ram[0x7000]; //e000
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bg_ram[0] = &m_ram[0x0000]; //0000
|
||||
m_bg_ram[1] = &m_ram[0x1000]; //2000
|
||||
m_bg_ram[2] = &m_ram[0x2000]; //4000
|
||||
m_bg_ram[3] = &m_ram[0x3000]; //6000
|
||||
m_bgscroll_ram[0] = &m_ram[0x4000]; //8000
|
||||
m_bgscroll_ram[1] = &m_ram[0x4200]; //8400
|
||||
m_bgscroll_ram[2] = &m_ram[0x4400]; //8800
|
||||
@ -393,8 +346,6 @@ void tc0480scp_device::set_layer_ptrs()
|
||||
m_rowzoom_ram[3] = &m_ram[0x5200]; //a400
|
||||
m_bgcolumn_ram[2] = &m_ram[0x5400]; //a800
|
||||
m_bgcolumn_ram[3] = &m_ram[0x5600]; //ac00
|
||||
m_tx_ram = &m_ram[0x6000]; //c000
|
||||
m_char_ram = &m_ram[0x7000]; //e000
|
||||
}
|
||||
}
|
||||
|
||||
@ -407,41 +358,26 @@ void tc0480scp_device::ram_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
COMBINE_DATA(&m_ram[offset]);
|
||||
|
||||
if (!m_dblwidth)
|
||||
if (offset < 0x2000)
|
||||
{
|
||||
if (offset < 0x2000)
|
||||
{
|
||||
m_tilemap[(offset / 0x800)][m_dblwidth]->mark_tile_dirty(((offset % 0x800) / 2));
|
||||
}
|
||||
else if (offset < 0x6000)
|
||||
{ /* do nothing */
|
||||
}
|
||||
else if (offset < 0x7000)
|
||||
{
|
||||
m_tilemap[4][m_dblwidth]->mark_tile_dirty((offset - 0x6000));
|
||||
}
|
||||
else if (offset <= 0x7fff)
|
||||
{
|
||||
m_gfxdecode->gfx(m_txnum)->mark_dirty((offset - 0x7000) / 16);
|
||||
}
|
||||
m_tilemap[(offset / 0x800)][0]->mark_tile_dirty(((offset % 0x800) / 2));
|
||||
m_tilemap[(offset / 0x1000)][1]->mark_tile_dirty(((offset % 0x1000) / 2));
|
||||
}
|
||||
else
|
||||
else if (offset < 0x4000)
|
||||
{
|
||||
if (offset < 0x4000)
|
||||
{
|
||||
m_tilemap[(offset / 0x1000)][m_dblwidth]->mark_tile_dirty(((offset % 0x1000) / 2));
|
||||
}
|
||||
else if (offset < 0x6000)
|
||||
{ /* do nothing */
|
||||
}
|
||||
else if (offset < 0x7000)
|
||||
{
|
||||
m_tilemap[4][m_dblwidth]->mark_tile_dirty((offset - 0x6000));
|
||||
}
|
||||
else if (offset <= 0x7fff)
|
||||
{
|
||||
m_gfxdecode->gfx(m_txnum)->mark_dirty((offset - 0x7000) / 16);
|
||||
}
|
||||
m_tilemap[(offset / 0x1000)][1]->mark_tile_dirty(((offset % 0x1000) / 2));
|
||||
}
|
||||
else if (offset < 0x6000)
|
||||
{ /* do nothing */
|
||||
}
|
||||
else if (offset < 0x7000)
|
||||
{
|
||||
m_tilemap[4][0]->mark_tile_dirty((offset - 0x6000));
|
||||
m_tilemap[4][1]->mark_tile_dirty((offset - 0x6000));
|
||||
}
|
||||
else if (offset <= 0x7fff)
|
||||
{
|
||||
gfx(0)->mark_dirty((offset - 0x7000) / 16);
|
||||
}
|
||||
}
|
||||
|
||||
@ -555,9 +491,6 @@ void tc0480scp_device::ctrl_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
/* Reinitialise layer pointers */
|
||||
set_layer_ptrs();
|
||||
|
||||
/* and ensure full redraw of tilemaps */
|
||||
dirty_tilemaps();
|
||||
}
|
||||
|
||||
break;
|
||||
@ -630,7 +563,7 @@ Historical Issues
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
void tc0480scp_device::bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority )
|
||||
void tc0480scp_device::bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u32 priority )
|
||||
{
|
||||
/* X-axis zoom offers expansion only: 0 = no zoom, 0xff = max
|
||||
Y-axis zoom offers expansion/compression: 0x7f = no zoom, 0xff = max
|
||||
@ -647,9 +580,9 @@ void tc0480scp_device::bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, c
|
||||
else /* zoom */
|
||||
{
|
||||
u16 *dst16, *src16;
|
||||
uint8_t *tsrc;
|
||||
u8 *tsrc;
|
||||
u16 scanline[512];
|
||||
uint32_t sx;
|
||||
u32 sx;
|
||||
bitmap_ind16 &srcbitmap = m_tilemap[layer][m_dblwidth]->pixmap();
|
||||
bitmap_ind8 &flagsbitmap = m_tilemap[layer][m_dblwidth]->flagsmap();
|
||||
int flip = m_pri_reg & 0x40;
|
||||
@ -762,16 +695,16 @@ flipscreen.
|
||||
|
||||
****************************************************************/
|
||||
|
||||
void tc0480scp_device::bg23_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority )
|
||||
void tc0480scp_device::bg23_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u32 priority )
|
||||
{
|
||||
bitmap_ind16 &srcbitmap = m_tilemap[layer][m_dblwidth]->pixmap();
|
||||
bitmap_ind8 &flagsbitmap = m_tilemap[layer][m_dblwidth]->flagsmap();
|
||||
|
||||
u16 *dst16, *src16;
|
||||
uint8_t *tsrc;
|
||||
u8 *tsrc;
|
||||
int y_index, src_y_index, row_index, row_zoom;
|
||||
int sx, x_index, x_step;
|
||||
uint32_t zoomx, zoomy;
|
||||
u32 zoomx, zoomy;
|
||||
u16 scanline[512];
|
||||
int flipscreen = m_pri_reg & 0x40;
|
||||
|
||||
@ -871,7 +804,7 @@ void tc0480scp_device::bg23_draw(screen_device &screen, bitmap_ind16 &bitmap, co
|
||||
}
|
||||
|
||||
|
||||
void tc0480scp_device::tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority )
|
||||
void tc0480scp_device::tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u32 priority )
|
||||
{
|
||||
/* no layer disable bits */
|
||||
switch (layer)
|
||||
|
@ -5,15 +5,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
class tc0480scp_device : public device_t
|
||||
class tc0480scp_device : public device_t, public device_gfx_interface
|
||||
{
|
||||
public:
|
||||
tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
// configuration
|
||||
template <typename T> void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward<T>(tag)); }
|
||||
void set_gfx_region(int gfxregion) { m_gfxnum = gfxregion; }
|
||||
void set_tx_region(int txregion) { m_txnum = txregion; }
|
||||
void set_col_base(int col) { m_col_base = col; }
|
||||
void set_offsets(int x_offset, int y_offset)
|
||||
{
|
||||
@ -41,7 +40,7 @@ public:
|
||||
void ctrl_w(offs_t offset, u16 data, u16 mem_mask);
|
||||
|
||||
void tilemap_update();
|
||||
void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority);
|
||||
void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u32 priority);
|
||||
|
||||
/* Returns the priority order of the bg tilemaps set in the internal
|
||||
register. The order in which the four layers should be drawn is
|
||||
@ -62,9 +61,6 @@ private:
|
||||
u16 m_ctrl[0x18];
|
||||
|
||||
std::vector<u16> m_ram;
|
||||
u16 * m_bg_ram[4];
|
||||
u16 * m_tx_ram;
|
||||
u16 * m_char_ram;
|
||||
u16 * m_bgscroll_ram[4];
|
||||
u16 * m_rowzoom_ram[4];
|
||||
u16 * m_bgcolumn_ram[4];
|
||||
@ -74,10 +70,9 @@ private:
|
||||
|
||||
/* We keep two tilemaps for each of the 5 actual tilemaps: one at standard width, one double */
|
||||
tilemap_t *m_tilemap[5][2];
|
||||
int32_t m_dblwidth;
|
||||
s32 m_dblwidth;
|
||||
|
||||
int m_gfxnum;
|
||||
int m_txnum;
|
||||
int m_x_offset, m_y_offset;
|
||||
int m_text_xoffs, m_text_yoffs;
|
||||
int m_flip_xoffs, m_flip_yoffs;
|
||||
@ -86,19 +81,12 @@ private:
|
||||
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
|
||||
void common_get_tc0480bg_tile_info( tile_data &tileinfo, int tile_index, u16 *ram, int gfxnum );
|
||||
void common_get_tc0480tx_tile_info( tile_data &tileinfo, int tile_index, u16 *ram, int gfxnum );
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_bg0_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_bg1_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_bg2_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_bg3_tile_info);
|
||||
template<unsigned Offset> TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_tx_tile_info);
|
||||
|
||||
void dirty_tilemaps();
|
||||
void set_layer_ptrs();
|
||||
void bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority );
|
||||
void bg23_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority );
|
||||
void bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u32 priority );
|
||||
void bg23_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u32 priority );
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(TC0480SCP, tc0480scp_device)
|
||||
|
Loading…
Reference in New Issue
Block a user