Merge pull request #5203 from cam900/taito_f3_gfxlayout

taito_f3.cpp, 2mindril.cpp : Updates
This commit is contained in:
R. Belmont 2019-06-10 09:44:56 -04:00 committed by GitHub
commit fa4773ed3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 127 additions and 79 deletions

View File

@ -285,11 +285,35 @@ static const gfx_layout pivotlayout =
32*8
};
static const gfx_layout layout_6bpp_sprite_hi =
{
16,16,
RGN_FRAC(1,1),
6,
{ STEP2(0,1)/**/,0,0,0,0/**/ },
{ STEP4(3*2,-2), STEP4(7*2,-2), STEP4(11*2,-2), STEP4(15*2,-2) },
{ STEP16(0,16*2) },
16*16*2
};
static const gfx_layout layout_6bpp_tile_hi =
{
16,16,
RGN_FRAC(1,1),
6,
{ 8,0/**/,0,0,0,0/**/ },
{ STEP8(7,-1), STEP8(8*2+7,-1) },
{ STEP16(0,8*2*2) },
16*16*2
};
static GFXDECODE_START( gfx_2mindril )
GFXDECODE_ENTRY( nullptr, 0x000000, charlayout, 0x0000, 0x0400>>4 ) /* Dynamically modified */
GFXDECODE_ENTRY( "tilemap", 0x000000, gfx_16x16x4_packed_lsb, 0x0000, 0x2000>>4 ) /* Tiles area */
GFXDECODE_ENTRY( "sprites", 0x000000, gfx_16x16x4_packed_lsb, 0x1000, 0x1000>>4 ) /* Sprites area */
GFXDECODE_ENTRY( nullptr, 0x000000, pivotlayout, 0x0000, 0x400>>4 ) /* Dynamically modified */
GFXDECODE_ENTRY( nullptr, 0, charlayout, 0x0000, 0x0400>>4 ) /* Dynamically modified */
GFXDECODE_ENTRY( nullptr, 0, pivotlayout, 0x0000, 0x400>>4 ) /* Dynamically modified */
GFXDECODE_ENTRY( "sprites", 0, gfx_16x16x4_packed_lsb, 0x1000, 0x1000>>4 ) // low 4bpp of 6bpp sprite data
GFXDECODE_ENTRY( "tilemap", 0, gfx_16x16x4_packed_lsb, 0x0000, 0x2000>>4 ) // low 4bpp of 6bpp tilemap data
GFXDECODE_ENTRY( "tilemap_hi", 0, layout_6bpp_tile_hi, 0x0000, 0x2000>>4 ) // hi 2bpp of 6bpp tilemap data
GFXDECODE_ENTRY( "sprites_hi", 0, layout_6bpp_sprite_hi, 0x1000, 0x1000>>4 ) // hi 2bpp of 6bpp sprite data
GFXDECODE_END

View File

@ -392,11 +392,35 @@ static const gfx_layout pivotlayout =
32*8
};
static const gfx_layout layout_6bpp_sprite_hi =
{
16,16,
RGN_FRAC(1,1),
6,
{ STEP2(0,1)/**/,0,0,0,0/**/ },
{ STEP4(3*2,-2), STEP4(7*2,-2), STEP4(11*2,-2), STEP4(15*2,-2) },
{ STEP16(0,16*2) },
16*16*2
};
static const gfx_layout layout_6bpp_tile_hi =
{
16,16,
RGN_FRAC(1,1),
6,
{ 8,0/**/,0,0,0,0/**/ },
{ STEP8(7,-1), STEP8(8*2+7,-1) },
{ STEP16(0,8*2*2) },
16*16*2
};
static GFXDECODE_START( gfx_taito_f3 )
GFXDECODE_ENTRY( nullptr, 0x000000, charlayout, 0x0000, 0x0400>>4 ) /* Dynamically modified */
GFXDECODE_ENTRY( "tilemap", 0x000000, gfx_16x16x4_packed_lsb, 0x0000, 0x2000>>4 ) /* Tiles area */
GFXDECODE_ENTRY( "sprites", 0x000000, gfx_16x16x4_packed_lsb, 0x1000, 0x1000>>4 ) /* Sprites area */
GFXDECODE_ENTRY( nullptr, 0x000000, pivotlayout, 0x0000, 0x400>>4 ) /* Dynamically modified */
GFXDECODE_ENTRY( nullptr, 0, charlayout, 0x0000, 0x0400>>4 ) /* Dynamically modified */
GFXDECODE_ENTRY( nullptr, 0, pivotlayout, 0x0000, 0x400>>4 ) /* Dynamically modified */
GFXDECODE_ENTRY( "sprites", 0, gfx_16x16x4_packed_lsb, 0x1000, 0x1000>>4 ) // low 4bpp of 6bpp sprite data
GFXDECODE_ENTRY( "tilemap", 0, gfx_16x16x4_packed_lsb, 0x0000, 0x2000>>4 ) // low 4bpp of 6bpp tilemap data
GFXDECODE_ENTRY( "tilemap_hi", 0, layout_6bpp_tile_hi, 0x0000, 0x2000>>4 ) // hi 2bpp of 6bpp tilemap data
GFXDECODE_ENTRY( "sprites_hi", 0, layout_6bpp_sprite_hi, 0x1000, 0x1000>>4 ) // hi 2bpp of 6bpp sprite data
GFXDECODE_END
/******************************************************************************/
@ -518,12 +542,25 @@ static const gfx_layout bubsympb_sprite_layout =
16*16
};
static const gfx_layout bubsympb_layout_5bpp_tile_hi =
{
16,16,
RGN_FRAC(1,1),
5,
{ 0/**/,0,0,0,0/**/ },
{ STEP8(7,-1), STEP8(15,-1) },
{ STEP16(0,16) },
16*16
};
static GFXDECODE_START( gfx_bubsympb )
GFXDECODE_ENTRY( nullptr, 0x000000, charlayout, 0, 64 ) /* Dynamically modified */
GFXDECODE_ENTRY( "tilemap", 0x000000, gfx_16x16x4_packed_lsb, 0, 512 ) /* Tiles area */
GFXDECODE_ENTRY( "sprites", 0x000000, bubsympb_sprite_layout, 4096, 256 ) /* Sprites area */
GFXDECODE_ENTRY( nullptr, 0x000000, pivotlayout, 0, 64 ) /* Dynamically modified */
GFXDECODE_ENTRY( nullptr, 0, charlayout, 0, 64 ) /* Dynamically modified */
GFXDECODE_ENTRY( nullptr, 0, pivotlayout, 0, 64 ) /* Dynamically modified */
GFXDECODE_ENTRY( "sprites", 0, bubsympb_sprite_layout, 4096, 256 ) /* Sprites area (6bpp planar) */
GFXDECODE_ENTRY( "tilemap", 0, gfx_16x16x4_packed_lsb, 0, 512 ) // low 4bpp of 5bpp tilemap data
GFXDECODE_ENTRY( "tilemap_hi", 0, bubsympb_layout_5bpp_tile_hi, 0, 512 ) // hi 1bpp of 5bpp tilemap data
GFXDECODE_ENTRY( "sprites", 0, bubsympb_sprite_layout, 4096, 256 ) // dummy gfx duplicate for avoid crash
GFXDECODE_END
void taito_f3_state::bubsympb(machine_config &config)
@ -2343,8 +2380,8 @@ ROM_START( bubsymphb )
ROM_LOAD32_BYTE("bsb_d13b.bin", 0x000002, 0x080000, CRC(430af2aa) SHA1(e935f9f4e0558a25bd4010b44dbb4f38a9d359e0) )
ROM_LOAD32_BYTE("bsb_d12b.bin", 0x000003, 0x080000, CRC(cb2e2abb) SHA1(7e3a90cb8af298bac2aef80778341833e473b671) )
ROM_REGION( 0x100000, "tilemap_hi", 0 )
ROM_LOAD16_BYTE("bsb_d11b.bin", 0x000000, 0x080000, CRC(d0607829) SHA1(546c629ec22bb98202c7127ccb77df0b8f3a1966) )
ROM_REGION( 0x080000, "tilemap_hi", 0 )
ROM_LOAD ("bsb_d11b.bin", 0x000000, 0x080000, CRC(d0607829) SHA1(546c629ec22bb98202c7127ccb77df0b8f3a1966) )
ROM_REGION( 0x100000, "oki" , ROMREGION_ERASE00 ) // OKI6295 samples
ROM_LOAD("bsb_d11.bin", 0x000000, 0x080000, CRC(26bdc617) SHA1(993e7a52128fdd58f22d95521a629beb71ca7b91) ) // I haven't verified this dump.. but given how bad the rest is I'm not confident
@ -4167,49 +4204,11 @@ void taito_f3_state::tile_decode()
*/
u8 *srcdata, *dest;
if (m_tilemaprom_hi)
{
u8 *tmap_hi = m_tilemaprom_hi;
gfx_element *pf_gfx = m_gfxdecode->gfx(1);
// allocate memory for the assembled data
srcdata = auto_alloc_array(machine(), u8, pf_gfx->elements() * pf_gfx->width() * pf_gfx->height());
// loop over elements
dest = srcdata;
for (int c = 0; c < pf_gfx->elements(); c++)
{
const u8 *c0base = pf_gfx->get_data(c);
// loop over height
for (int y = 0; y < pf_gfx->height(); y++)
{
const u8 *c0 = c0base;
for (int x = 0; x < pf_gfx->width();)
{
u8 msb = *tmap_hi++;
u8 lsb = *tmap_hi++;
for (int i = 0; i < 8; i++)
{
*dest++ = (*c0++ & 0xf) | ((msb << 4) & 0x10) | ((lsb << 5) & 0x20);
x++;
msb >>= 1;
lsb >>= 1;
}
}
c0base += pf_gfx->rowbytes();
}
}
pf_gfx->set_raw_layout(srcdata, pf_gfx->width(), pf_gfx->height(), pf_gfx->elements(), 8 * pf_gfx->width(), 8 * pf_gfx->width() * pf_gfx->height());
}
// all but bubsymphb (bootleg board with different sprite gfx layout), 2mindril (no sprite gfx roms)
if (m_spriterom_hi)
if (m_gfxdecode->gfx(5) != nullptr)
{
u8 *spr_hi = m_spriterom_hi;
gfx_element *spr_gfx = m_gfxdecode->gfx(2);
gfx_element *spr_gfx_hi = m_gfxdecode->gfx(5);
// allocate memory for the assembled data
srcdata = auto_alloc_array(machine(), u8, spr_gfx->elements() * spr_gfx->width() * spr_gfx->height());
@ -4219,28 +4218,58 @@ void taito_f3_state::tile_decode()
for (int c = 0; c < spr_gfx->elements(); c++)
{
const u8 *c1base = spr_gfx->get_data(c);
const u8 *c3base = spr_gfx_hi->get_data(c);
// loop over height
for (int y = 0; y < spr_gfx->height(); y++)
{
const u8 *c1 = c1base;
const u8 *c3 = c3base;
/* Expand 2bits into 4bits format */
for (int x = 0; x < spr_gfx->width(); x++)
*dest++ = (*c1++ & 0xf) | (*c3++ & 0x30);
for (int x = 0; x < spr_gfx->width();)
{
/* Expand 2bits into 4bits format */
u8 hipix = *spr_hi++;
for (int i = 0; i < 4; i++)
{
*dest++ = (*c1++ & 0xf) | ((hipix << 4) & 0x30);
x++;
hipix >>= 2;
}
}
c1base += spr_gfx->rowbytes();
c3base += spr_gfx_hi->rowbytes();
}
}
spr_gfx->set_raw_layout(srcdata, spr_gfx->width(), spr_gfx->height(), spr_gfx->elements(), 8 * spr_gfx->width(), 8 * spr_gfx->width() * spr_gfx->height());
m_gfxdecode->set_gfx(5, nullptr);
}
if (m_gfxdecode->gfx(4) != nullptr)
{
gfx_element *pf_gfx = m_gfxdecode->gfx(3);
gfx_element *pf_gfx_hi = m_gfxdecode->gfx(4);
// allocate memory for the assembled data
srcdata = auto_alloc_array(machine(), u8, pf_gfx->elements() * pf_gfx->width() * pf_gfx->height());
// loop over elements
dest = srcdata;
for (int c = 0; c < pf_gfx->elements(); c++)
{
const u8 *c0base = pf_gfx->get_data(c);
const u8 *c2base = pf_gfx_hi->get_data(c);
// loop over height
for (int y = 0; y < pf_gfx->height(); y++)
{
const u8 *c0 = c0base;
const u8 *c2 = c2base;
for (int x = 0; x < pf_gfx->width(); x++)
*dest++ = (*c0++ & 0xf) | (*c2++ & 0x30);
c0base += pf_gfx->rowbytes();
c2base += pf_gfx_hi->rowbytes();
}
}
pf_gfx->set_raw_layout(srcdata, pf_gfx->width(), pf_gfx->height(), pf_gfx->elements(), 8 * pf_gfx->width(), 8 * pf_gfx->width() * pf_gfx->height());
m_gfxdecode->set_gfx(4, nullptr);
}
}

View File

@ -65,8 +65,6 @@ public:
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_eeprom(*this, "eeprom"),
m_spriterom_hi(*this, "sprites_hi"),
m_tilemaprom_hi(*this, "tilemap_hi"),
m_textram(*this, "textram", 0),
m_spriteram(*this, "spriteram", 0),
m_charram(*this, "charram", 0),
@ -155,9 +153,6 @@ protected:
required_device<palette_device> m_palette;
optional_device<eeprom_serial_base_device> m_eeprom;
optional_region_ptr<u8> m_spriterom_hi; // all but 2mindril, bubsymphb
optional_region_ptr<u8> m_tilemaprom_hi;
required_shared_ptr<u16> m_textram;
required_shared_ptr<u16> m_spriteram;
required_shared_ptr<u16> m_charram;

View File

@ -294,7 +294,7 @@ void taito_f3_state::device_post_load()
{
/* force a reread of the dynamic tiles in the pixel layer */
m_gfxdecode->gfx(0)->mark_all_dirty();
m_gfxdecode->gfx(3)->mark_all_dirty();
m_gfxdecode->gfx(1)->mark_all_dirty();
}
/******************************************************************************/
@ -384,7 +384,7 @@ TILE_GET_INFO_MEMBER(taito_f3_state::get_tile_info)
// This fixes (at least) the rain in round 6 of Arabian Magic.
const u8 extra_planes = ((tile >> (16 + 10)) & 3); // 0 = 4bpp, 1 = 5bpp, 2 = unused?, 3 = 6bpp
SET_TILE_INFO_MEMBER(1,
SET_TILE_INFO_MEMBER(3,
tile & 0xffff,
(tile >> 16) & 0x1ff & (~extra_planes),
TILE_FLIPYX(tile >> 30));
@ -426,7 +426,7 @@ TILE_GET_INFO_MEMBER(taito_f3_state::get_tile_info_pixel)
if (vram_tile & 0x0100) flags |= TILE_FLIPX;
if (vram_tile & 0x8000) flags |= TILE_FLIPY;
SET_TILE_INFO_MEMBER(3,
SET_TILE_INFO_MEMBER(1,
tile_index,
(vram_tile >> 9) & 0x3f,
flags);
@ -561,15 +561,15 @@ void taito_f3_state::video_start()
m_screen->register_screen_bitmap(m_pri_alp_bitmap);
m_tile_opaque_sp = std::make_unique<u8[]>(m_gfxdecode->gfx(2)->elements());
for (int i = 0; i < 8; i++)
m_tile_opaque_pf[i] = std::make_unique<u8[]>(m_gfxdecode->gfx(1)->elements());
m_tile_opaque_pf[i] = std::make_unique<u8[]>(m_gfxdecode->gfx(3)->elements());
m_vram_layer->set_transparent_pen(0);
m_pixel_layer->set_transparent_pen(0);
/* Palettes have 4 bpp indexes despite up to 6 bpp data. The unused */
/* top bits in the gfx data are cleared later. */
m_gfxdecode->gfx(1)->set_granularity(16);
m_gfxdecode->gfx(2)->set_granularity(16);
m_gfxdecode->gfx(3)->set_granularity(16);
m_flipscreen = 0;
memset(m_spriteram16_buffered.get(), 0, 0x10000);
@ -579,7 +579,7 @@ void taito_f3_state::video_start()
save_item(NAME(m_control_1));
m_gfxdecode->gfx(0)->set_source((u8 *)m_charram.target());
m_gfxdecode->gfx(3)->set_source((u8 *)m_pivot_ram.target());
m_gfxdecode->gfx(1)->set_source((u8 *)m_pivot_ram.target());
m_sprite_lag = m_game_config->sprite_lag;
@ -607,7 +607,7 @@ void taito_f3_state::video_start()
}
{
gfx_element *pf_gfx = m_gfxdecode->gfx(1);
gfx_element *pf_gfx = m_gfxdecode->gfx(3);
for (int c = 0; c < pf_gfx->elements(); c++)
{
@ -719,7 +719,7 @@ u16 taito_f3_state::pivot_r(offs_t offset)
void taito_f3_state::pivot_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_pivot_ram[offset]);
m_gfxdecode->gfx(3)->mark_dirty(offset >> 4);
m_gfxdecode->gfx(1)->mark_dirty(offset >> 4);
}
u16 taito_f3_state::lineram_r(offs_t offset)
@ -1459,7 +1459,7 @@ void taito_f3_state::visible_tile_check(
int alpha_mode = line_t->alpha_mode[line];
if (!alpha_mode) return;
const u32 total_elements = m_gfxdecode->gfx(1)->elements();
const u32 total_elements = m_gfxdecode->gfx(3)->elements();
int tile_index = x_index_fx >> 16;
const int tile_num = (((line_t->x_zoom[line] * 320 + (x_index_fx & 0xffff) + 0xffff) >> 16) + (tile_index & 0xf) + 15) >> 4;