cps1: fix small issue with stars palette cycling [Loïc Petit]

This commit is contained in:
hap 2021-11-06 15:35:24 +01:00
parent b0ac175b49
commit f03bb5dc98

View file

@ -3164,7 +3164,7 @@ void cps_state::cps1_render_stars( screen_device &screen, bitmap_ind16 &bitmap,
for (int offs = 0; offs < m_stars_rom_size / 2; offs++)
{
int col = stars_rom[8 * offs + 4];
if (col != 0x0f)
if ((col & 0x1f) != 0x0f)
{
int sx = (offs / 256) * 32;
int sy = (offs % 256);
@ -3176,7 +3176,8 @@ void cps_state::cps1_render_stars( screen_device &screen, bitmap_ind16 &bitmap,
sy = 256 - sy;
}
col = ((col & 0xe0) >> 1) + (screen.frame_number() / 16 & 0x0f);
int cnt = ((screen.frame_number() / 16 ) % ((col & 0x80) ? 15 : 16));
col = ((col & 0xe0) >> 1) + cnt;
if (cliprect.contains(sx, sy))
bitmap.pix(sy, sx) = 0xa00 + col;
@ -3189,7 +3190,7 @@ void cps_state::cps1_render_stars( screen_device &screen, bitmap_ind16 &bitmap,
for (int offs = 0; offs < m_stars_rom_size / 2; offs++)
{
int col = stars_rom[8*offs];
if (col != 0x0f)
if ((col & 0x1f) != 0x0f)
{
int sx = (offs / 256) * 32;
int sy = (offs % 256);
@ -3201,7 +3202,8 @@ void cps_state::cps1_render_stars( screen_device &screen, bitmap_ind16 &bitmap,
sy = 256 - sy;
}
col = ((col & 0xe0) >> 1) + (screen.frame_number() / 16 & 0x0f);
int cnt = ((screen.frame_number() / 16 ) % ((col & 0x80) ? 15 : 16));
col = ((col & 0xe0) >> 1) + cnt;
if (cliprect.contains(sx, sy))
bitmap.pix(sy, sx) = 0x800 + col;