From: Dimitris Panokostas Date: Thu, 2 Mar 2023 15:27:52 +0000 (+0100) Subject: Merge branch 'midwan' into add-missing-ifdefs X-Git-Tag: 5.0.0~126^2 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=26d0c8aecf493b1d2d8f2d6e64d84a83011d971e;p=francis%2Fwinuae.git Merge branch 'midwan' into add-missing-ifdefs --- 26d0c8aecf493b1d2d8f2d6e64d84a83011d971e diff --cc custom.cpp index 6e83668c,e00a083e..42fd3e9f --- a/custom.cpp +++ b/custom.cpp @@@ -1006,36 -1282,20 +1286,24 @@@ static void record_color_change2(int hp if (!hcenterblank_state && hcenter_v2 < chpos && hcenter_v2 >= last_recorded_diw_hpos) { hcenterblank_state = true; if ((bplcon0 & 1) && (bplcon3 & 1)) { - cc = &curr_color_changes[next_color_change]; - cc->linepos = hcenter_v2; - cc->regno = RECORDED_REGISTER_CHANGE_OFFSET + 0x200; - cc->value = 1; - next_color_change++; - cc[1].regno = -1; - last_recorded_diw_hpos = cc->linepos; + addcc(hcenter_v2, RECORDED_REGISTER_CHANGE_OFFSET + 0x200, 1); +#ifdef DEBUGGER if (debug_dma) { - record_dma_event(DMA_EVENT_HBS, diw_to_hpos(cc->linepos), vpos); + record_dma_event(DMA_EVENT_HBS, diw_to_hpos(hcenter_v2), vpos); } +#endif thisline_changed = 1; } } if (hcenterblank_state && hcenter_v2_end < chpos && hcenter_v2_end >= last_recorded_diw_hpos) { hcenterblank_state = false; if ((bplcon0 & 1) && (bplcon3 & 1)) { - cc = &curr_color_changes[next_color_change]; - cc->linepos = hcenter_v2_end; - cc->regno = RECORDED_REGISTER_CHANGE_OFFSET + 0x200; - cc->value = 0; - next_color_change++; - cc[1].regno = -1; - last_recorded_diw_hpos = cc->linepos; + addcc(hcenter_v2_end, RECORDED_REGISTER_CHANGE_OFFSET + 0x200, 0); +#ifdef DEBUGGER if (debug_dma) { - record_dma_event(DMA_EVENT_HBE, diw_to_hpos(cc->linepos), vpos); + record_dma_event(DMA_EVENT_HBE, diw_to_hpos(hcenter_v2), vpos); } +#endif thisline_changed = 1; } } @@@ -1046,84 -1306,44 +1314,52 @@@ // inject programmed hblank start and end in color changes if (hbstrt_v2 <= hbstop_v2) { if (hbstrt_v2 < chpos && hbstrt_v2 >= last_recorded_diw_hpos) { - cc = &curr_color_changes[next_color_change]; - cc->linepos = hbstrt_v2; - cc->regno = RECORDED_REGISTER_CHANGE_OFFSET + 0x200; - cc->value = 1; - next_color_change++; - cc[1].regno = -1; + addcc(hbstrt_v2, RECORDED_REGISTER_CHANGE_OFFSET + 0x200, 1); hblank_reset(hbstrt_v2); exthblank_state = true; - last_recorded_diw_hpos = cc->linepos; - last_hblank_start = cc->linepos; + last_hblank_start = hbstrt_v2; +#ifdef DEBUGGER if (debug_dma) { - record_dma_event(DMA_EVENT_HBS, diw_to_hpos(cc->linepos), vpos); + record_dma_event(DMA_EVENT_HBS, diw_to_hpos(hbstrt_v2), vpos); } +#endif } if (hbstop_v2 < chpos && hbstop_v2 >= last_recorded_diw_hpos) { // do_color_changes() HBLANK workaround if (next_color_change == last_color_change && exthblank_state) { - cc = &curr_color_changes[next_color_change]; - cc->linepos = 0; - cc->regno = RECORDED_REGISTER_CHANGE_OFFSET + 0x200; - cc->value = 1; - next_color_change++; - } - cc = &curr_color_changes[next_color_change]; - cc->linepos = hbstop_v2; - cc->regno = RECORDED_REGISTER_CHANGE_OFFSET + 0x200; - cc->value = 0; - next_color_change++; - cc[1].regno = -1; + addcc(0, RECORDED_REGISTER_CHANGE_OFFSET + 0x200, 1); + } + addcc(hbstop_v2, RECORDED_REGISTER_CHANGE_OFFSET + 0x200, 0); exthblank_state = false; - last_recorded_diw_hpos = cc->linepos; +#ifdef DEBUGGER if (debug_dma) { - record_dma_event(DMA_EVENT_HBE, diw_to_hpos(cc->linepos), vpos); + record_dma_event(DMA_EVENT_HBE, diw_to_hpos(hbstop_v2), vpos); } +#endif } - } else if (hbstrt_v2 > hbstop_v2) { // equal: blank disable wins + } else if (hbstrt_v2 > hbstop_v2) { // equal: blank disable wins if (hbstop_v2 < chpos && hbstop_v2 >= last_recorded_diw_hpos) { if (next_color_change == last_color_change && exthblank_state) { - cc = &curr_color_changes[next_color_change]; - cc->linepos = 0; - cc->regno = RECORDED_REGISTER_CHANGE_OFFSET + 0x200; - cc->value = 1; - next_color_change++; - } - cc = &curr_color_changes[next_color_change]; - cc->linepos = hbstop_v2; - cc->regno = RECORDED_REGISTER_CHANGE_OFFSET + 0x200; - cc->value = 0; - next_color_change++; - cc[1].regno = -1; + addcc(0, RECORDED_REGISTER_CHANGE_OFFSET + 0x200, 1); + } + addcc(hbstop_v2, RECORDED_REGISTER_CHANGE_OFFSET + 0x200, 0); exthblank_state = false; - last_recorded_diw_hpos = cc->linepos; +#ifdef DEBUGGER if (debug_dma) { - record_dma_event(DMA_EVENT_HBE, diw_to_hpos(cc->linepos), vpos); + record_dma_event(DMA_EVENT_HBE, diw_to_hpos(hbstop_v2), vpos); } +#endif } if (hbstrt_v2 < chpos && hbstrt_v2 >= last_recorded_diw_hpos) { - cc = &curr_color_changes[next_color_change]; - cc->linepos = hbstrt_v2; - cc->regno = RECORDED_REGISTER_CHANGE_OFFSET + 0x200; - cc->value = 1; - next_color_change++; - cc[1].regno = -1; + addcc(hbstrt_v2, RECORDED_REGISTER_CHANGE_OFFSET + 0x200, 1); hblank_reset(hbstrt_v2); exthblank_state = true; - last_recorded_diw_hpos = cc->linepos; - last_hblank_start = cc->linepos; + last_hblank_start = hbstrt_v2; +#ifdef DEBUGGER if (debug_dma) { - record_dma_event(DMA_EVENT_HBS, diw_to_hpos(cc->linepos), vpos); + record_dma_event(DMA_EVENT_HBS, diw_to_hpos(hbstrt_v2), vpos); } +#endif } } } @@@ -11999,16 -12394,9 +12435,11 @@@ static void hsync_handler_pre(bool onvs } } +#ifdef DEBUGGER debug_hsync(); +#endif } - STATIC_INLINE bool is_last_line(void) - { - return vpos + 1 == maxvpos + lof_store; - } - // low latency vsync #define LLV_DEBUG 0 @@@ -13453,11 -13840,11 +13884,13 @@@ void custom_reset(bool hardreset, bool audio_reset(); if (!isrestore()) { + memset(&cop_state, 0, sizeof(cop_state)); + cop_state.state = COP_stop; /* must be called after audio_reset */ adkcon = 0; +#ifdef SERIAL_PORT serial_uartbreak(0); +#endif audio_update_adkmasks(); } diff --cc disk.cpp index b4ce372d,6a6686f5..03defa85 --- a/disk.cpp +++ b/disk.cpp @@@ -5474,14 -5491,10 +5534,14 @@@ int DISK_examine_image(struct uae_pref drive *drv = &floppy[num]; uae_u32 dos, crc, crc2; int wasdelayed = drv->dskchange_time; - int sectable[MAX_SECTORS]; - int oldcyl, oldside; + int sectable[MAX_SECTORS] = { 0 }; + int oldcyl, oldside, mfmpos; uae_u32 v = 0; +#ifdef FLOPPYBRIDGE bool fb = DISK_isfloppybridge(p, num); +#else + bool fb = false; +#endif if (infotext) { infotext[0] = 0; @@@ -5498,13 -5509,10 +5558,14 @@@ di->unreadable = true; oldcyl = drv->cyl; oldside = side; + mfmpos = drv->mfmpos; drv->cyl = 0; side = 0; +#ifdef FLOPPYBRIDGE if (!drive_insert (drv, p, num, p->floppyslots[num].df, true, true) || (!drv->diskfile && !drv->bridge)) { +#else + if (!drive_insert(drv, p, num, p->floppyslots[num].df, true, true)) { +#endif drv->cyl = oldcyl; side = oldside; return 1; diff --cc main.cpp index bf4fb01a,05712603..13ad1707 --- a/main.cpp +++ b/main.cpp @@@ -43,9 -41,8 +43,10 @@@ #include "cpuboard.h" #include "uae/ppc.h" #include "devices.h" +#ifdef JIT #include "jit/compemu.h" +#endif + #include "disasm.h" #ifdef RETROPLATFORM #include "rp.h" #endif diff --cc memory.cpp index a15d699c,97b69014..6d583e80 --- a/memory.cpp +++ b/memory.cpp @@@ -1200,12 -1260,10 +1286,12 @@@ uae_u8 *REGPARAM2 default_xlate (uaecpt uaecptr a2 = addr - 32; uaecptr a3 = m68k_getpc () - 32; write_log (_T("Your Amiga program just did something terribly stupid %08X PC=%08X\n"), addr, M68K_GETPC); +#ifdef DEBUGGER if (debugging || DEBUG_STUPID) { - activate_debugger (); + activate_debugger(); m68k_dumpstate(NULL, 0xffffffff); } +#endif for (i = 0; i < 10; i++) { write_log (_T("%08X "), i >= 5 ? a3 : a2); for (j = 0; j < 16; j += 2) { diff --cc newcpu.cpp index 6233bd13,968c24c5..f53b678e --- a/newcpu.cpp +++ b/newcpu.cpp @@@ -6704,13 -6700,12 +6754,13 @@@ void m68k_dumpstate(uaecptr *nextpc, ua j++; } } +#endif if (j > 0) console_out_f (_T("\n")); - console_out_f (_T("T=%d%d S=%d M=%d X=%d N=%d Z=%d V=%d C=%d IMASK=%d STP=%d\n"), - regs.t1, regs.t0, regs.s, regs.m, - GET_XFLG (), GET_NFLG (), GET_ZFLG (), - GET_VFLG (), GET_CFLG (), + console_out_f (_T("SR=%04X T=%d%d S=%d M=%d X=%d N=%d Z=%d V=%d C=%d IM=%d STP=%d\n"), + regs.sr, regs.t1, regs.t0, regs.s, regs.m, + GET_XFLG(), GET_NFLG(), GET_ZFLG(), + GET_VFLG(), GET_CFLG(), regs.intmask, regs.stopped); #ifdef FPUEMU if (currprefs.fpu_model) {