Fix bad assumption that rowpixels of two separate bitmaps are

guaranteed to be the same.
This commit is contained in:
Aaron Giles 2012-01-27 15:21:26 +00:00
parent 1ccb9aa2a0
commit fc831464e7

View File

@ -1461,6 +1461,7 @@ INLINE void draw_scanlines(running_machine &machine,
UINT8 *dstp0,*dstp; UINT8 *dstp0,*dstp;
int yadv = bitmap.rowpixels(); int yadv = bitmap.rowpixels();
int yadvp = state->m_pri_alp_bitmap.rowpixels();
int i=0,y=draw_line_num[0]; int i=0,y=draw_line_num[0];
int ty = y; int ty = y;
@ -1468,6 +1469,7 @@ INLINE void draw_scanlines(running_machine &machine,
{ {
ty = bitmap.height() - 1 - ty; ty = bitmap.height() - 1 - ty;
yadv = -yadv; yadv = -yadv;
yadvp = -yadvp;
} }
dstp0 = &state->m_pri_alp_bitmap.pix8(ty, x); dstp0 = &state->m_pri_alp_bitmap.pix8(ty, x);
@ -1546,15 +1548,14 @@ INLINE void draw_scanlines(running_machine &machine,
if(draw_line_num[i]==y+1) if(draw_line_num[i]==y+1)
{ {
dsti0 += yadv; dsti0 += yadv;
dstp0 += yadv; dstp0 += yadvp;
y++; y++;
continue; continue;
} }
else else
{ {
int dy=(draw_line_num[i]-y)*yadv; dsti0 += (draw_line_num[i]-y)*yadv;
dsti0 += dy; dstp0 += (draw_line_num[i]-y)*yadvp;
dstp0 += dy;
y=draw_line_num[i]; y=draw_line_num[i];
} }
} }
@ -2681,6 +2682,7 @@ INLINE void f3_drawgfx(
UINT32 *dest0 = &dest_bmp.pix32(sy, sx); UINT32 *dest0 = &dest_bmp.pix32(sy, sx);
UINT8 *pri0 = &state->m_pri_alp_bitmap.pix8(sy, sx); UINT8 *pri0 = &state->m_pri_alp_bitmap.pix8(sy, sx);
int yadv = dest_bmp.rowpixels(); int yadv = dest_bmp.rowpixels();
int yadvp = state->m_pri_alp_bitmap.rowpixels();
dy=dy*16; dy=dy*16;
while(1) while(1)
{ {
@ -2730,7 +2732,7 @@ INLINE void f3_drawgfx(
if(!(--y)) break; if(!(--y)) break;
source0 += dy; source0 += dy;
dest0+=yadv; dest0+=yadv;
pri0+=yadv; pri0+=yadvp;
} }
} }
} }