more cleanup & fix for c cpu saves
authorJavier S. Pedro <maemo@javispedro.com>
Thu, 10 Sep 2009 00:21:12 +0000 (02:21 +0200)
committerJavier S. Pedro <maemo@javispedro.com>
Thu, 10 Sep 2009 00:21:12 +0000 (02:21 +0200)
65c816ops.inc
cpuexec.cpp
debian/changelog
sa1.cpp
sa1cpu.cpp
snapshot.cpp

index e76d13c..e870def 100644 (file)
@@ -4026,9 +4026,9 @@ static void Op42 ()
 #ifdef DEBUG
        default:
                printf("Invalid Op42 branch type %hx\n", b >> 4);
-               return;\r
-       }
+               return;
 #endif\r
+       }\r
 #endif
 }
 
@@ -4260,3 +4260,4 @@ struct SOpcodes S9xOpcodesM0X1[256] =
     {OpFAX1},    {OpFB},      {OpFC},      {OpFDM0},    {OpFEM0},
     {OpFFM0}
 };
+
index 01ef7b9..40fdaf9 100644 (file)
@@ -80,7 +80,7 @@ void S9xMainLoop (void)
        char stra[64];  
        sprintf(stra,"framecpt : %d",framecpt);
        S9xMessage(0,0,stra);
-#endif 
+#endif
 
 #if CONF_BUILD_ASM_CPU
        asmMainLoop(&CPU);
@@ -137,7 +137,9 @@ void S9xMainLoop (void)
 #endif
 
     Registers.PC = CPU.PC - CPU.PCBase;
-    //S9xPackStatus (); // not needed
+#if !CONF_BUILD_ASM_CPU
+    S9xPackStatus ();
+#endif
     S9xAPUPackStatus ();
     
     if (CPU.Flags & SCAN_KEYS_FLAG)
@@ -237,17 +239,6 @@ void S9xDoHBlankProcessing ()
                        CPU.Flags |= NMI_FLAG;
                        CPU.NMICycleCount = CPU.NMITriggerPoint;
                        }
-
-       #ifdef OLD_SNAPSHOT_CODE
-                       if (CPU.Flags & SAVE_SNAPSHOT_FLAG)
-                       {
-                       CPU.Flags &= ~SAVE_SNAPSHOT_FLAG;
-                       Registers.PC = CPU.PC - CPU.PCBase;
-                       //S9xPackStatus (); // not needed
-                       S9xAPUPackStatus ();
-                       Snapshot (NULL);
-                       }
-       #endif
                        }
 
                if (CPU.V_Counter == PPU.ScreenHeight + 3)
index 7eefcb0..1bf9fce 100644 (file)
@@ -1,3 +1,11 @@
+drnoksnes (1.1.0) unstable; urgency=low
+
+  * Fixed graphic glitches in SuperFX games.
+  * Integrated C cpu core for i386 builds.
+  * SA-1 enabled for i386 using C cpu.
+
+ -- Javier S. Pedro <maemo@javispedro.com>  Thu, 10 Sep 2009 01:37:15 +0200
+
 drnoksnes (1.0.2) unstable; urgency=low
 
   * Some bugs and warnings fixed.
diff --git a/sa1.cpp b/sa1.cpp
index 7a51012..a313030 100644 (file)
--- a/sa1.cpp
+++ b/sa1.cpp
@@ -142,8 +142,10 @@ void S9xFixSA1AfterSnapshotLoad ()
     SA1.ShiftedDB = (uint32) SA1Registers.DB << 16;
 
     S9xSA1SetPCBase (SA1.ShiftedPB + SA1Registers.PC);
+#if !CONF_BUILD_ASM_SA1
     S9xSA1UnpackStatus ();
-    //S9xSA1FixCycles (); // unused
+    S9xSA1FixCycles ();
+#endif
     SA1.VirtualBitmapFormat = (Memory.FillRAM [0x223f] & 0x80) ? 2 : 4;
     Memory.BWRAM = Memory.SRAM + (Memory.FillRAM [0x2224] & 7) * 0x2000;
     S9xSA1SetBWRAMMemMap (Memory.FillRAM [0x2225]);
index cfd1b01..cbe0b50 100644 (file)
@@ -144,16 +144,16 @@ void S9xSA1MainLoop ()
 #endif
                    (*SA1.S9xOpcodes [*SA1.PC++].S9xOpcode)();
                }
+               return;
     }
-    else
 #endif
-           for (i = 0; i < 3 && SA1.Executing; i++)
-               {
+       for (i = 0; i < 3 && SA1.Executing; i++)
+       {
 #ifdef CPU_SHUTDOWN
-                       SA1.PCAtOpcodeStart = SA1.PC;
+               SA1.PCAtOpcodeStart = SA1.PC;
 #endif
-                       (*SA1.S9xOpcodes [*SA1.PC++].S9xOpcode)();
-               }
+               (*SA1.S9xOpcodes [*SA1.PC++].S9xOpcode)();
+       }
 }
 
 #endif
index cbe993c..478a400 100644 (file)
@@ -64,6 +64,8 @@
 #include "srtc.h"
 #include "sdd1.h"
 
+#define dprintf(...) /* disabled */
+
 extern uint8 *SRAM;
 
 #ifdef ZSNES_FX
@@ -659,10 +661,12 @@ static int Unfreeze()
     ICPU.ShiftedPB = Registers.PB << 16;
     ICPU.ShiftedDB = Registers.DB << 16;
     S9xSetPCBase (ICPU.ShiftedPB + Registers.PC);
-    
-    
-    //S9xUnpackStatus (); // not needed
-    //S9xFixCycles (); // also not needed?
+
+#if !CONF_BUILD_ASM_CPU
+    S9xUnpackStatus ();
+    S9xFixCycles ();
+#endif
+
     S9xReschedule ();
 #ifdef ZSNES_FX
     if (Settings.SuperFX)
@@ -890,7 +894,7 @@ int UnfreezeBlock(const char *name, uint8 *block, int size)
        strncmp (buffer, name, 3) != 0 || buffer [3] != ':' ||
        (len = atoi (&buffer [4])) == 0)
     {
-               printf("%s: %s: Invalid block header\n", __func__, name);
+               dprintf("%s: %s: Invalid block header\n", __func__, name);
                return WRONG_FORMAT;
     }
     
@@ -902,7 +906,7 @@ int UnfreezeBlock(const char *name, uint8 *block, int size)
 
     if (READ_STREAM(block, len, ss_st) != len)
     {
-               printf("%s: Invalid block\n", __func__);
+               dprintf("%s: Invalid block\n", __func__);
                return WRONG_FORMAT;
        }