X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=picodrive.git;a=blobdiff_plain;f=pico%2Fdraw.c;fp=pico%2Fdraw.c;h=e5287b4e6bd6ce22e57220ccd2950cd9feebbe07;hp=680de3da03795081094a9142e7a47c5c169cc8ba;hb=93589da1b97373c9dc747d29eba81ed9158a5209;hpb=d0eab7dae887dd75a33cfbb4c5a60f535d7fece3 diff --git a/pico/draw.c b/pico/draw.c index 680de3d..e5287b4 100644 --- a/pico/draw.c +++ b/pico/draw.c @@ -411,6 +411,7 @@ static void DrawLayer(int plane_sh, int *hcache, int cellskip, int maxcells, { struct PicoVideo *pvid=&Pico.video; 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; int width, height, ymask; 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 htab=pvid->reg[13]<<9; // Horizontal scroll table address - if ( pvid->reg[11]&2) htab+=est->DrawScanline<<1; // Offset by line - if ((pvid->reg[11]&1)==0) htab&=~0xf; // Offset by tile + htab+=(est->DrawScanline&h_masks[pvid->reg[11]&3])<<1; // Point to line (masked) htab+=plane_sh&1; // A or B // Get horizontal scroll value, will be masked later