]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix freezer automatic rtg<>native switching.
authorToni Wilen <twilen@winuae.net>
Tue, 15 May 2018 17:13:36 +0000 (20:13 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 15 May 2018 17:13:36 +0000 (20:13 +0300)
ar.cpp
gfxboard.cpp
include/gfxboard.h

diff --git a/ar.cpp b/ar.cpp
index e45cbe1ac0faedfba1433ccf8b18c487650d62bc..7cb6f42e0389a867ae1a63dfb153be1a3b58f857 100644 (file)
--- a/ar.cpp
+++ b/ar.cpp
 #include "crc32.h"
 #include "akiko.h"
 #include "xwin.h"
+#include "gfxboard.h"
 
 #define DEBUG
 #ifdef DEBUG
@@ -270,20 +271,13 @@ static int stored_picasso_on = -1;
 
 static void cartridge_enter(void)
 {
-       struct amigadisplay *ad = &adisplays[0];
-#ifdef PICASSO96
-       stored_picasso_on = ad->picasso_requested_on;
-       ad->picasso_requested_on = 0;
-#endif
+       stored_picasso_on = gfxboard_set(0, false) ? 1 : 0;
 }
 static void cartridge_exit (void)
 {
-       struct amigadisplay *ad = &adisplays[0];
-#ifdef PICASSO96
        if (stored_picasso_on > 0)
-               ad->picasso_requested_on = 1;
+               gfxboard_set(0, true);
        stored_picasso_on = -1;
-#endif
 }
 
 static uae_u32 REGPARAM2 hrtmem3_bget (uaecptr addr)
@@ -1086,6 +1080,7 @@ void check_prefs_changed_carts (int in_memory_reset)
 
 void action_replay_reset (bool hardreset, bool keyboardreset)
 {
+       stored_picasso_on = -1;
        ar_mapped = -1;
        if (hrtmemory) {
                if (isrestore ()) {
index e73e5b6cca325832516c61ae7300672e81f877cf..4fa2e074f25a5fa11bed587df980d8bda394cf84 100644 (file)
@@ -653,6 +653,20 @@ static bool gfxboard_setmode_qemu(struct rtggfxboard *gb)
        return true;
 }
 
+bool gfxboard_set(int monid, bool rtg)
+{
+       bool r;
+       struct amigadisplay *ad = &adisplays[monid];
+       r = ad->picasso_on;
+       if (rtg) {
+               ad->picasso_requested_on = 1;
+       } else {
+               ad->picasso_requested_on = 0;
+       }
+       set_config_changed();
+       return r;
+}
+
 void gfxboard_rtg_disable(int monid, int index)
 {
        if (monid > 0)
index 7a01f1be2de236b06ff54daef6229e27beab1695..e470a433d6329d5a68023d64e5ca7db35cafe0fe 100644 (file)
@@ -31,6 +31,7 @@ extern void gfxboard_free_slot(int);
 extern bool gfxboard_rtg_enable_initial(int monid, int);
 extern void gfxboard_rtg_disable(int monid, int);
 extern bool gfxboard_init_board(struct autoconfig_info*);
+extern bool gfxboard_set(int monid, bool rtg);
 
 extern struct gfxboard_func a2410_func;
 extern struct gfxboard_func harlequin_func;