mirror of
https://github.com/holub/mame
synced 2025-07-05 09:57:47 +03:00
popobear - sprite<->sprite priority handling (used to keep character line in order)
This commit is contained in:
parent
6621b43d9f
commit
ee1c2e5fed
@ -238,14 +238,17 @@ void popobear_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
???? ---- ---- ---- unused?
|
???? ---- ---- ---- unused?
|
||||||
---- xxxx ---- ---- priority?
|
---- xxxx ---- ---- priority (against other sprites! used to keep the line of characters following you in order)
|
||||||
---- ---- x--- ---- Y direction
|
---- ---- x--- ---- Y direction
|
||||||
---- ---- -x-- ---- X direction
|
---- ---- -x-- ---- X direction
|
||||||
---- ---- --xx ---- size (height & width)
|
---- ---- --xx ---- size (height & width)
|
||||||
---- ---- ---- xx-- color bank
|
---- ---- ---- xx-- color bank
|
||||||
---- ---- ---- --xx ??
|
---- ---- ---- --x- NOT set on the enemy character / characters in your line
|
||||||
|
---- ---- ---- ---x set on opposite to above?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
for (int drawpri = 0xf;drawpri>=0x0;drawpri--)
|
||||||
|
{
|
||||||
/* 0x106 = 8 x 8 */
|
/* 0x106 = 8 x 8 */
|
||||||
/* 0x*29 = 32 x 32 */
|
/* 0x*29 = 32 x 32 */
|
||||||
for(i = 0x800-8;i >= 0; i-=8)
|
for(i = 0x800-8;i >= 0; i-=8)
|
||||||
@ -254,6 +257,13 @@ void popobear_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect
|
|||||||
int x = vram[i+0x7f800+4]|(vram[i+0x7f800+5]<<8);
|
int x = vram[i+0x7f800+4]|(vram[i+0x7f800+5]<<8);
|
||||||
int spr_num = vram[i+0x7f800+6]|(vram[i+0x7f800+7]<<8);
|
int spr_num = vram[i+0x7f800+6]|(vram[i+0x7f800+7]<<8);
|
||||||
int param = vram[i+0x7f800+0]|(vram[i+0x7f800+1]<<8);
|
int param = vram[i+0x7f800+0]|(vram[i+0x7f800+1]<<8);
|
||||||
|
|
||||||
|
int pri = (param & 0x0f00)>>8;
|
||||||
|
|
||||||
|
// we do this because it's sprite<->sprite priority,
|
||||||
|
if (pri!=drawpri)
|
||||||
|
continue;
|
||||||
|
|
||||||
int width = 8 << ((param & 0x30)>>4);
|
int width = 8 << ((param & 0x30)>>4);
|
||||||
int height = width; // sprites are always square?
|
int height = width; // sprites are always square?
|
||||||
|
|
||||||
@ -264,6 +274,8 @@ void popobear_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect
|
|||||||
if (x&0x8000) x-= 0x10000;
|
if (x&0x8000) x-= 0x10000;
|
||||||
if (y&0x8000) y-= 0x10000;
|
if (y&0x8000) y-= 0x10000;
|
||||||
|
|
||||||
|
if (param&0xf000) color_bank = (machine().rand() & 0x3);
|
||||||
|
|
||||||
if(param == 0)
|
if(param == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -271,12 +283,12 @@ void popobear_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect
|
|||||||
|
|
||||||
for(int yi=0;yi<height;yi++)
|
for(int yi=0;yi<height;yi++)
|
||||||
{
|
{
|
||||||
int y_draw = (y_dir) ? y+(height - yi) : y+yi;
|
int y_draw = (y_dir) ? y+((height-1) - yi) : y+yi;
|
||||||
|
|
||||||
for(int xi=0;xi<width;xi++)
|
for(int xi=0;xi<width;xi++)
|
||||||
{
|
{
|
||||||
UINT8 pix = (vram[spr_num^1] & 0xff);
|
UINT8 pix = (vram[spr_num^1] & 0xff);
|
||||||
int x_draw = (x_dir) ? x+(width - xi) : x+xi;
|
int x_draw = (x_dir) ? x+((width-1) - xi) : x+xi;
|
||||||
|
|
||||||
if(cliprect.contains(x_draw, y_draw) && pix)
|
if(cliprect.contains(x_draw, y_draw) && pix)
|
||||||
bitmap.pix16(y_draw, x_draw) = machine().pens[pix+0x100+color_bank];
|
bitmap.pix16(y_draw, x_draw) = machine().pens[pix+0x100+color_bank];
|
||||||
@ -286,6 +298,7 @@ void popobear_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UINT32 popobear_state::screen_update_popobear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
UINT32 popobear_state::screen_update_popobear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user