]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
spinlock updates.
authorToni Wilen <twilen@winuae.net>
Sun, 7 Sep 2014 09:32:49 +0000 (12:32 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 7 Sep 2014 09:32:49 +0000 (12:32 +0300)
custom.cpp
events.cpp
include/uae/ppc.h
newcpu.cpp
ppc/ppc.cpp

index 383a92c1e24e69112fc8d00dd71d023c4f12b9ca..3362c4ef00769df6e05b863b44e5b5cefcb13121 100644 (file)
@@ -7701,7 +7701,7 @@ static void hsync_handler_post (bool onvsync)
                        } else {
                                vsyncmintime = vsyncmaxtime; /* emulate if still time left */
                                is_syncline_end = read_processor_time () + vsynctimebase; /* far enough in future, we never wait that long */
-                               is_syncline = 1;
+                               is_syncline = 2;
                        }
                } else {
                        static int linecounter;
index e847b341618d359dc00642af266580ea576428fe..e12a97bbe812dd585b6ad3a0256a34dc60d29c61 100644 (file)
@@ -70,7 +70,12 @@ void do_cycles_slow (unsigned long cycles_to_add)
 #ifdef WITH_PPC
                                                if (regs.halted < 0) {
 
-                                                       uae_ppc_execute_quick();
+                                                       if (is_syncline == 1) {
+                                                               uae_ppc_execute_quick(0);
+                                                       } else {
+                                                               uae_ppc_execute_quick(1);
+                                                               pissoff = pissoff_value;
+                                                       }
 
                                                } else {
 #endif
@@ -90,8 +95,7 @@ void do_cycles_slow (unsigned long cycles_to_add)
 #ifdef WITH_PPC
                                                if (regs.halted < 0) {
 
-                                                       if (v < -vsynctimebase / 20)
-                                                               uae_ppc_execute_quick();
+                                                       uae_ppc_execute_quick(0);
 
                                                } else {
 #endif
index cbdd8ccf6869789e65ae0d8152c22f177e93de10..58346f5bd6468be371276737e17dd738e6aa7d0e 100644 (file)
@@ -41,7 +41,7 @@ void uae_ppc_reset(bool hardreset);
 void uae_ppc_hsync_handler(void);
 void uae_ppc_wakeup(void);
 
-void uae_ppc_execute_quick(void);
+void uae_ppc_execute_quick(int linetype);
 void uae_ppc_spinlock_reset(void);
 void uae_ppc_spinlock_get(void);
 void uae_ppc_spinlock_release(void);
index 3cf5763fae7a61b847590a020cff0e09b9b3463e..a64044e2f6a3ca66e9c52364c891b39acda955d4 100644 (file)
@@ -3223,6 +3223,12 @@ STATIC_INLINE bool time_for_interrupt (void)
 
 void doint (void)
 {
+#ifdef WITH_PPC
+       if (ppc_state) {
+               if (!ppc_interrupt(intlev()))
+                       return;
+       }
+#endif
        if (m68k_interrupt_delay) {
                regs.ipl_pin = intlev ();
                unset_special (SPCFLAG_INT);
index 0f3efd844230efe0090c203b7306ac285c83b1e8..165af8861e310b57a98d16079fd5f52840edee06 100644 (file)
 
 #include "uae/ppc.h"
 
-#define PPC_DEBUG_ADDR_FROM 0xf00000
-#define PPC_DEBUG_ADDR_TO   0xf40000
+#define PPC_SYNC_WRITE 0
+#define PPC_ACCESS_LOG 0
+
+#define PPC_DEBUG_ADDR_FROM 0x000000
+#define PPC_DEBUG_ADDR_TO   0xffffff
 
 #ifdef WITH_PEARPC_CPU
 #include "pearpc/cpu/cpu.h"
@@ -22,9 +25,6 @@
 #include "pearpc/cpu/cpu_generic/ppc_cpu.h"
 #endif
 
-#define PPC_SYNC_WRITE 0
-#define PPC_ACCESS_LOG 0
-
 #define TRACE(format, ...) write_log(_T("PPC: ---------------- ") format, ## __VA_ARGS__)
 
 
@@ -343,11 +343,18 @@ bool uae_ppc_to_main_thread(void)
        return true;
 }
 
-void uae_ppc_execute_quick(void)
+void uae_ppc_execute_quick(int linetype)
 {
-       uae_ppc_spinlock_release();
-       sleep_millis(1);
-       uae_ppc_spinlock_get();
+       if (linetype == 0) {
+               for (int i = 0; i < 2; i++) {
+                       uae_ppc_spinlock_release();
+                       uae_ppc_spinlock_get();
+               }
+       } else {
+               uae_ppc_spinlock_release();
+               sleep_millis(1);
+               uae_ppc_spinlock_get();
+       }
 }
 
 void uae_ppc_emulate(void)
@@ -362,13 +369,6 @@ void uae_ppc_emulate(void)
                g_ppc_cpu_run_single(10);
 }
 
-static bool ppc_safe_addr(uaecptr addr)
-{
-       if (addr >= 0x08000000 && addr < 0x10000000)
-               return true;
-       return false;
-}
-
 bool uae_ppc_poll_queue(void)
 {
        if (!ppc_io_pipe)
@@ -546,7 +546,7 @@ bool UAECALL uae_ppc_io_mem_read(uint32_t addr, uint32_t *data, int size)
 
 #if PPC_ACCESS_LOG > 0
        if (!ppc_io_pipe && !valid_address(addr, size)) {
-               if (addr >= PPC_DEBUG_ADDR_FROM && addr < PPC_DEBUG_ADDR_TO)
+               if (addr >= PPC_DEBUG_ADDR_FROM && addr < PPC_DEBUG_ADDR_TO && addr != 0xdff006)
                        write_log(_T("PPC io read %08x=%08x %d\n"), addr, v, size);
        }
 #endif