oldcode = code;\r
// Get tile address/2:\r
addr=(code&0x7ff)<<4;\r
- if (code&0x1000) addr+=14-ty; else addr+=ty; // Y-flip\r
\r
pal=((code>>9)&0x30)|((plane_sh<<5)&0x40);\r
}\r
\r
- pack = *(unsigned int *)(PicoMem.vram + addr);\r
+ if (code & 0x1000) ty ^= 0xe; // Y-flip\r
+ pack = *(unsigned int *)(PicoMem.vram + addr+ty);\r
+\r
if (!pack) {\r
blank = code;\r
continue;\r
if (code!=oldcode) {\r
oldcode = code;\r
// Get tile address/2:\r
- addr=(code&0x7ff)<<5;\r
+ addr=(code&0x3ff)<<5;\r
if (code&0x1000) addr+=30-ty; else addr+=ty; // Y-flip\r
\r
// pal=Pico.cram+((code>>9)&0x30);\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
+ switch (pvid->reg[11]&3) {\r
+ case 1: htab += (est->DrawScanline<<1) & 0x0f; break;\r
+ case 2: htab += (est->DrawScanline<<1) & ~0x0f; break; // Offset by tile\r
+ case 3: htab += (est->DrawScanline<<1); break; // Offset by line\r
+ }\r
htab+=plane_sh&1; // A or B\r
\r
// Get horizontal scroll value, will be masked later\r
\r
if (!sh)\r
{\r
- short blank=-1; // The tile we know is blank\r
+ int blank=-1; // The tile we know is blank\r
while ((code=*hc++)) {\r
- if (!(code & 0x8000) || (short)code == blank)\r
+ if (!(code & 0x8000) || (unsigned short)code == blank)\r
continue;\r
// Get tile address/2:\r
addr = (code & 0x7ff) << 4;\r
\r
pack = *(unsigned int *)(PicoMem.vram + addr);\r
if (!pack) {\r
- blank = (short)code;\r
+ blank = (unsigned short)code;\r
continue;\r
}\r
\r
#define LINE_WIDTH 328\r
#endif\r
\r
-static unsigned char PicoDraw2FB_[(8+320) * (8+240+8)];\r
+static unsigned char PicoDraw2FB_[(8+320) * (8+240+8) + 8];\r
\r
static int HighCache2A[41*(TILE_ROWS+1)+1+1]; // caches for high layers\r
static int HighCache2B[41*(TILE_ROWS+1)+1+1];\r
\r
mov r4, r8, lsr #8 @ pvid->reg[13]\r
mov r4, r4, lsl #10 @ htab=pvid->reg[13]<<9; (halfwords)\r
- tst r7, #2\r
- addne r4, r4, r2, lsl #2 @ htab+=DrawScanline<<1; // Offset by line\r
- tst r7, #1\r
- biceq r4, r4, #0x1f @ htab&=~0xf; // Offset by tile\r
- add r4, r4, r0, lsl #1 @ htab+=plane\r
+\r
+ ands r3, r7, #0x03\r
+ beq 0f\r
+ cmp r3, #2\r
+ mov r3, r2, lsl #2 @ htab+=DrawScanline<<1; // Offset by line\r
+ biceq r3, #0x1f @ htab&=~0xf; // Offset by tile\r
+ andlt r3, #0x1f\r
+ add r4, r4, r3\r
+0: add r4, r4, r0, lsl #1 @ htab+=plane\r
bic r4, r4, #0x00ff0000 @ just in case\r
ldrh r3, [lr, r4] @ r3=hscroll\r
\r
tst r7, #0x8000\r
bne .DrawStrip_vs_hiprio\r
\r
+ orr r7, r7, r10, lsl #24 @ code | (ty << 24)\r
cmp r7, r9\r
beq .DrawStrip_vs_samecode @ we know stuff about this tile already\r
\r