diff options
-rw-r--r-- | src/mame/video/segas32.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/mame/video/segas32.c b/src/mame/video/segas32.c index 9a12ed7b445..8031a948b40 100644 --- a/src/mame/video/segas32.c +++ b/src/mame/video/segas32.c @@ -41,8 +41,9 @@ $31FF00 : w--- ---- ---- ---- : Screen width (0= 320, 1= 412) ---- f--- ---- ---- : Bitmap format (1= 8bpp, 0= 4bpp) ---- -t-- ---- ---- : Tile banking related - ---- --f- ---- ---- : 1= All layers X+Y flip - ---- ---- ---- 4--- : 1= X+Y flip for NBG3 + ---- --f- ---- ---- : 1= Global X/Y flip? (most games?) + ---- ---f ---- ---- : 1= All layers Y flip (or one layer?) (Air Rescue 2nd screen) + ---- ---- ---- 4--- : 1= X+Y flip for NBG3 ---- ---- ---- -2-- : 1= X+Y flip for NBG2 ---- ---- ---- --1- : 1= X+Y flip for NBG1 ---- ---- ---- ---0 : 1= X+Y flip for NBG0 @@ -866,7 +867,7 @@ void segas32_state::update_tilemap_zoom(screen_device &screen, struct segas32_st UINT32 srcx, srcx_start, srcy; UINT32 srcxstep, srcystep; int dstxstep, dstystep; - int flip, opaque; + int opaque; int x, y; /* get the tilemaps */ @@ -879,7 +880,15 @@ void segas32_state::update_tilemap_zoom(screen_device &screen, struct segas32_st //if (screen.machine().input().code_pressed(KEYCODE_X) && bgnum == 1) opaque = 1; /* determine if we're flipped */ - flip = ((m_system32_videoram[0x1ff00/2] >> 9) ^ (m_system32_videoram[0x1ff00/2] >> bgnum)) & 1; + int global_flip = (m_system32_videoram[0x1ff00 / 2] >> 9)&1; + + int flipx = global_flip; + int flipy = global_flip ^ ((m_system32_videoram[0x1ff00 / 2] >> 8)&1); + + int layer_flip = (m_system32_videoram[0x1ff00 / 2] >> bgnum) & 1; + + flipy ^= layer_flip; + flipx ^= layer_flip; /* determine the clipping */ clipenable = (m_system32_videoram[0x1ff02/2] >> (11 + bgnum)) & 1; @@ -919,16 +928,22 @@ void segas32_state::update_tilemap_zoom(screen_device &screen, struct segas32_st srcy += cliprect.min_y * srcystep; /* if we're flipped, simply adjust the start/step parameters */ - if (flip) + if (flipy) { const rectangle &visarea = screen.visible_area(); - srcx_start += (visarea.max_x - 2 * cliprect.min_x) * srcxstep; srcy += (visarea.max_y - 2 * cliprect.min_y) * srcystep; - srcxstep = -srcxstep; srcystep = -srcystep; } + if (flipx) + { + const rectangle &visarea = screen.visible_area(); + + srcx_start += (visarea.max_x - 2 * cliprect.min_x) * srcxstep; + srcxstep = -srcxstep; + } + /* loop over the target rows */ for (y = cliprect.min_y; y <= cliprect.max_y; y++) { |