namco_c355spr.cpp: treat 'dy' as signed, seems a more logical solution to finalapr 'missing objects' and also fixes the flags on course select screen (#8314)

This commit is contained in:
David Haywood 2021-07-18 22:23:07 +01:00 committed by GitHub
parent 4ab4f74106
commit 55cf2f100f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 10 deletions

View File

@ -799,7 +799,9 @@ void namcofl_state::driver_init()
}
GAME( 1995, speedrcr, 0, namcofl, speedrcr, namcofl_state, driver_init, ROT0, "Namco", "Speed Racer", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE )
GAMEL( 1995, finalapr, 0, namcofl, finalapr, namcofl_state, driver_init, ROT0, "Namco", "Final Lap R (Rev. B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE, layout_finalapr )
GAMEL( 1995, finalapr1, finalapr, namcofl, finalapr, namcofl_state, driver_init, ROT0, "Namco", "Final Lap R", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE, layout_finalapr )
GAMEL( 1995, finalaprj, finalapr, namcofl, finalapr, namcofl_state, driver_init, ROT0, "Namco", "Final Lap R (Japan Rev. C)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE, layout_finalapr )
GAMEL( 1995, finalaprj1, finalapr, namcofl, finalapr, namcofl_state, driver_init, ROT0, "Namco", "Final Lap R (Japan Rev. B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE, layout_finalapr )
// Final Lap R was released 02/94, a 1993 copyright date is displayed on the title screen
GAMEL( 1994, finalapr, 0, namcofl, finalapr, namcofl_state, driver_init, ROT0, "Namco", "Final Lap R (Rev. B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE, layout_finalapr )
GAMEL( 1994, finalapr1, finalapr, namcofl, finalapr, namcofl_state, driver_init, ROT0, "Namco", "Final Lap R", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE, layout_finalapr )
GAMEL( 1994, finalaprj, finalapr, namcofl, finalapr, namcofl_state, driver_init, ROT0, "Namco", "Final Lap R (Japan Rev. C)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE, layout_finalapr )
GAMEL( 1994, finalaprj1, finalapr, namcofl, finalapr, namcofl_state, driver_init, ROT0, "Namco", "Final Lap R (Japan Rev. B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE, layout_finalapr )

View File

@ -398,13 +398,13 @@ void namco_c355spr_device::get_single_sprite(const u16 *pSource, c355_sprite *sp
int tile_index = spriteformat16[linkno * 4 + 0];
const u16 format = spriteformat16[linkno * 4 + 1];
int dx = spriteformat16[linkno * 4 + 2];
int dy = spriteformat16[linkno * 4 + 3];
int dx = spriteformat16[linkno * 4 + 2]; // should this also be masked and have a sign bit like dy?
const int dy = spriteformat16[linkno * 4 + 3] & 0x1ff;
int num_cols = (format >> 4) & 0xf;
int num_rows = (format) & 0xf;
if (num_cols == 0) num_cols = 0x10;
bool flipx = (hsize & 0x8000);
const bool flipx = (hsize & 0x8000);
hsize &= 0x3ff;//0x1ff;
if (hsize == 0)
{
@ -423,7 +423,7 @@ void namco_c355spr_device::get_single_sprite(const u16 *pSource, c355_sprite *sp
}
if (num_rows == 0) num_rows = 0x10;
bool flipy = (vsize & 0x8000);
const bool flipy = (vsize & 0x8000);
vsize &= 0x3ff;
if (vsize == 0)
{
@ -431,11 +431,16 @@ void namco_c355spr_device::get_single_sprite(const u16 *pSource, c355_sprite *sp
return;
}
u32 zoomy = (vsize << 16) / (num_rows * 16);
dy = (dy * zoomy + 0x8000) >> 16;
s32 dy_zoomed = ((dy & 0xff) * zoomy + 0x8000) >> 16;
if (dy & 0x100) dy_zoomed = -dy_zoomed;
if (!flipy)
{
vpos -= dy;
vpos -= dy_zoomed;
}
else
{
vpos += dy_zoomed;
}
sprite_ptr->flipx = flipx;
@ -520,6 +525,7 @@ void namco_c355spr_device::get_sprites(const rectangle cliprect)
// if (offs == 0) // boot
// TODO: solvalou service mode wants 0x14000/2 & 0x00000/2
// drawing this is what causes the bad tile in vshoot, do any games need 2 lists at the same time or should 1 list be configurable?
get_list(0, &m_spriteram[buffer][0x02000/2], &m_spriteram[buffer][0x00000/2]);
// else
get_list(1, &m_spriteram[buffer][0x14000/2], &m_spriteram[buffer][0x10000/2]);