{\r
unsigned int pack;\r
\r
- code = Pico.vram[ts->nametab + (tilex & ts->xmask)];\r
+ code = PicoMem.vram[ts->nametab + (tilex & ts->xmask)];\r
if (code == blank)\r
continue;\r
if ((code >> 15) | (lflags & LF_FORCE)) { // high priority tile\r
pal=((code>>9)&0x30)|sh;\r
}\r
\r
- pack = *(unsigned int *)(Pico.vram + addr);\r
+ pack = *(unsigned int *)(PicoMem.vram + addr);\r
if (!pack) {\r
blank = code;\r
continue;\r
// Draw tiles across screen:\r
tilex=(-ts->hscroll)>>3;\r
dx=((ts->hscroll-1)&7)+1;\r
- if(dx != 8) cell--; // have hscroll, start with negative cell\r
+ if (ts->hscroll & 0x0f) {\r
+ int adj = ((ts->hscroll ^ dx) >> 3) & 1;\r
+ cell -= adj + 1;\r
+ ts->cells -= adj;\r
+ }\r
cell+=cellskip;\r
tilex+=cellskip;\r
dx+=cellskip<<3;\r
//if((cell&1)==0)\r
{\r
int line,vscroll;\r
- vscroll=Pico.vsram[(plane_sh&1)+(cell&~1)];\r
+ vscroll=PicoMem.vsram[(plane_sh&1)+(cell&~1)];\r
\r
// Find the line in the name table\r
line=(vscroll+scan)&ts->line&0xffff; // ts->line is really ymask ..\r
ty=(line&7)<<1; // Y-Offset into tile\r
}\r
\r
- code=Pico.vram[ts->nametab+nametabadd+(tilex&ts->xmask)];\r
+ code=PicoMem.vram[ts->nametab+nametabadd+(tilex&ts->xmask)];\r
if (code==blank) continue;\r
if (code>>15) { // high priority tile\r
int cval = code | (dx<<16) | (ty<<25);\r
pal=((code>>9)&0x30)|((plane_sh<<5)&0x40);\r
}\r
\r
- pack = *(unsigned int *)(Pico.vram + addr);\r
+ pack = *(unsigned int *)(PicoMem.vram + addr);\r
if (!pack) {\r
blank = code;\r
continue;\r
{\r
unsigned int pack;\r
\r
- code=Pico.vram[ts->nametab+(tilex&ts->xmask)];\r
+ code = PicoMem.vram[ts->nametab + (tilex & ts->xmask)];\r
if (code==blank) continue;\r
if (code>>15) { // high priority tile\r
int cval = (code&0xfc00) | (dx<<16) | (ty<<25);\r
pal=((code>>9)&0x30);\r
}\r
\r
- pack = *(unsigned int *)(Pico.vram + addr);\r
+ pack = *(unsigned int *)(PicoMem.vram + addr);\r
if (!pack) {\r
blank = code;\r
continue;\r
htab+=plane_sh&1; // A or B\r
\r
// Get horizontal scroll value, will be masked later\r
- ts.hscroll=Pico.vram[htab&0x7fff];\r
+ ts.hscroll = PicoMem.vram[htab & 0x7fff];\r
\r
if((pvid->reg[12]&6) == 6) {\r
// interlace mode 2\r
- vscroll=Pico.vsram[plane_sh&1]; // Get vertical scroll value\r
+ vscroll = PicoMem.vsram[plane_sh & 1]; // Get vertical scroll value\r
\r
// Find the line in the name table\r
ts.line=(vscroll+(est->DrawScanline<<1))&((ymask<<1)|1);\r
ts.line=ymask|(shift[width]<<24); // save some stuff instead of line\r
DrawStripVSRam(&ts, plane_sh, cellskip);\r
} else {\r
- vscroll=Pico.vsram[plane_sh&1]; // Get vertical scroll value\r
+ vscroll = PicoMem.vsram[plane_sh & 1]; // Get vertical scroll value\r
\r
// Find the line in the name table\r
ts.line=(vscroll+est->DrawScanline)&ymask;\r
\r
if (!(est->rendstatus & PDRAW_WND_DIFF_PRIO)) {\r
// check the first tile code\r
- code=Pico.vram[nametab+tilex];\r
+ code = PicoMem.vram[nametab + tilex];\r
// if the whole window uses same priority (what is often the case), we may be able to skip this field\r
if ((code>>15) != prio) return;\r
}\r
int dx, addr;\r
int pal;\r
\r
- code=Pico.vram[nametab+tilex];\r
+ code = PicoMem.vram[nametab + tilex];\r
if (code==blank) continue;\r
if ((code>>15) != prio) {\r
est->rendstatus |= PDRAW_WND_DIFF_PRIO;\r
addr=(code&0x7ff)<<4;\r
if (code&0x1000) addr+=14-ty; else addr+=ty; // Y-flip\r
\r
- pack = *(unsigned int *)(Pico.vram + addr);\r
+ pack = *(unsigned int *)(PicoMem.vram + addr);\r
if (!pack) {\r
blank = code;\r
continue;\r
int dx, addr;\r
int pal;\r
\r
- code=Pico.vram[nametab+tilex];\r
+ code = PicoMem.vram[nametab + tilex];\r
if(code==blank) continue;\r
if((code>>15) != prio) {\r
est->rendstatus |= PDRAW_WND_DIFF_PRIO;\r
addr=(code&0x7ff)<<4;\r
if (code&0x1000) addr+=14-ty; else addr+=ty; // Y-flip\r
\r
- pack = *(unsigned int *)(Pico.vram + addr);\r
+ pack = *(unsigned int *)(PicoMem.vram + addr);\r
if (!pack) {\r
blank = code;\r
continue;\r
addr = (code & 0x7ff) << 4;\r
addr += code >> 25; // y offset into tile\r
\r
- pack = *(unsigned int *)(Pico.vram + addr);\r
+ pack = *(unsigned int *)(PicoMem.vram + addr);\r
if (!pack) {\r
blank = (short)code;\r
continue;\r
*zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf;\r
*zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf; *zb++ &= 0xbf;\r
\r
- pack = *(unsigned int *)(Pico.vram + addr);\r
+ pack = *(unsigned int *)(PicoMem.vram + addr);\r
if (!pack)\r
continue;\r
\r
if(sx<=0) continue;\r
if(sx>=328) break; // Offscreen\r
\r
- pack = *(unsigned int *)(Pico.vram + (tile & 0x7fff));\r
+ pack = *(unsigned int *)(PicoMem.vram + (tile & 0x7fff));\r
fTileFunc(sx, pack, pal);\r
}\r
}\r
\r
dx = (code >> 16) & 0x1ff;\r
pal = ((code >> 9) & 0x30);\r
- pack = *(unsigned int *)(Pico.vram + addr);\r
+ pack = *(unsigned int *)(PicoMem.vram + addr);\r
\r
if (code & 0x0800) TileFlip_and(dx, pack, pal);\r
else TileNorm_and(dx, pack, pal);\r
if(sx<=0) continue;\r
if(sx>=328) break; // Offscreen\r
\r
- pack = *(unsigned int *)(Pico.vram + (tile & 0x7fff));\r
+ pack = *(unsigned int *)(PicoMem.vram + (tile & 0x7fff));\r
if (code & 0x0800) TileFlip(sx, pack, pal);\r
else TileNorm(sx, pack, pal);\r
}\r
unsigned int *sprite;\r
int code, sx, sy, height;\r
\r
- sprite=(unsigned int *)(Pico.vram+((table+(link<<2))&0x7ffc)); // Find sprite\r
+ sprite=(unsigned int *)(PicoMem.vram+((table+(link<<2))&0x7ffc)); // Find sprite\r
\r
// get sprite info\r
code = sprite[0];\r
if(sx<=0) continue;\r
if(sx>=328) break; // Offscreen\r
\r
- pack = *(unsigned int *)(Pico.vram + (tile & 0x7fff));\r
+ pack = *(unsigned int *)(PicoMem.vram + (tile & 0x7fff));\r
fTileFunc(sx, pack, pal);\r
}\r
}\r
if(sx<=0) continue;\r
if(sx>=328) break; // Offscreen\r
\r
- pack = *(unsigned int *)(Pico.vram + (tile & 0x7fff));\r
+ pack = *(unsigned int *)(PicoMem.vram + (tile & 0x7fff));\r
fTileFunc(sx, pack, pal);\r
}\r
}\r
unsigned int *sprite;\r
int code2, sx, sy, height;\r
\r
- sprite=(unsigned int *)(Pico.vram+((table+(link<<2))&0x7ffc)); // Find sprite\r
+ sprite=(unsigned int *)(PicoMem.vram+((table+(link<<2))&0x7ffc)); // Find sprite\r
\r
// parse sprite info\r
code2 = sprite[1];\r
unsigned int *sprite;\r
int code, code2, sx, sy, hv, height, width;\r
\r
- sprite=(unsigned int *)(Pico.vram+((table+(link<<2))&0x7ffc)); // Find sprite\r
+ sprite=(unsigned int *)(PicoMem.vram+((table+(link<<2))&0x7ffc)); // Find sprite\r
\r
// parse sprite info\r
code = sprite[0];\r
\r
Pico.m.dirtyPal = 0;\r
\r
- spal = (void *)Pico.cram;\r
+ spal = (void *)PicoMem.cram;\r
dpal = (void *)est->HighPal;\r
\r
for (i = 0; i < 0x40 / 2; i++) {\r
rs |= PDRAW_SONIC_MODE;\r
est->rendstatus = rs;\r
if (dirty_count == 3) {\r
- blockcpy(est->HighPal, Pico.cram, 0x40*2);\r
+ blockcpy(est->HighPal, PicoMem.cram, 0x40*2);\r
} else if (dirty_count == 11) {\r
- blockcpy(est->HighPal+0x40, Pico.cram, 0x40*2);\r
+ blockcpy(est->HighPal+0x40, PicoMem.cram, 0x40*2);\r
}\r
}\r
\r