From: Toni Wilen Date: Thu, 9 Feb 2023 15:30:14 +0000 (+0200) Subject: Warp mode boot X-Git-Tag: 5.0.0~159 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=6112ed094029a149f4d82deedc473c7a34492a52;p=francis%2Fwinuae.git Warp mode boot --- diff --git a/cfgfile.cpp b/cfgfile.cpp index 36002b00..28b7693c 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -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; diff --git a/custom.cpp b/custom.cpp index d7d43399..3a162419 100644 --- a/custom.cpp +++ b/custom.cpp @@ -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(); } diff --git a/include/inputdevice.h b/include/inputdevice.h index 5ab1cc21..e8c7dd66 100644 --- a/include/inputdevice.h +++ b/include/inputdevice.h @@ -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); diff --git a/include/options.h b/include/options.h index 151ba120..102b4e49 100644 --- a/include/options.h +++ b/include/options.h @@ -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; diff --git a/inputdevice.cpp b/inputdevice.cpp index 191673e4..adab6f75 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -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) diff --git a/newcpu.cpp b/newcpu.cpp index b4251711..5384df13 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -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; diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index dd52ae87..94db7f82 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -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" diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 53cc3956..14788ec7 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -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 } };