]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/blitter.cpp
Fixes for compilation against GCC 6.
[virtualjaguar] / src / blitter.cpp
index 935e84b900ef690c59902d2fcf6aac4bdf0ead31..7193daf19ca1cbaa26ebf80007a8b54dbfd6d83c 100644 (file)
@@ -7,7 +7,7 @@
 // JLH = James Hammons <jlhamm@acm.org>
 //
 // Who  When        What
-// ---  ----------  -------------------------------------------------------------
+// ---  ----------  -----------------------------------------------------------
 // JLH  01/16/2010  Created this log ;-)
 //
 
@@ -17,7 +17,6 @@
 // to Curt. ;-) Without that excellent documentation which shows *exactly*
 // what's going on inside the TOM chip, we'd all still be guessing as to how
 // the wily blitter and other pieces of the Jaguar puzzle actually work.
-// Now how about those JERRY ASIC nets gentlemen...? [We have those now!] ;-)
 //
 
 #include "blitter.h"
 #include "jaguar.h"
 #include "log.h"
 //#include "memory.h"
+#include "settings.h"
 
 // Various conditional compilation goodies...
 
 //#define LOG_BLITS
 
-//#define USE_ORIGINAL_BLITTER
+#define USE_ORIGINAL_BLITTER
 //#define USE_MIDSUMMER_BLITTER
 #define USE_MIDSUMMER_BLITTER_MKII
 
+#ifdef USE_ORIGINAL_BLITTER
+#ifdef USE_MIDSUMMER_BLITTER_MKII
+#define USE_BOTH_BLITTERS
+#endif
+#endif
+
+
 // External global variables
 
 extern int jaguar_active_memory_dumps;
@@ -1725,6 +1732,7 @@ if (blit_start_log)
        WriteLog("BLIT: Blitter started by %s...\n", whoName[who]);
        doGPUDis = true;
 }//*/
+#ifndef USE_BOTH_BLITTERS
 #ifdef USE_ORIGINAL_BLITTER
                blitter_blit(GET32(blitter_ram, 0x38));
 #endif
@@ -1734,6 +1742,14 @@ if (blit_start_log)
 #ifdef USE_MIDSUMMER_BLITTER_MKII
                BlitterMidsummer2();
 #endif
+#else
+       {
+               if (vjs.useFastBlitter)
+                       blitter_blit(GET32(blitter_ram, 0x38));
+               else
+                       BlitterMidsummer2();
+       }
+#endif
 }
 //F02278,9,A,B
 
@@ -5371,7 +5387,7 @@ Addq_x            := JOIN (addq_x, addq_x[0..5], addqt_x[6..15]);
 Addq_y         := JOIN (addq_y, addq_y[0..15]);*/
 
 ////////////////////////////////////// C++ CODE //////////////////////////////////////
-       int16_t mask[8] = { 0xFFFF, 0xFFFE, 0xFFFC, 0xFFF8, 0xFFF0, 0xFFE0, 0xFFC0, 0x0000 };
+       uint16_t mask[8] = { 0xFFFF, 0xFFFE, 0xFFFC, 0xFFF8, 0xFFF0, 0xFFE0, 0xFFC0, 0x0000 };
        addq_x = addqt_x & mask[modx];
        addq_y = addqt_y & 0xFFFF;
 //////////////////////////////////////////////////////////////////////////////////////