{\r
struct PicoVideo *pvid=&Pico.video;\r
const char shift[4]={5,6,5,7}; // 32,64 or 128 sized tilemaps (2 is invalid)\r
+ const unsigned char h_masks[4] = { 0x00, 0x07, 0xf8, 0xff };\r
struct TileStrip ts;\r
int width, height, ymask;\r
int vscroll, htab;\r
else ts.nametab=(pvid->reg[2]&0x38)<< 9; // A\r
\r
htab=pvid->reg[13]<<9; // Horizontal scroll table address\r
- if ( pvid->reg[11]&2) htab+=est->DrawScanline<<1; // Offset by line\r
- if ((pvid->reg[11]&1)==0) htab&=~0xf; // Offset by tile\r
+ htab+=(est->DrawScanline&h_masks[pvid->reg[11]&3])<<1; // Point to line (masked)\r
htab+=plane_sh&1; // A or B\r
\r
// Get horizontal scroll value, will be masked later\r