From 693501d2b011673487a3b42591e817e019382fe5 Mon Sep 17 00:00:00 2001 From: linear cannon Date: Sat, 29 Jan 2022 05:13:31 -0800 Subject: [PATCH 1/4] x86seg.c: cyrix_load_seg_descriptor: don't use codegen variables if dynarec disabled --- src/cpu/x86seg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cpu/x86seg.c b/src/cpu/x86seg.c index 4399fc4d8..7fab0869c 100644 --- a/src/cpu/x86seg.c +++ b/src/cpu/x86seg.c @@ -2415,7 +2415,9 @@ cyrix_load_seg_descriptor(uint32_t addr, x86seg *seg) cpu_cur_status &= ~CPU_STATUS_NOTFLATDS; else cpu_cur_status |= CPU_STATUS_NOTFLATDS; +#ifdef USE_DYNAREC codegen_flat_ds = 0; +#endif } if (seg == &cpu_state.seg_ss) { if (seg->base == 0 && seg->limit_low == 0 && seg->limit_high == 0xffffffff) @@ -2423,7 +2425,9 @@ cyrix_load_seg_descriptor(uint32_t addr, x86seg *seg) else cpu_cur_status |= CPU_STATUS_NOTFLATSS; set_stack32((segdat[3] & 0x40) ? 1 : 0); +#ifdef USE_DYNAREC codegen_flat_ss = 0; +#endif } } } From 483758d8278c13ee333fe244896e8c6f365ace47 Mon Sep 17 00:00:00 2001 From: linear cannon Date: Sat, 29 Jan 2022 05:27:35 -0800 Subject: [PATCH 2/4] cpu: dont build 386_dynarec_ops.c if DYNAREC=Off --- src/cpu/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpu/CMakeLists.txt b/src/cpu/CMakeLists.txt index 543ad8ff5..4fb4e0b5f 100644 --- a/src/cpu/CMakeLists.txt +++ b/src/cpu/CMakeLists.txt @@ -14,7 +14,7 @@ # add_library(cpu OBJECT cpu.c cpu_table.c fpu.c x86.c 808x.c 386.c 386_common.c 386_dynarec.c - 386_dynarec_ops.c x86seg.c x87.c x87_timings.c) + x86seg.c x87.c x87_timings.c) if(AMD_K5) target_compile_definitions(cpu PRIVATE USE_AMD_K5) @@ -29,4 +29,5 @@ if(DYNAREC) codegen_timing_common.c codegen_timing_k6.c codegen_timing_pentium.c codegen_timing_p6.c codegen_timing_winchip.c codegen_timing_winchip2.c) + add_library(dynarec_ops OBJECT 386_dynarec_ops.c) endif() \ No newline at end of file From 8b511fa9b9e73bf05cc9b97eac003e5fe3d5f9cf Mon Sep 17 00:00:00 2001 From: linear cannon Date: Sat, 29 Jan 2022 05:29:01 -0800 Subject: [PATCH 3/4] dma.c: dma_page_write: don't call update_tsc() if DYNAREC=Off --- src/dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dma.c b/src/dma.c index d59160d73..26fe1a6bf 100644 --- a/src/dma.c +++ b/src/dma.c @@ -892,8 +892,10 @@ dma_page_write(uint16_t addr, uint8_t val, void *priv) { uint8_t convert[8] = CHANNELS; +#ifdef USE_DYNAREC if ((addr == 0x84) && cpu_use_dynarec) update_tsc(); +#endif addr &= 0x0f; dmaregs[2][addr] = val; From fb22e1fc737b18c6fd3977107181415383677fd1 Mon Sep 17 00:00:00 2001 From: linear cannon Date: Sat, 29 Jan 2022 05:30:34 -0800 Subject: [PATCH 4/4] 86box.c: pc_reset_hard_init: dont set cycles_main if DYNAREC=Off --- src/86box.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/86box.c b/src/86box.c index 4cee64445..ef06eb345 100644 --- a/src/86box.c +++ b/src/86box.c @@ -1046,8 +1046,12 @@ pc_reset_hard_init(void) atfullspeed = 0; pc_full_speed(); - cycles = cycles_main = 0; - + + cycles = 0; +#ifdef USE_DYNAREC + cycles_main = 0; +#endif + update_mouse_msg(); }