ssv: fixed "disable background" register; fixed x tilemap's offset

This commit is contained in:
Roberto Zandona 2010-09-14 20:19:04 +00:00
parent e22fd1b2c7
commit 99c5d52312

View File

@ -619,10 +619,10 @@ static void draw_row(running_machine *machine, bitmap_t *bitmap, const rectangle
int y, y1, sy1, flipy, ynum, ystart, yend, yinc; int y, y1, sy1, flipy, ynum, ystart, yend, yinc;
UINT16 *s3; UINT16 *s3;
xnum = 0x20; // width in tiles (screen-wide) xnum = 0x20; // width in tiles (screen-wide)
ynum = 0x8; // height in tiles (always 64 pixels?) ynum = 0x8; // height in tiles (always 64 pixels?)
scroll &= 0x7; // scroll register index scroll &= 0x7; // scroll register index
/* Sign extend the position */ /* Sign extend the position */
sx = 0; sx = 0;
@ -650,38 +650,38 @@ static void draw_row(running_machine *machine, bitmap_t *bitmap, const rectangle
if (clip.max_y > cliprect->max_y) clip.max_y = cliprect->max_y; if (clip.max_y > cliprect->max_y) clip.max_y = cliprect->max_y;
/* Get the scroll data */ /* Get the scroll data */
x = ssv_scroll[ scroll * 4 + 0 ]; // x scroll x = ssv_scroll[ scroll * 4 + 0 ]; // x scroll
y = ssv_scroll[ scroll * 4 + 1 ]; // y scroll y = ssv_scroll[ scroll * 4 + 1 ]; // y scroll
// ssv_scroll[ scroll * 4 + 2 ]; // ??? // ssv_scroll[ scroll * 4 + 2 ]; // ???
mode = ssv_scroll[ scroll * 4 + 3 ]; // layer disabled, shadow, depth etc. mode = ssv_scroll[ scroll * 4 + 3 ]; // layer disabled, shadow, depth etc.
/* Background layer disabled */ /* Background layer disabled */
if ((mode & 0xf000) == 0) if ((mode & 0xe000) == 0)
return; return;
shadow = (mode & 0x0800); shadow = (mode & 0x0800);
/* Decide the actual size of the tilemap. $200 and $400 pixels /* Decide the actual size of the tilemap */
are the only values actually used AFAIK */
size = 1 << (8 + ((mode & 0xe000) >> 13)); size = 1 << (8 + ((mode & 0xe000) >> 13));
page = (x & 0x7fff) / size; page = (x & 0x7fff) / size;
/* Given a fixed scroll value, the portion of tilemap displayed changes /* Given a fixed scroll value, the portion of tilemap displayed changes with the sprite position */
with the sprite position */ x += sx;
x += sx; y += sy;
y += sy;
/* Tweak the scroll values (game specific) */ /* Tweak the scroll values */
// x += 0; // x += 0;
y += ((ssv_scroll[0x70/2] & 0x1ff) - (ssv_scroll[0x70/2] & 0x200) + ssv_scroll[0x6a/2] + 2); y += ((ssv_scroll[0x70/2] & 0x1ff) - (ssv_scroll[0x70/2] & 0x200) + ssv_scroll[0x6a/2] + 2);
/* Draw the rows */ // Kludge for eaglshot
if ((ssv_scroll[ scroll * 4 + 2 ] & 0x05ff) == 0x0440) x += -0x10;
if ((ssv_scroll[ scroll * 4 + 2 ] & 0x05ff) == 0x0401) x += -0x20;
x1 = x; /* Draw the rows */
y1 = y; x1 = x;
sx1 = sx - (x & 0xf); y1 = y;
sy1 = sy - (y & 0xf); sx1 = sx - (x & 0xf);
sy1 = sy - (y & 0xf);
for (sx=sx1,x=x1; sx <= clip.max_x; sx+=0x10,x+=0x10) for (sx=sx1,x=x1; sx <= clip.max_x; sx+=0x10,x+=0x10)
{ {