// shit, we have 2-cell column based vscroll\r
// luckily this doesn't happen too often\r
ts.line=ymask|(shift[width]<<24); // save some stuff instead of line\r
- plane_sh |= PicoMem.vsram[0x26+(~plane_sh&1)] << 16;\r
+ // vscroll value for leftmost cells in case of hscroll not on 16px boundary\r
+ // XXX it's unclear what exactly the hw is doing. Continue reading where it\r
+ // stopped last seems to work best (H40: 0x50 (wrap->0x00), H32 0x40).\r
+ plane_sh |= PicoMem.vsram[(pvid->reg[12]&1?0x00:0x20) + (plane_sh&1)] << 16;\r
DrawStripVSRam(&ts, plane_sh, cellskip);\r
} else {\r
vscroll = PicoMem.vsram[plane_sh & 1]; // Get vertical scroll value\r
// shit, we have 2-cell column based vscroll\r
// luckily this doesn't happen too often\r
ts.line=ymask|(shift[width]<<24); // save some stuff instead of line\r
- plane_sh |= PicoMem.vsram[0x26+(~plane_sh&1)] << 16;\r
+ // vscroll value for leftmost cells in case of hscroll not on 16px boundary\r
+ // XXX it's unclear what exactly the hw is doing. Continue reading where it\r
+ // stopped last seems to work best (H40: 0x50 (wrap->0x00), H32 0x40).\r
+ plane_sh |= PicoMem.vsram[(pvid->reg[12]&1?0x00:0x20) + (plane_sh&1)] << 16;\r
DrawStripVSRamForced(&ts, plane_sh, cellskip);\r
} else {\r
vscroll = PicoMem.vsram[plane_sh & 1]; // Get vertical scroll value\r
{\r
unsigned (*fTileFunc)(unsigned char *pd, unsigned m, unsigned int pack, int pal);\r
unsigned char *pd = Pico.est.HighCol;\r
- unsigned char mb[1+320+1];\r
+ unsigned char mb[1+320/8+1];\r
unsigned char *p, *mp;\r
unsigned m;\r
int entry, cnt;\r
@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
\r
.DrawStrip_vsscroll:\r
+ tst r8, #1 @ if h40: lflags |= 0x10000\r
+ orrne r0, r0, #0x10000\r
+\r
rsb r8, r3, #0\r
mov r8, r8, lsr #3 @ r8=tilex=(-ts->hscroll)>>3\r
bic r8, r8, #0x3fc00000\r
eor r3, r3, r7\r
sub r10,r10, #1<<24 @ cell-- // start from negative for hscroll\r
tst r3, #0x08\r
- add_c24 r1, lr, (OFS_PMEM_vsram-OFS_PMEM_vram)\r
- ldr r3, [r1, #0x4c] @ r3=vsram[0x26..0x27]\r
subne r10,r10, #1<<16 @ cells--\r
subne r10,r10, #1<<24 @ cell-- // even more negative\r
- ror r3, r3, #16\r
+\r
+ add_c24 r1, lr, (OFS_PMEM_vsram-OFS_PMEM_vram)\r
+ tst r0, #0x10000 @ h40?\r
+ ldrne r3, [r1, #0x00] @ r3=vsram[0x00..0x01]\r
+ ldreq r3, [r1, #0x40] @ r3=vsram[0x20..0x21]\r
str r3, [r1, #0x7c] @ vsram[0x3e..0x3f]=r3\r
0:\r
tst r9, #1<<31\r