eliminate texrels (wip)
[picodrive.git] / pico / videoport.c
index 6c876ae..1e67ddb 100644 (file)
@@ -22,7 +22,7 @@ typedef unsigned int   u32;
 \r
 int (*PicoDmaHook)(unsigned int source, int len, unsigned short **srcp, unsigned short **limitp) = NULL;\r
 \r
-static __inline void AutoIncrement(void)\r
+static INLINE void AutoIncrement(void)\r
 {\r
   Pico.video.addr=(unsigned short)(Pico.video.addr+Pico.video.reg[0xf]);\r
 }\r
@@ -36,7 +36,7 @@ static void VideoWrite(u16 d)
     case 1: if(a&1) d=(u16)((d<<8)|(d>>8)); // If address is odd, bytes are swapped (which game needs this?)\r
             Pico.vram [(a>>1)&0x7fff]=d;\r
             if (a - ((unsigned)(Pico.video.reg[5]&0x7f) << 9) < 0x400)\r
-              rendstatus |= PDRAW_DIRTY_SPRITES;\r
+              Pico.est.rendstatus |= PDRAW_DIRTY_SPRITES;\r
             break;\r
     case 3: Pico.m.dirtyPal = 1;\r
             Pico.cram [(a>>1)&0x003f]=d; break; // wraps (Desert Strike)\r
@@ -156,7 +156,7 @@ static void DmaSlow(int len)
       if (inc == 2 && !(a&1) && a+len*2 < 0x10000)\r
       {\r
         // most used DMA mode\r
-        memcpy16(r + (a>>1), pd, len);\r
+        pmemcpy16(r + (a>>1), pd, len);\r
         a += len*2;\r
       }\r
       else\r
@@ -172,7 +172,7 @@ static void DmaSlow(int len)
           //if(pd >= pdend) pd-=0x8000; // should be good for RAM, bad for ROM\r
         }\r
       }\r
-      rendstatus |= PDRAW_DIRTY_SPRITES;\r
+      Pico.est.rendstatus |= PDRAW_DIRTY_SPRITES;\r
       break;\r
 \r
     case 3: // cram\r
@@ -241,7 +241,7 @@ static void DmaCopy(int len)
   }\r
   // remember addr\r
   Pico.video.addr=a;\r
-  rendstatus |= PDRAW_DIRTY_SPRITES;\r
+  Pico.est.rendstatus |= PDRAW_DIRTY_SPRITES;\r
 }\r
 \r
 // check: Contra, Megaman\r
@@ -280,7 +280,7 @@ static void DmaFill(int data)
   // update length\r
   Pico.video.reg[0x13] = Pico.video.reg[0x14] = 0; // Dino Dini's Soccer (E) (by Haze)\r
 \r
-  rendstatus |= PDRAW_DIRTY_SPRITES;\r
+  Pico.est.rendstatus |= PDRAW_DIRTY_SPRITES;\r
 }\r
 \r
 static void CommandDma(void)\r
@@ -319,7 +319,7 @@ static void CommandChange(void)
 static void DrawSync(int blank_on)\r
 {\r
   if (Pico.m.scanline < 224 && !(PicoOpt & POPT_ALT_RENDERER) &&\r
-      !PicoSkipFrame && DrawScanline <= Pico.m.scanline) {\r
+      !PicoSkipFrame && Pico.est.DrawScanline <= Pico.m.scanline) {\r
     //elprintf(EL_ANOMALY, "sync");\r
     PicoDrawSync(Pico.m.scanline, blank_on);\r
   }\r
@@ -412,7 +412,7 @@ PICO_INTERNAL_ASM void PicoVideoWrite(unsigned int a,unsigned short d)
             goto update_irq;\r
           case 0x05:\r
             //elprintf(EL_STATUS, "spritep moved to %04x", (unsigned)(Pico.video.reg[5]&0x7f) << 9);\r
-            if (d^dold) rendstatus |= PDRAW_SPRITES_MOVED;\r
+            if (d^dold) Pico.est.rendstatus |= PDRAW_SPRITES_MOVED;\r
             break;\r
           case 0x0c:\r
             // renderers should update their palettes if sh/hi mode is changed\r