]> Shamusworld >> Repos - apple2/blobdiff - src/applevideo.cpp
Changed types.h to use standard C99 types, misc. cleanups
[apple2] / src / applevideo.cpp
index 25420524fb0f202cef42b1b526c9927132e59abb..436a42d7b81893826aaa6185e32366c3c714d4e5 100755 (executable)
@@ -225,7 +225,8 @@ uint16 appleHiresToMono[0x200] = {
        0x207F, 0x387F, 0x267F, 0x3E7F, 0x21FF, 0x39FF, 0x27FF, 0x3FFF  // $Fx
 };
 
-static uint8 blurTable[0x800][8];                              // Color TV blur table
+//static uint8 blurTable[0x800][8];                            // Color TV blur table
+static uint8 blurTable[0x80][8];                               // Color TV blur table
 static uint32 * palette = (uint32 *)altColors;
 enum { ST_FIRST_ENTRY = 0, ST_COLOR_TV = 0, ST_WHITE_MONO, ST_GREEN_MONO, ST_LAST_ENTRY };
 static uint8 screenType = ST_COLOR_TV;
@@ -243,12 +244,17 @@ void SetupBlurTable(void)
        // NOTE: This table only needs to be 7 bits wide instead of 11, since the
        //       last four bits are copies of the previous four...
 
-       for(uint16 bitPat=0; bitPat<0x800; bitPat++)
+//     for(uint16 bitPat=0; bitPat<0x800; bitPat++)
+       for(uint16 bitPat=0; bitPat<0x80; bitPat++)
        {
-               uint16 w3 = bitPat & 0x888;
+/*             uint16 w3 = bitPat & 0x888;
                uint16 w2 = bitPat & 0x444;
                uint16 w1 = bitPat & 0x222;
-               uint16 w0 = bitPat & 0x111;
+               uint16 w0 = bitPat & 0x111;*/
+               uint16 w3 = bitPat & 0x88;
+               uint16 w2 = bitPat & 0x44;
+               uint16 w1 = bitPat & 0x22;
+               uint16 w0 = bitPat & 0x11;
 
                uint16 blurred3 = (w3 | (w3 >> 1) | (w3 >> 2) | (w3 >> 3)) & 0x00FF;
                uint16 blurred2 = (w2 | (w2 >> 1) | (w2 >> 2) | (w2 >> 3)) & 0x00FF;
@@ -434,6 +440,9 @@ static void Render40ColumnText(void)
 static void RenderLoRes(uint16 toLine/*= 24*/)
 {
 // NOTE: The green mono rendering doesn't skip every other line... !!! FIX !!!
+//       Also, we could set up three different Render functions depending on which
+//       render type was set and call it with a function pointer. Would be faster
+//       then the nested ifs we have now.
 /*
 Note that these colors correspond to the bit patterns generated by the numbers 0-F in order:
 Color #s correspond to the bit patterns in reverse... Interesting!
@@ -600,6 +609,7 @@ fb fb fb -> 15 [1111] -> 15         WHITE
 
 static void RenderHiRes(uint16 toLine/*= 192*/)
 {
+// NOTE: Not endian safe. !!! FIX !!!
        uint32 pixelOn = (screenType == ST_WHITE_MONO ? 0xFFFFFFFF : 0xFF61FF61);
 
        for(uint16 y=0; y<toLine; y++)