mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 23:37:46 -04:00
draw.c, DrawLayer(): impl. proper linescroll, fixes issue #56
This commit is contained in:
parent
d0eab7dae8
commit
ce32676eb8
1 changed files with 2 additions and 2 deletions
|
@ -411,6 +411,7 @@ static void DrawLayer(int plane_sh, int *hcache, int cellskip, int maxcells,
|
||||||
{
|
{
|
||||||
struct PicoVideo *pvid=&Pico.video;
|
struct PicoVideo *pvid=&Pico.video;
|
||||||
const char shift[4]={5,6,5,7}; // 32,64 or 128 sized tilemaps (2 is invalid)
|
const char shift[4]={5,6,5,7}; // 32,64 or 128 sized tilemaps (2 is invalid)
|
||||||
|
const unsigned char h_masks[4] = { 0x00, 0x07, 0xf8, 0xff };
|
||||||
struct TileStrip ts;
|
struct TileStrip ts;
|
||||||
int width, height, ymask;
|
int width, height, ymask;
|
||||||
int vscroll, htab;
|
int vscroll, htab;
|
||||||
|
@ -437,8 +438,7 @@ static void DrawLayer(int plane_sh, int *hcache, int cellskip, int maxcells,
|
||||||
else ts.nametab=(pvid->reg[2]&0x38)<< 9; // A
|
else ts.nametab=(pvid->reg[2]&0x38)<< 9; // A
|
||||||
|
|
||||||
htab=pvid->reg[13]<<9; // Horizontal scroll table address
|
htab=pvid->reg[13]<<9; // Horizontal scroll table address
|
||||||
if ( pvid->reg[11]&2) htab+=est->DrawScanline<<1; // Offset by line
|
htab+=(est->DrawScanline&h_masks[pvid->reg[11]&3])<<1; // Point to line (masked)
|
||||||
if ((pvid->reg[11]&1)==0) htab&=~0xf; // Offset by tile
|
|
||||||
htab+=plane_sh&1; // A or B
|
htab+=plane_sh&1; // A or B
|
||||||
|
|
||||||
// Get horizontal scroll value, will be masked later
|
// Get horizontal scroll value, will be masked later
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue