workaround a problem with the harmattan gcc
[drnoksnes] / gfx.cpp
diff --git a/gfx.cpp b/gfx.cpp
index f5992dc..45e5dce 100644 (file)
--- a/gfx.cpp
+++ b/gfx.cpp
@@ -46,7 +46,6 @@
 #include "memmap.h"
 #include "ppu.h"
 #include "cpuexec.h"
-#include "display.h"
 #include "gfx.h"
 #include "apu.h"
 #include "cheats.h"
@@ -107,7 +106,7 @@ extern uint8  Mode7Depths [2];
 
 #define BLACK BUILD_PIXEL(0,0,0)
 
-bool8_32 S9xGraphicsInit ()
+bool8 S9xGraphicsInit ()
 {
     register uint32 PixelOdd = 1;
     register uint32 PixelEven = 2;
@@ -221,8 +220,6 @@ bool8_32 S9xGraphicsInit ()
        DrawHiResClippedTilePtr = DrawHiResClippedTile16;
     S9xFixColourBrightness();
 
-    if (Settings.SixteenBit)
-    {
        if (!(GFX.X2 = (uint16 *) malloc (sizeof (uint16) * 0x10000)))
            return (FALSE);
 
@@ -369,15 +366,8 @@ bool8_32 S9xGraphicsInit ()
                }
            }
        }
-    }
-    else
-    {
-       GFX.X2 = NULL;
-       GFX.ZERO_OR_X2 = NULL;
-       GFX.ZERO = NULL;
-    }
 
-    return (TRUE);
+    return TRUE;
 }
 
 void S9xGraphicsDeinit (void)
@@ -497,24 +487,7 @@ void S9xEndScreenRefresh()
                IPPU.RenderedFramesCount++;
 
                if (IPPU.ColorsChanged) {
-                       uint32 saved = PPU.CGDATA[0];
-
-                       if (!Settings.SixteenBit) {
-                               // Hack for Super Mario World - to get its sky blue
-                               // (It uses Fixed colour addition on the backdrop colour)
-                               if (!(Memory.FillRAM [0x2131] & 0x80) &&
-                                       (Memory.FillRAM[0x2131] & 0x20) &&
-                                       (PPU.FixedColourRed || PPU.FixedColourGreen ||
-                                        PPU.FixedColourBlue)) {
-                                       PPU.CGDATA[0] = PPU.FixedColourRed |
-                                                       (PPU.FixedColourGreen << 5) |
-                                                       (PPU.FixedColourBlue << 10);
-                               }
-                       }
-
                        IPPU.ColorsChanged = FALSE;
-                   S9xSetPalette();
-                       PPU.CGDATA[0] = saved;
                }
 
                if (Settings.DisplayFrameRate) {
@@ -525,9 +498,7 @@ void S9xEndScreenRefresh()
                        S9xDisplayString(GFX.InfoString);
                }
 
-               S9xDeinitUpdate(
-                       IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight,
-                       Settings.SixteenBit);
+               S9xDeinitUpdate(IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight);
     }
 
 #ifndef RC_OPTIMIZED
@@ -584,7 +555,7 @@ void S9xSetInfoString (const char * fmt, ...)
     va_end(ap);
 }
 
-INLINE void SelectTileRenderer (bool8_32 normal)
+static inline void SelectTileRenderer (bool normal)
 {
     if (normal)
     {
@@ -710,7 +681,7 @@ void S9xSetupOBJ ()
     IPPU.OBJChanged = FALSE;
 }
 
-void DrawOBJS (bool8_32 OnMain = FALSE, uint8 D = 0)
+static void DrawOBJS (bool OnMain = FALSE, uint8 D = 0)
 {
        uint32 O;
     uint32 BaseTile, Tile;
@@ -862,7 +833,7 @@ void DrawOBJS (bool8_32 OnMain = FALSE, uint8 D = 0)
     }
 }
 
-void DrawBackgroundMosaic (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
+static void DrawBackgroundMosaic (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
 {
     CHECK_SOUND();
 
@@ -1073,7 +1044,7 @@ void DrawBackgroundMosaic (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
     }
 }
 
-void DrawBackgroundOffset (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
+static void DrawBackgroundOffset (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
 {
     CHECK_SOUND();
 
@@ -1201,7 +1172,7 @@ void DrawBackgroundOffset (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
            uint32 MaxCount = 8;
 
            uint32 s = Left * GFX_PIX_SIZE + Y * GFX.PPL;
-           bool8_32 left_hand_edge = (Left == 0);
+           bool left_hand_edge = (Left == 0);
            Width = Right - Left;
 
            if (Left & 7)
@@ -1216,7 +1187,7 @@ void DrawBackgroundOffset (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
                    // for the tile at the left-hand edge of the screen.
                    VOffset = LineData [Y].BG[bg].VOffset;
                                        HOffset = LineHOffset;
-                   left_hand_edge = FALSE;
+                   left_hand_edge = false;
                }
                else
                {
@@ -1354,7 +1325,7 @@ void DrawBackgroundOffset (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
     }
 }
 
-void DrawBackgroundMode5 (uint32 /* BGMODE */, uint32 bg, uint8 Z1, uint8 Z2)
+static void DrawBackgroundMode5 (uint32 /*BGMODE*/, uint32 bg, uint8 Z1, uint8 Z2)
 {
     CHECK_SOUND();
 
@@ -1663,7 +1634,7 @@ void DrawBackgroundMode5 (uint32 /* BGMODE */, uint32 bg, uint8 Z1, uint8 Z2)
     }
 }
 
-void DrawBackground (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
+static void DrawBackground (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
 {
     BG.TileSize = BGSizes [PPU.BG[bg].BGSize];
     BG.BitShift = BitShifts[BGMode][bg];
@@ -2206,18 +2177,12 @@ void DrawBackground (uint32 BGMode, uint32 bg, uint8 Z1, uint8 Z2)
     RENDER_BACKGROUND_MODE7_LINE(TYPE,FUNC) \
 \
 
-
-void DrawBGMode7Background (uint8 *Screen, int bg)
-{
-    RENDER_BACKGROUND_MODE7 (uint8, (uint8) (b & bmask))
-}
-
-void DrawBGMode7Background16 (uint8 *Screen, int bg)
+static void DrawBGMode7Background16 (uint8 *Screen, int bg)
 {
     RENDER_BACKGROUND_MODE7 (uint16, GFX.ScreenColors [b & bmask]);
 }
 
-void DrawBGMode7Background16Add (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Add (uint8 *Screen, int bg)
 {
     RENDER_BACKGROUND_MODE7 (uint16, *(d + GFX.DepthDelta) ?
                                        (*(d + GFX.DepthDelta) != 1 ?
@@ -2228,7 +2193,7 @@ void DrawBGMode7Background16Add (uint8 *Screen, int bg)
                                         GFX.ScreenColors [b & bmask]);
 }
 
-void DrawBGMode7Background16Add1_2 (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Add1_2 (uint8 *Screen, int bg)
 {
     RENDER_BACKGROUND_MODE7 (uint16, *(d + GFX.DepthDelta) ?
                                        (*(d + GFX.DepthDelta) != 1 ?
@@ -2239,7 +2204,7 @@ void DrawBGMode7Background16Add1_2 (uint8 *Screen, int bg)
                                         GFX.ScreenColors [b & bmask]);
 }
 
-void DrawBGMode7Background16Sub (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Sub (uint8 *Screen, int bg)
 {
     RENDER_BACKGROUND_MODE7 (uint16, *(d + GFX.DepthDelta) ?
                                        (*(d + GFX.DepthDelta) != 1 ?
@@ -2250,7 +2215,7 @@ void DrawBGMode7Background16Sub (uint8 *Screen, int bg)
                                         GFX.ScreenColors [b & bmask]);
 }
 
-void DrawBGMode7Background16Sub1_2 (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Sub1_2 (uint8 *Screen, int bg)
 {
     RENDER_BACKGROUND_MODE7 (uint16, *(d + GFX.DepthDelta) ?
                                        (*(d + GFX.DepthDelta) != 1 ?
@@ -2287,12 +2252,12 @@ void DrawBGMode7Background16Sub1_2 (uint8 *Screen, int bg)
     Screen += GFX.StartY * GFX.Pitch; \
     uint8 *Depth = GFX.DB + GFX.StartY * GFX.PPL; \
     struct SLineMatrixData *l = &LineMatrixData [GFX.StartY]; \
-    bool8_32 allowSimpleCase = FALSE; \
+    bool allowSimpleCase = false; \
     if (!l->MatrixB && !l->MatrixC && (l->MatrixA == 0x0100) && (l->MatrixD == 0x0100) \
         && !LineMatrixData[GFX.EndY].MatrixB && !LineMatrixData[GFX.EndY].MatrixC \
         && (LineMatrixData[GFX.EndY].MatrixA == 0x0100) && (LineMatrixData[GFX.EndY].MatrixD == 0x0100) \
         ) \
-        allowSimpleCase = TRUE;  \
+        allowSimpleCase = true;  \
     \
     for (uint32 Line = GFX.StartY; Line <= GFX.EndY; Line++, Screen += GFX.Pitch, Depth += GFX.PPL, l++) \
     { \
@@ -2313,7 +2278,7 @@ void DrawBGMode7Background16Sub1_2 (uint8 *Screen, int bg)
            yy += (VOffset - CentreY) % 1023; \
        else \
            yy += VOffset - CentreY; \
-        bool8_32 simpleCase = FALSE; \
+        bool simpleCase = false; \
         int BB; \
         int DD; \
         /* Make a special case for the identity matrix, since it's a common case and */ \
@@ -2322,7 +2287,7 @@ void DrawBGMode7Background16Sub1_2 (uint8 *Screen, int bg)
         { \
             BB = CentreX << 8; \
             DD = (yy + CentreY) << 8; \
-            simpleCase = TRUE; \
+            simpleCase = true; \
         } \
         else \
         { \
@@ -2637,7 +2602,7 @@ void DrawBGMode7Background16Sub1_2 (uint8 *Screen, int bg)
         } \
     }
 
-STATIC uint32 Q_INTERPOLATE(uint32 A, uint32 B, uint32 C, uint32 D)
+static inline uint32 Q_INTERPOLATE(uint32 A, uint32 B, uint32 C, uint32 D)
 {
     register uint32 x = ((A >> 2) & HIGH_BITS_SHIFTED_TWO_MASK) +
                             ((B >> 2) & HIGH_BITS_SHIFTED_TWO_MASK) +
@@ -2651,12 +2616,12 @@ STATIC uint32 Q_INTERPOLATE(uint32 A, uint32 B, uint32 C, uint32 D)
     return x+y;
 }
 
-void DrawBGMode7Background16_i (uint8 *Screen, int bg)
+static void DrawBGMode7Background16_i (uint8 *Screen, int bg)
 {
     RENDER_BACKGROUND_MODE7_i (uint16, theColor, (GFX.ScreenColors[b & GFX.Mode7Mask]));
 }
 
-void DrawBGMode7Background16Add_i (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Add_i (uint8 *Screen, int bg)
 {
     RENDER_BACKGROUND_MODE7_i (uint16, *(d + GFX.DepthDelta) ?
                                        (*(d + GFX.DepthDelta) != 1 ?
@@ -2667,7 +2632,7 @@ void DrawBGMode7Background16Add_i (uint8 *Screen, int bg)
                                         theColor, (GFX.ScreenColors[b & GFX.Mode7Mask]));
 }
 
-void DrawBGMode7Background16Add1_2_i (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Add1_2_i (uint8 *Screen, int bg)
 {
     RENDER_BACKGROUND_MODE7_i (uint16, *(d + GFX.DepthDelta) ?
                                        (*(d + GFX.DepthDelta) != 1 ?
@@ -2678,7 +2643,7 @@ void DrawBGMode7Background16Add1_2_i (uint8 *Screen, int bg)
                                         theColor, (GFX.ScreenColors[b & GFX.Mode7Mask]));
 }
 
-void DrawBGMode7Background16Sub_i (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Sub_i (uint8 *Screen, int bg)
 {
     RENDER_BACKGROUND_MODE7_i (uint16, *(d + GFX.DepthDelta) ?
                                        (*(d + GFX.DepthDelta) != 1 ?
@@ -2689,7 +2654,7 @@ void DrawBGMode7Background16Sub_i (uint8 *Screen, int bg)
                                         theColor, (GFX.ScreenColors[b & GFX.Mode7Mask]));
 }
 
-void DrawBGMode7Background16Sub1_2_i (uint8 *Screen, int bg)
+static void DrawBGMode7Background16Sub1_2_i (uint8 *Screen, int bg)
 {
     RENDER_BACKGROUND_MODE7_i (uint16, *(d + GFX.DepthDelta) ?
                                        (*(d + GFX.DepthDelta) != 1 ?
@@ -2734,13 +2699,9 @@ TWO_LOW_BITS_MASK = RGB_LOW_BITS_MASK | (RGB_LOW_BITS_MASK << 1); \
 HIGH_BITS_SHIFTED_TWO_MASK = (( (FIRST_COLOR_MASK | SECOND_COLOR_MASK | THIRD_COLOR_MASK) & \
                                 ~TWO_LOW_BITS_MASK ) >> 2);
 
-void RenderScreen (uint8 *Screen, bool8_32 sub, bool8_32 force_no_add, uint8 D)
+static void RenderScreen(uint8 *Screen, bool sub, bool force_no_add, uint8 D)
 {
-    bool8_32 BG0;
-    bool8_32 BG1;
-    bool8_32 BG2;
-    bool8_32 BG3;
-    bool8_32 OB;
+    bool BG0, BG1, BG2, BG3, OB;
 
     GFX.S = Screen;
 
@@ -2893,10 +2854,7 @@ static void DisplayChar(uint8 *Screen, uint8 c)
 {
     int line = (((c & 0x7f) - 32) >> 4) * font_height;
     int offset = (((c & 0x7f) - 32) & 15) * font_width;
-#ifndef _SNESPPC
-    if (Settings.SixteenBit)
-#endif
-    {
+
        int h, w;
        uint16 *s = (uint16 *) Screen;
        for (h = 0; h < font_height; h++, line++,
@@ -2913,39 +2871,15 @@ static void DisplayChar(uint8 *Screen, uint8 c)
                    *s = BLACK;
            }
        }
-    }
-#ifndef _SNESPPC
-    else
-    {
-       int h, w;
-       uint8 *s = Screen;
-       for (h = 0; h < font_height; h++, line++,
-            s += GFX.PPL - font_width)
-       {
-           for (w = 0; w < font_width; w++, s++)
-           {
-               uint8 p = font [line][offset + w];
-
-               if (p == '#')
-                   *s = 255;
-               else
-               if (p == '.')
-                   *s = BLACK;
-           }
-       }
-    }
-#endif
 }
 
 static void S9xDisplayFrameRate()
 {
+    const unsigned int char_width = (font_width - 1) * sizeof (uint16);
        uint8 *Screen = GFX.Screen + 2 +
                (IPPU.RenderedScreenHeight - font_height - 1) * GFX.Pitch;
        char string[12];
     int len;
-    const unsigned int char_width = Settings.SixteenBit ? 
-                               (font_width - 1) * sizeof (uint16) : 
-                               (font_width - 1);
 
        if (Settings.TurboMode) {
                len = sprintf(string, "%u",
@@ -2964,6 +2898,7 @@ static void S9xDisplayFrameRate()
 
 static void S9xDisplayString(const char *string)
 {
+    const unsigned int char_width = (font_width - 1) * sizeof (uint16);
     uint8 *Screen = GFX.Screen + 2 +
                    (IPPU.RenderedScreenHeight - font_height * 5) * GFX.Pitch;
     int len = strlen (string);
@@ -2975,9 +2910,7 @@ static void S9xDisplayString(const char *string)
     {
        if (char_count >= max_chars || string [i] < 32)
        {
-           Screen -= Settings.SixteenBit ? 
-                       (font_width - 1) * sizeof (uint16) * max_chars :
-                       (font_width - 1) * max_chars;
+           Screen -= char_width * max_chars;
            Screen += font_height * GFX.Pitch;
            if (Screen >= GFX.Screen + GFX.Pitch * IPPU.RenderedScreenHeight)
                break;
@@ -2986,8 +2919,7 @@ static void S9xDisplayString(const char *string)
        if (string [i] < 32)
            continue;
        DisplayChar (Screen, string [i]);
-       Screen += Settings.SixteenBit ? (font_width - 1) * sizeof (uint16) : 
-                 (font_width - 1);
+       Screen += char_width;
     }
 }
 
@@ -3050,27 +2982,15 @@ void S9xUpdateScreen () // ~30-50ms! (called from FLUSH_REDRAW())
                if (!IPPU.DoubleWidthPixels) {
                        // The game has switched from lo-res to hi-res mode part way down
                        // the screen. Scale any existing lo-res pixels on screen
-                       if (Settings.SixteenBit) {
-                               for (register uint32 y = 0; y < GFX.StartY; y++) {
-                                       register uint16 *p =
-                                               (uint16 *) (GFX.Screen + y * GFX.Pitch) + 255;
-                                       register uint16 *q =
-                                               (uint16 *) (GFX.Screen + y * GFX.Pitch) + 510;
-                                       for (register int x = 255; x >= 0; x--, p--, q -= 2) {
-                                               *q = *(q + 1) = *p;
-                                       }
+                       for (register uint32 y = 0; y < GFX.StartY; y++) {
+                               register uint16 *p =
+                                       (uint16 *) (GFX.Screen + y * GFX.Pitch) + 255;
+                               register uint16 *q =
+                                       (uint16 *) (GFX.Screen + y * GFX.Pitch) + 510;
+                               for (register int x = 255; x >= 0; x--, p--, q -= 2) {
+                                       *q = *(q + 1) = *p;
                                }
-                   } else {
-                               for (register uint32 y = 0; y < GFX.StartY; y++) {
-                                       register uint8 *p =
-                                               GFX.Screen + y * GFX.Pitch + 255;
-                                       register uint8 *q =
-                                               GFX.Screen + y * GFX.Pitch + 510;
-                                       for (register int x = 255; x >= 0; x--, p--, q -= 2) {
-                                               *q = *(q + 1) = *p;
-                                       }
-                               }
-                   }
+                       }
 
                        IPPU.DoubleWidthPixels = TRUE;
                }
@@ -3080,7 +3000,7 @@ void S9xUpdateScreen () // ~30-50ms! (called from FLUSH_REDRAW())
     uint32 black = BLACK | (BLACK << 16);
 
        // Are we worrying about transparencies?
-    if (Settings.Transparency && Settings.SixteenBit)
+    if (Settings.Transparency)
     {
                if (GFX.Pseudo)
                {
@@ -3651,57 +3571,39 @@ void S9xUpdateScreen () // ~30-50ms! (called from FLUSH_REDRAW())
     }
     else // Transparencys are disabled, ahh lovely ... nice and easy.
        {
-#ifndef _SNESPPC
-               if (Settings.SixteenBit)
-#endif
+           // get back colour to be used in clearing the screen
+               register uint32 back;
+               if (!(Memory.FillRAM [0x2131] & 0x80) &&(Memory.FillRAM[0x2131] & 0x20) &&
+                               (PPU.FixedColourRed || PPU.FixedColourGreen || PPU.FixedColourBlue))
                {
-                   // get back colour to be used in clearing the screen
-                       register uint32 back;
-                       if (!(Memory.FillRAM [0x2131] & 0x80) &&(Memory.FillRAM[0x2131] & 0x20) &&
-                                       (PPU.FixedColourRed || PPU.FixedColourGreen || PPU.FixedColourBlue))
-                       {
-                               back = (IPPU.XB[PPU.FixedColourRed]<<11) |
-                                          (IPPU.XB[PPU.FixedColourGreen] << 6) | 
-                                          (IPPU.XB[PPU.FixedColourBlue] << 1) | 1;
-                               back = (back << 16) | back;
-                       }
-                       else
-                       {
-                               back = IPPU.ScreenColors [0] | (IPPU.ScreenColors [0] << 16);
-                       }
-    
-                   // if Forcedblanking in use then back colour becomes black
-                       if (PPU.ForcedBlanking)
-                               back = black;
-                   else
-                       {
-                               SelectTileRenderer (TRUE);  //selects the tile renderers to be used
-                                                                                       // TRUE means to use the default
-                                                                                       // FALSE means use best renderer based on current
-                                                                                       // graphics register settings
-                       }
-                   
-                       // now clear all graphics lines which are being updated using the back colour
-                       for (register uint32 y = starty; y <= endy; y++)
-                   {
-                               memset32 ((uint32_t*)(GFX.Screen + y * GFX.Pitch), back,
-                                       IPPU.RenderedScreenWidth>>1);
-                   }
+                       back = (IPPU.XB[PPU.FixedColourRed]<<11) |
+                                  (IPPU.XB[PPU.FixedColourGreen] << 6) |
+                                  (IPPU.XB[PPU.FixedColourBlue] << 1) | 1;
+                       back = (back << 16) | back;
                }
-#ifndef _SNESPPC
-               else // Settings.SixteenBit == false
+               else
                {
-                   // because we are in 8 bit we can just use 0 to clear the screen
-                       // this means we can use the Zero Memory function
-                       
-                       // Loop through all lines being updated and clear the pixels to 0
-                       for (uint32 y = starty; y <= endy; y++)
-                   {
-                       ZeroMemory (GFX.Screen + y * GFX.Pitch,
-                                   IPPU.RenderedScreenWidth);
-                   }
+                       back = IPPU.ScreenColors [0] | (IPPU.ScreenColors [0] << 16);
                }
-#endif
+
+               // if Forcedblanking in use then back colour becomes black
+               if (PPU.ForcedBlanking)
+                       back = black;
+               else
+               {
+                       SelectTileRenderer (TRUE);  //selects the tile renderers to be used
+                                                                               // TRUE means to use the default
+                                                                               // FALSE means use best renderer based on current
+                                                                               // graphics register settings
+               }
+
+               // now clear all graphics lines which are being updated using the back colour
+               for (register uint32 y = starty; y <= endy; y++)
+               {
+                       memset32 ((uint32_t*)(GFX.Screen + y * GFX.Pitch), back,
+                               IPPU.RenderedScreenWidth>>1);
+               }
+
                if (!PPU.ForcedBlanking)
                {
                        // Loop through all lines being updated and clear the
@@ -3815,12 +3717,6 @@ else \
                                        bg = 0;
                                    }
 
-#ifndef _SNESPPC
-                                   if (!Settings.SixteenBit)
-                                       DrawBGMode7Background (GFX.Screen, bg);
-                                   else
-#endif
-                                   {
                                        if (!Settings.Mode7Interpolate)
                                        {       
                                            DrawBGMode7Background16 (GFX.Screen, bg);
@@ -3829,7 +3725,6 @@ else \
                                        {       
                                            DrawBGMode7Background16_i (GFX.Screen, bg);
                                        }
-                                 }
                                }
                    }
                }
@@ -3841,10 +3736,6 @@ else \
        {
            // Mixure of background modes used on screen - scale width
            // of all non-mode 5 and 6 pixels.
-#ifndef _SNESPPC
-               if (Settings.SixteenBit)
-#endif
-           {
                for (register uint32 y = GFX.StartY; y <= GFX.EndY; y++)
                {
                    register uint16 *p = (uint16 *) (GFX.Screen + y * GFX.Pitch) + 255;
@@ -3852,19 +3743,6 @@ else \
                    for (register int x = 255; x >= 0; x--, p--, q -= 2)
                        *q = *(q + 1) = *p;
                }
-           }
-#ifndef _SNESPPC
-           else
-           {
-               for (register uint32 y = GFX.StartY; y <= GFX.EndY; y++)
-               {
-                   register uint8 *p = GFX.Screen + y * GFX.Pitch + 255;
-                   register uint8 *q = GFX.Screen + y * GFX.Pitch + 510;
-                   for (register int x = 255; x >= 0; x--, p--, q -= 2)
-                       *q = *(q + 1) = *p;
-               }
-           }
-#endif
        }
 
        if (IPPU.LatchedInterlace)
@@ -3907,7 +3785,7 @@ _BUILD_PIXEL(GBR565)
 _BUILD_PIXEL(GBR555)
 _BUILD_PIXEL(RGB5551)
 
-bool8_32 S9xSetRenderPixelFormat (int format)
+bool8 S9xSetRenderPixelFormat (int format)
 {
     extern uint32 current_graphic_format;