Skip to content

Commit

Permalink
funtech/supracan.cpp: scroll values have 12-bit resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
angelosa committed Sep 6, 2024
1 parent 37c8f20 commit f32a459
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/mame/funtech/supracan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,12 @@ void supracan_state::get_tilemap_info_common(int layer, tile_data &tileinfo, int
if (region == 0)
tile_bank >>= 1;

// speedyd and slghtsag hints that text layer color offsets are in steps of 4
if (region == 2)
palette_shift = 2;

if (layer == 2)
{
tile_bank = (0x1000 | (tile_bank << 1)) & 0x1c00;
// speedyd hints that text layer color offsets are in steps of 4
// TODO: is this actually selectable with mode bit 14 in this context?
// Notice that GFX2 will mask with 0x1fff, making that effectively unused for this calculation.
palette_shift = 2;
}

int tile = (vram[count] & 0x03ff) + tile_bank;
int flipxy = (vram[count] & 0x0c00) >> 10;
Expand Down Expand Up @@ -1039,11 +1037,12 @@ uint32_t supracan_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
{
int wrap = (m_tilemap_flags[layer] & 0x20);

int scrollx = m_tilemap_scrollx[layer];
int scrolly = m_tilemap_scrolly[layer];
// slghtsag wants a resolution of 12-bits for text and title
int scrollx = m_tilemap_scrollx[layer] & 0xfff;
int scrolly = m_tilemap_scrolly[layer] & 0xfff;

if (scrollx & 0x8000) scrollx -= 0x10000;
if (scrolly & 0x8000) scrolly -= 0x10000;
if (scrollx & 0x800) scrollx -= 0x1000;
if (scrolly & 0x800) scrolly -= 0x1000;

int mosaic_count = (m_tilemap_flags[layer] & 0x001c) >> 2;
int mosaic_mask = 0xffffffff << mosaic_count;
Expand Down

0 comments on commit f32a459

Please sign in to comment.