mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
improve graphics in gostop (nw)
This commit is contained in:
parent
774b2021ab
commit
f2d8c05791
@ -341,13 +341,13 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip
|
||||
|
||||
76543210 (bit)
|
||||
0 llllllll
|
||||
1 ---1SSSl
|
||||
1 ---gSSSl
|
||||
2 oooooooo
|
||||
3 fooooooo
|
||||
4 xxxxxxxx
|
||||
5 ------xx
|
||||
5 ----XXxx
|
||||
6 yyyyyyyy
|
||||
7 ------yy
|
||||
7 ----XYyy
|
||||
|
||||
1 - always(?) set
|
||||
S - scroll index ? (ports $40-$60, X(word),Y(word) )
|
||||
@ -356,6 +356,11 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip
|
||||
f - end of list flag
|
||||
x,y - sprite coords
|
||||
|
||||
(complete guess)
|
||||
g - use tile sizes specified in list (global / fixed ones if not set?) (gostop)
|
||||
X = global X size?
|
||||
Y = global Y size?
|
||||
|
||||
sublist format (8 bytes/entry):
|
||||
|
||||
76543210
|
||||
@ -364,9 +369,9 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip
|
||||
2 --kkkkkk
|
||||
3 QW------
|
||||
4 xxxxxxxx
|
||||
5 -B---XXx
|
||||
5 -B--XX-x
|
||||
6 yyyyyyyy
|
||||
7 -----YYy
|
||||
7 ----YY-y
|
||||
|
||||
c - character code
|
||||
k - palette
|
||||
@ -386,6 +391,10 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip
|
||||
x = st0016_spriteram[i + 4] + ((st0016_spriteram[i + 5] & 3) << 8);
|
||||
y = st0016_spriteram[i + 6] + ((st0016_spriteram[i + 7] & 3) << 8);
|
||||
|
||||
int use_sizes = (st0016_spriteram[i + 1] & 0x10);
|
||||
int globalx = (st0016_spriteram[i + 5] & 0x0c)>>2;
|
||||
int globaly = (st0016_spriteram[i + 7] & 0x0c)>>2;
|
||||
|
||||
scrollx = (st0016_vregs[(((st0016_spriteram[i + 1] & 0x0f) >> 1) << 2) + 0x40] + 256 * st0016_vregs[(((st0016_spriteram[i + 1] & 0x0f) >> 1) << 2) + 1 + 0x40]) & 0x3ff;
|
||||
scrolly = (st0016_vregs[(((st0016_spriteram[i + 1] & 0x0f) >> 1) << 2) + 2 + 0x40] + 256 * st0016_vregs[(((st0016_spriteram[i + 1] & 0x0f) >> 1) << 2) + 3 + 0x40]) & 0x3ff;
|
||||
|
||||
@ -447,8 +456,19 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip
|
||||
sx += x;
|
||||
sy += y;
|
||||
color = st0016_spriteram[offset + 2] & 0x3f;
|
||||
|
||||
if (use_sizes)
|
||||
{
|
||||
lx = (st0016_spriteram[offset + 5] >> 2) & 3;
|
||||
ly = (st0016_spriteram[offset + 7] >> 2) & 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
lx = globalx;
|
||||
ly = globaly;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
if(plx |ply) //parent
|
||||
{
|
||||
@ -486,7 +506,8 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip
|
||||
{
|
||||
UINT16 drawypos;
|
||||
|
||||
if (!flipy) {drawypos = ypos+yloop;} else {drawypos = (ypos+8-1)-yloop;}
|
||||
if (!flipy) { drawypos = ypos + yloop; }
|
||||
else { drawypos = (ypos + 8 - 1) - yloop; }
|
||||
destline = &bitmap.pix16(drawypos);
|
||||
|
||||
for (xloop = 0; xloop<8; xloop++)
|
||||
@ -495,7 +516,8 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip
|
||||
int pixdata;
|
||||
pixdata = srcgfx[gfxoffs];
|
||||
|
||||
if (!flipx) { drawxpos = xpos+xloop; } else { drawxpos = (xpos+8-1)-xloop; }
|
||||
if (!flipx) { drawxpos = xpos + xloop; }
|
||||
else { drawxpos = (xpos + 8 - 1) - xloop; }
|
||||
|
||||
if (drawxpos > cliprect.max_x)
|
||||
drawxpos -= 512; // wrap around
|
||||
@ -593,7 +615,9 @@ void st0016_cpu_device::draw_bgmap(bitmap_ind16 &bitmap,const rectangle &cliprec
|
||||
{
|
||||
int x, y, code, color, flipx, flipy;
|
||||
int i = st0016_vregs[j + 1] * 0x1000;
|
||||
|
||||
for (x = 0; x < 32 * 2; x++)
|
||||
{
|
||||
for (y = 0; y < 8 * 4; y++)
|
||||
{
|
||||
code = st0016_spriteram[i] + 256 * st0016_spriteram[i + 1];
|
||||
@ -626,7 +650,8 @@ void st0016_cpu_device::draw_bgmap(bitmap_ind16 &bitmap,const rectangle &cliprec
|
||||
{
|
||||
UINT16 drawypos;
|
||||
|
||||
if (!flipy) {drawypos = ypos+yloop;} else {drawypos = (ypos+8-1)-yloop;}
|
||||
if (!flipy) { drawypos = ypos + yloop; }
|
||||
else { drawypos = (ypos + 8 - 1) - yloop; }
|
||||
destline = &bitmap.pix16(drawypos);
|
||||
|
||||
for (xloop = 0; xloop<8; xloop++)
|
||||
@ -635,7 +660,8 @@ void st0016_cpu_device::draw_bgmap(bitmap_ind16 &bitmap,const rectangle &cliprec
|
||||
int pixdata;
|
||||
pixdata = srcgfx[gfxoffs];
|
||||
|
||||
if (!flipx) { drawxpos = xpos+xloop; } else { drawxpos = (xpos+8-1)-xloop; }
|
||||
if (!flipx) { drawxpos = xpos + xloop; }
|
||||
else { drawxpos = (xpos + 8 - 1) - xloop; }
|
||||
|
||||
if (drawxpos > cliprect.max_x)
|
||||
drawxpos -= 512; // wrap around
|
||||
@ -674,6 +700,7 @@ void st0016_cpu_device::draw_bgmap(bitmap_ind16 &bitmap,const rectangle &cliprec
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void st0016_cpu_device::st0016_draw_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
|
Loading…
Reference in New Issue
Block a user