]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Warp mode boot
authorToni Wilen <twilen@winuae.net>
Thu, 9 Feb 2023 15:30:14 +0000 (17:30 +0200)
committerToni Wilen <twilen@winuae.net>
Thu, 9 Feb 2023 15:30:14 +0000 (17:30 +0200)
cfgfile.cpp
custom.cpp
include/inputdevice.h
include/options.h
inputdevice.cpp
newcpu.cpp
od-win32/resources/winuae.rc
od-win32/win32gui.cpp

index 36002b00629dd7f21f7afd6497ed0242d925895a..28b7693c7412e0300417ad26e1525a6e8fb6cd4e 100644 (file)
@@ -2916,11 +2916,13 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
                : p->keyboard_lang == KBD_LANG_IT ? _T("it")
                : _T("FOO")));
 
-       cfgfile_dwrite (f, _T("state_replay_rate"), _T("%d"), p->statecapturerate);
-       cfgfile_dwrite (f, _T("state_replay_buffers"), _T("%d"), p->statecapturebuffersize);
-       cfgfile_dwrite_bool (f, _T("state_replay_autoplay"), p->inprec_autoplay);
-       cfgfile_dwrite_bool (f, _T("warp"), p->turbo_emulation);
-       cfgfile_dwrite (f, _T("warp_limit"), _T("%d"), p->turbo_emulation_limit);
+       cfgfile_dwrite(f, _T("state_replay_rate"), _T("%d"), p->statecapturerate);
+       cfgfile_dwrite(f, _T("state_replay_buffers"), _T("%d"), p->statecapturebuffersize);
+       cfgfile_dwrite_bool(f, _T("state_replay_autoplay"), p->inprec_autoplay);
+       cfgfile_dwrite_bool(f, _T("warp"), p->turbo_emulation);
+       cfgfile_dwrite(f, _T("warp_limit"), _T("%d"), p->turbo_emulation_limit);
+       cfgfile_dwrite_bool(f, _T("warpboot"), p->turbo_boot);
+       cfgfile_dwrite(f, _T("warpboot_delay"), _T("%d"), p->turbo_boot_delay);
 
 #ifdef FILESYS
        write_filesys_config (p, f);
@@ -3555,6 +3557,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_intval (option, value, _T("sampler_buffer"), &p->sampler_buffer, 1)
                || cfgfile_intval(option, value, _T("warp_limit"), &p->turbo_emulation_limit, 1)
                || cfgfile_intval(option, value, _T("power_led_dim"), &p->power_led_dim, 1)
+               || cfgfile_intval(option, value, _T("warpboot_delay"), &p->turbo_emulation_limit, 1)
 
                || cfgfile_intval(option, value, _T("gfx_frame_slices"), &p->gfx_display_sections, 1)
                || cfgfile_intval(option, value, _T("gfx_framerate"), &p->gfx_framerate, 1)
@@ -3645,6 +3648,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_yesno(option, value, _T("gfx_autoresolution_vga"), &p->gfx_autoresolution_vga)
                || cfgfile_yesno(option, value, _T("show_refresh_indicator"), &p->refresh_indicator)
                || cfgfile_yesno(option, value, _T("warp"), &p->turbo_emulation)
+               || cfgfile_yesno(option, value, _T("warpboot"), &p->turbo_boot)
                || cfgfile_yesno(option, value, _T("headless"), &p->headless)
                || cfgfile_yesno(option, value, _T("clipboard_sharing"), &p->clipboard_sharing)
                || cfgfile_yesno(option, value, _T("native_code"), &p->native_code)
@@ -8271,6 +8275,8 @@ void default_prefs (struct uae_prefs *p, bool reset, int type)
        p->cpu_idle = 0;
        p->turbo_emulation = 0;
        p->turbo_emulation_limit = 0;
+       p->turbo_boot = 0;
+       p->turbo_boot_delay = 100;
        p->headless = 0;
        p->catweasel = 0;
        p->tod_hack = 0;
index d7d4339900b1d7384fc86b105cb324a019a0a49b..3a162419443a5c505ad883fa15ead8ce72a38d83 100644 (file)
@@ -7701,6 +7701,9 @@ static void DMACON(int hpos, uae_u16 v)
 
        int oldcop = (oldcon & DMA_COPPER) && (oldcon & DMA_MASTER);
        int newcop = (dmacon & DMA_COPPER) && (dmacon & DMA_MASTER);
+       if (!oldcop && newcop) {
+               bootwarpmode();
+       }
        if (oldcop != newcop && (copper_access || safecpu())) {
                copper_dma_change_cycle = get_cycles();
        }
index 5ab1cc2133e2b582d7ba935490a756c82c238d8f..e8c7dd660f6e79d292d0b3a4bc355ed0bfd202a9 100644 (file)
@@ -311,8 +311,9 @@ extern void inputdevice_releasebuttons(void);
 
 extern void indicator_leds (int num, int state);
 
-extern void warpmode (int mode);
-extern void pausemode (int mode);
+extern void warpmode(int mode);
+extern void bootwarpmode(void);
+extern void pausemode(int mode);
 
 extern void inputdevice_add_inputcode (int code, int state, const TCHAR *);
 extern void inputdevice_handle_inputcode (void);
index 151ba12099733e9d37ea943ea79cb15969c15f2e..102b4e496ec90b2c572ba194c952e64b39429914 100644 (file)
@@ -649,6 +649,8 @@ struct uae_prefs {
        bool rom_readwrite;
        int turbo_emulation;
        int turbo_emulation_limit;
+       bool turbo_boot;
+       int turbo_boot_delay;
        bool headless;
        int filesys_limit;
        int filesys_max_name;
index 191673e428c21ee875b5c3e36f92b5bdc59d8727..adab6f75f3fee9eb0b36167a5d9f8d5dbe6a202e 100644 (file)
@@ -5537,6 +5537,14 @@ void inputdevice_vsync (void)
                }
        }
        inputdevice_checkconfig ();
+
+       if (currprefs.turbo_emulation > 2) {
+               currprefs.turbo_emulation--;
+               changed_prefs.turbo_emulation = currprefs.turbo_emulation;
+               if (currprefs.turbo_emulation == 2) {
+                       warpmode(0);
+               }
+       }
 }
 
 void inputdevice_reset (void)
@@ -9381,30 +9389,28 @@ int getmousestate (int joy)
        return mice[joy].enabled;
 }
 
-void warpmode (int mode)
+void bootwarpmode(void)
 {
-       int fr, fr2;
-
-       fr = currprefs.gfx_framerate;
-       if (fr == 0)
-               fr = -1;
-       fr2 = currprefs.turbo_emulation;
-       if (fr2 == -1)
-               fr2 = 0;
+       if (currprefs.turbo_emulation == 2) {
+               currprefs.turbo_emulation = changed_prefs.turbo_emulation = 2 + currprefs.turbo_boot_delay;
+       }
+}
 
+void warpmode(int mode)
+{
        if (mode < 0) {
                if (currprefs.turbo_emulation) {
-                       changed_prefs.gfx_framerate = currprefs.gfx_framerate = fr2;
+                       changed_prefs.gfx_framerate = currprefs.gfx_framerate = 1;
                        currprefs.turbo_emulation = 0;
                } else {
-                       currprefs.turbo_emulation = fr;
+                       currprefs.turbo_emulation = 1;
                }
        } else if (mode == 0 && currprefs.turbo_emulation) {
                if (currprefs.turbo_emulation > 0)
-                       changed_prefs.gfx_framerate = currprefs.gfx_framerate = fr2;
+                       changed_prefs.gfx_framerate = currprefs.gfx_framerate = 1;
                currprefs.turbo_emulation = 0;
        } else if (mode > 0 && !currprefs.turbo_emulation) {
-               currprefs.turbo_emulation = fr;
+               currprefs.turbo_emulation = 1;
        }
        if (currprefs.turbo_emulation) {
                if (!currprefs.cpu_memory_cycle_exact && !currprefs.blitter_cycle_exact)
index b4251711082a786d1b245b69c517667abb19cf45..5384df135d42debe79afe8c0f6c856060818b0df 100644 (file)
@@ -6539,6 +6539,13 @@ void m68k_go (int may_quit)
                        mman_set_barriers(false);
                        protect_roms(true);
                }
+               if ((cpu_keyboardreset || hardboot) && !restored) {
+                       if (currprefs.turbo_boot) {
+                               warpmode(1);
+                               currprefs.turbo_emulation = changed_prefs.turbo_emulation = 2;
+
+                       }
+               }
                cpu_hardreset = false;
                cpu_keyboardreset = false;
                hardboot = 0;
index dd52ae8777e86265b8eec8791ce8b788a88767b4..94db7f82358a2c3dae46874d43045f697693615b 100644 (file)
@@ -2176,7 +2176,7 @@ END
 
 STRINGTABLE
 BEGIN
-    IDS_MISCLISTITEMS4      "Windows shutdown/logoff notification\nWarn when attempting to close window\nPower led dims when audio filter is disabled\nAutomatically capture mouse when window is activated\nDebug memory space\nForce hard reset if CPU halted\nA600/A1200/A4000 IDE scsi.device disable\n"
+    IDS_MISCLISTITEMS4      "Windows shutdown/logoff notification\nWarn when attempting to close window\nPower led dims when audio filter is disabled\nAutomatically capture mouse when window is activated\nDebug memory space\nForce hard reset if CPU halted\nA600/A1200/A4000 IDE scsi.device disable\nWarp mode reset\n"
     IDS_SHUTDOWN_NOTIFICATION "Emulation session active"
     IDS_QUIT_WARNING        "Are you sure you want to quit WinUAE?"
     IDS_UNMAPPED_ADDRESS    "Floating\nAll zeros\nAll ones\n"
index 53cc3956c52e33010ccb50d5c165b89fd6841f52..14788ec794149afcee3f10e47ef5660804e61384 100644 (file)
@@ -4718,6 +4718,7 @@ static const struct miscentry misclist[] = {
        { 0, 0, _T("Debug memory space"), &workprefs.debug_mem },
        { 0, 1, _T("Force hard reset if CPU halted"), &workprefs.crash_auto_reset },
        { 0, 0, _T("A600/A1200/A4000 IDE scsi.device disable"), &workprefs.scsidevicedisable },
+       { 0, 1, _T("Warp mode reset"), &workprefs.turbo_boot },
        { 0, 0, NULL }
 };