split memories away from Pico
[picodrive.git] / pico / draw2.c
index db155fa..f0e0518 100644 (file)
@@ -25,7 +25,7 @@ static unsigned char PicoDraw2FB_[(8+320) * (8+240+8)];
 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
-unsigned short *PicoCramHigh=Pico.cram; // pointer to CRAM buff (0x40 shorts), converted to native device color (works only with 16bit for now)\r
+unsigned short *PicoCramHigh=PicoMem.cram; // pointer to CRAM buff (0x40 shorts), converted to native device color (works only with 16bit for now)\r
 void (*PicoPrepareCram)()=0;            // prepares PicoCramHigh for renderer to use\r
 \r
 \r
@@ -46,7 +46,7 @@ static int TileXnormYnorm(unsigned char *pd,int addr,unsigned char pal)
        int i;\r
 \r
        for(i=8; i; i--, addr+=2, pd += LINE_WIDTH) {\r
-               pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
+               pack=*(unsigned int *)(PicoMem.vram+addr); // Get 8 pixels\r
                if(!pack) continue;\r
 \r
                t=pack&0x0000f000; if (t) pd[0]=(unsigned char)((t>>12)|pal);\r
@@ -69,7 +69,7 @@ static int TileXflipYnorm(unsigned char *pd,int addr,unsigned char pal)
        int i;\r
 \r
        for(i=8; i; i--, addr+=2, pd += LINE_WIDTH) {\r
-               pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
+               pack=*(unsigned int *)(PicoMem.vram+addr); // Get 8 pixels\r
                if(!pack) continue;\r
 \r
                t=pack&0x000f0000; if (t) pd[0]=(unsigned char)((t>>16)|pal);\r
@@ -92,7 +92,7 @@ static int TileXnormYflip(unsigned char *pd,int addr,unsigned char pal)
 \r
        addr+=14;\r
        for(i=8; i; i--, addr-=2, pd += LINE_WIDTH) {\r
-               pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
+               pack=*(unsigned int *)(PicoMem.vram+addr); // Get 8 pixels\r
                if(!pack) continue;\r
 \r
                t=pack&0x0000f000; if (t) pd[0]=(unsigned char)((t>>12)|pal);\r
@@ -116,7 +116,7 @@ static int TileXflipYflip(unsigned char *pd,int addr,unsigned char pal)
 \r
        addr+=14;\r
        for(i=8; i; i--, addr-=2, pd += LINE_WIDTH) {\r
-               pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels\r
+               pack=*(unsigned int *)(PicoMem.vram+addr); // Get 8 pixels\r
                if(!pack) continue;\r
 \r
                t=pack&0x000f0000; if (t) pd[0]=(unsigned char)((t>>16)|pal);\r
@@ -161,7 +161,7 @@ static void DrawWindowFull(int start, int end, int prio, struct PicoEState *est)
        nametab += nametab_step*start;\r
 \r
        // check priority\r
-       code=Pico.vram[nametab+tile_start];\r
+       code=PicoMem.vram[nametab+tile_start];\r
        if ((code>>15) != prio) return; // hack: just assume that whole window uses same priority\r
 \r
        scrpos+=8*LINE_WIDTH+8;\r
@@ -175,7 +175,7 @@ static void DrawWindowFull(int start, int end, int prio, struct PicoEState *est)
 //                     unsigned short *pal=NULL;\r
                        unsigned char pal;\r
 \r
-                       code=Pico.vram[nametab+tilex];\r
+                       code=PicoMem.vram[nametab+tilex];\r
                        if (code==blank) continue;\r
 \r
                        // Get tile address/2:\r
@@ -222,7 +222,7 @@ static void DrawLayerFull(int plane, int *hcache, int planestart, int planeend,
 \r
        if(!(pvid->reg[11]&3)) { // full screen scroll\r
                // Get horizontal scroll value\r
-               hscroll=Pico.vram[htab&0x7fff];\r
+               hscroll=PicoMem.vram[htab&0x7fff];\r
                htab = 0; // this marks that we don't have to update scroll value\r
        }\r
 \r
@@ -243,7 +243,7 @@ static void DrawLayerFull(int plane, int *hcache, int planestart, int planeend,
        scrpos+=8*LINE_WIDTH*(planestart-START_ROW);\r
 \r
        // Get vertical scroll value:\r
-       vscroll=Pico.vsram[plane]&0x1ff;\r
+       vscroll=PicoMem.vsram[plane]&0x1ff;\r
        scrpos+=(8-(vscroll&7))*LINE_WIDTH;\r
        if(vscroll&7) planeend++; // we have vertically clipped tiles due to vscroll, so we need 1 more row\r
 \r
@@ -262,7 +262,7 @@ static void DrawLayerFull(int plane, int *hcache, int planestart, int planeend,
                if(htab) {\r
                        int htaddr=htab+(trow<<4);\r
                        if(trow) htaddr-=(vscroll&7)<<1;\r
-                       hscroll=Pico.vram[htaddr&0x7fff];\r
+                       hscroll=PicoMem.vram[htaddr&0x7fff];\r
                }\r
 \r
                // Draw tiles across screen:\r
@@ -276,7 +276,7 @@ static void DrawLayerFull(int plane, int *hcache, int planestart, int planeend,
 //                     unsigned short *pal=NULL;\r
                        unsigned char pal;\r
 \r
-                       code=Pico.vram[nametab_row+(tilex&xmask)];\r
+                       code=PicoMem.vram[nametab_row+(tilex&xmask)];\r
                        if (code==blank) continue;\r
 \r
                        if (code>>15) { // high priority tile\r
@@ -422,7 +422,7 @@ static void DrawAllSpritesFull(int prio, int maxwidth)
                unsigned int *sprite=NULL;\r
                int code, 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
                // get sprite info\r
                code = sprite[0];\r