Merge pull request #3254 from DavidHaywood/200218

xavix - rad_box rendering improvements
This commit is contained in:
R. Belmont 2018-02-20 20:50:30 -05:00 committed by GitHub
commit 4ef19c5a42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -355,6 +355,7 @@ void xavix_state::handle_palette(screen_device &screen, bitmap_ind16 &bitmap, co
void xavix_state::draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which)
{
int alt_tileaddressing = 0;
int alt_tileaddressing2 = 0;
int ydimension = 0;
int xdimension = 0;
@ -417,6 +418,9 @@ void xavix_state::draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, cons
else
alt_tileaddressing = 0;
if (tileregs[0x7] & 0x02)
alt_tileaddressing2 = 1;
if (tileregs[0x7] & 0x80)
{
// there's a tilemap register to specify base in main ram, although in the monster truck test mode it points to an unmapped region
@ -459,6 +463,8 @@ void xavix_state::draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, cons
int test = 0;
if (!alt_tileaddressing)
{
if (!alt_tileaddressing2)
{
basereg = 0;
gfxbase = (m_spr_attra[(basereg * 2) + 1] << 16) | (m_spr_attra[(basereg * 2)] << 8);
@ -467,6 +473,16 @@ void xavix_state::draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, cons
tile += gfxbase;
}
else
{
// fixed multiplier? or just different? only seen this in 16x8 tile mode at the moment.
tile = tile * 8;
basereg = (tile & 0xf0000) >> 16;
tile &= 0xffff;
gfxbase = (m_spr_attra[(basereg * 2) + 1] << 16) | (m_spr_attra[(basereg * 2)] << 8);
tile+= gfxbase;
}
}
else
{
if (debug_packets) printf("for tile %04x (at %d %d): ", tile, (((x * 16) + scrollx) & 0xff), (((y * 16) + scrolly) & 0xff));
@ -638,8 +654,15 @@ void xavix_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, cons
tile = tile * 8;
}
if (m_alt_addressing)
if (m_alt_addressing==1)
tile += m_alt_addressing_base;
else if (m_alt_addressing == 2)
{
int basereg = (tile & 0xf0000) >> 16;
tile &= 0xffff;
int gfxbase = (m_spr_attra[(basereg * 2) + 1] << 16) | (m_spr_attra[(basereg * 2)] << 8);
tile+= gfxbase;
}
ypos = 0xff - ypos;
@ -1737,14 +1760,12 @@ DRIVER_INIT_MEMBER(xavix_state, rad_box)
{
DRIVER_INIT_CALL(xavix);
m_alt_addressing = 2;
m_alt_addressing_base = 0x20000;
}
DRIVER_INIT_MEMBER(xavix_state, rad_crdn)
{
DRIVER_INIT_CALL(xavix);
m_alt_addressing = 2;
m_alt_addressing_base = 0x00000;
}
/***************************************************************************