konami 56832: fixed scrollmode 2 for flipped screen [Roberto Zandona']

This commit is contained in:
Roberto Zandona 2011-10-10 21:32:08 +00:00
parent 5ee0c7d818
commit a2e75c92b0
4 changed files with 34 additions and 11 deletions

View File

@ -99,14 +99,14 @@ SCREEN_UPDATE( asterix )
bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[0], 0, 1);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[1], 0, 2);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[2], 0, 4);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[0], K056832_DRAW_FLAG_MIRROR, 1);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[1], K056832_DRAW_FLAG_MIRROR, 2);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[2], K056832_DRAW_FLAG_MIRROR, 4);
/* this isn't supported anymore and it is unsure if still needed; keeping here for reference
pdrawgfx_shadow_lowpri = 1; fix shadows in front of feet */
k053245_sprites_draw(state->m_k053244, bitmap, cliprect);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 2, 0, 0);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 2, K056832_DRAW_FLAG_MIRROR, 0);
return 0;
}

View File

@ -7178,7 +7178,25 @@ void k056832_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle *
}
if (flipy)
sdat_adv = -sdat_adv;
/*
if (scrollmode==2)
{
printf("%08x %08x %08x\n",layer,scrollbank<<12,k056832->lsram_page[layer][1]>>1);
printf("\n000-100:\n");
for (int zz=0x000; zz<0x100; zz++)
printf("%04x ",k056832->videoram[(scrollbank<<12)+(k056832->lsram_page[layer][1]>>1)+zz]);
printf("\n100-200:\n");
for (int zz=0x100; zz<0x200; zz++)
printf("%04x ",k056832->videoram[(scrollbank<<12)+(k056832->lsram_page[layer][1]>>1)+zz]);
printf("\n200-300:\n");
for (int zz=0x200; zz<0x300; zz++)
printf("%04x ",k056832->videoram[(scrollbank<<12)+(k056832->lsram_page[layer][1]>>1)+zz]);
printf("\n300-400:\n");
for (int zz=0x300; zz<0x400; zz++)
printf("%04x ",k056832->videoram[(scrollbank<<12)+(k056832->lsram_page[layer][1]>>1)+zz]);
printf("\nend\n");
}
*/
last_active = k056832->active_layer;
new_colorbase = (k056832->k055555 != NULL) ? k055555_get_palette_index(k056832->k055555, layer) : 0;
@ -7322,8 +7340,12 @@ void k056832_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle *
drawrect.min_y = (dminy < cminy ) ? cminy : dminy;
drawrect.max_y = (dmaxy > cmaxy ) ? cmaxy : dmaxy;
dx = ((int)p_scroll_data[sdat_offs]<<16 | (int)p_scroll_data[sdat_offs + 1]) + corr;
// printf("%04x %04x\n",layer,flipy);
// in xexex: K056832_DRAW_FLAG_MIRROR != flipy
if ((scrollmode == 2) && (flags & K056832_DRAW_FLAG_MIRROR) && (flipy))
dx = ((int)p_scroll_data[sdat_offs + 0x1e0 + 14]<<16 | (int)p_scroll_data[sdat_offs + 0x1e0 + 15]) + corr;
else
dx = ((int)p_scroll_data[sdat_offs]<<16 | (int)p_scroll_data[sdat_offs + 1]) + corr;
if (last_dx == dx) { if (last_visible) goto LINE_SHORTCIRCUIT; continue; }
last_dx = dx;

View File

@ -748,6 +748,7 @@ WRITE32_DEVICE_HANDLER( k037122_char_w );
READ32_DEVICE_HANDLER( k037122_reg_r );
WRITE32_DEVICE_HANDLER( k037122_reg_w );
#define K056832_DRAW_FLAG_MIRROR 0x00800000
// debug handlers
READ16_DEVICE_HANDLER( k056832_word_r ); // VACSET

View File

@ -109,14 +109,14 @@ SCREEN_UPDATE(lethalen)
bitmap_fill(bitmap, cliprect, 7168);
bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 3, 0, 1);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 2, 0, 2);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 1, 0, 4);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 3, K056832_DRAW_FLAG_MIRROR, 1);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 2, K056832_DRAW_FLAG_MIRROR, 2);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 1, K056832_DRAW_FLAG_MIRROR, 4);
k053245_sprites_draw_lethal(state->m_k053244, bitmap, cliprect);
// force "A" layer over top of everything
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 0, 0, 0);
k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 0, K056832_DRAW_FLAG_MIRROR, 0);
return 0;
}