]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Merge branch 'midwan' into add-missing-ifdefs
authorDimitris Panokostas <midwan@gmail.com>
Thu, 2 Mar 2023 15:27:52 +0000 (16:27 +0100)
committerDimitris Panokostas <midwan@gmail.com>
Thu, 2 Mar 2023 15:27:52 +0000 (16:27 +0100)
15 files changed:
1  2 
audio.cpp
blitter.cpp
cia.cpp
custom.cpp
devices.cpp
disk.cpp
drawing.cpp
filesys.cpp
fpp.cpp
gayle.cpp
inputdevice.cpp
main.cpp
memory.cpp
newcpu.cpp
savestate.cpp

diff --cc audio.cpp
Simple merge
diff --cc blitter.cpp
Simple merge
diff --cc cia.cpp
Simple merge
diff --cc custom.cpp
index 6e83668c3edc4bd876fb9e5eb520816f96b827f4,e00a083eb70b1c2175d12f36e3b253c3b298ec50..42fd3e9f7038cbf4dc3761ff9635d29ee051cea2
@@@ -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;
                        }
                }
                // 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 devices.cpp
Simple merge
diff --cc disk.cpp
index b4ce372df3632468dc96374e192c1e03ff45207c,6a6686f55dcf6273cd11369ff0eb5258d3a5b63a..03defa85e24540d17daab80c9fd3cdad081d3f6b
+++ 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;
        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 drawing.cpp
Simple merge
diff --cc filesys.cpp
Simple merge
diff --cc fpp.cpp
Simple merge
diff --cc gayle.cpp
Simple merge
diff --cc inputdevice.cpp
Simple merge
diff --cc main.cpp
index bf4fb01addef27b54a8032f26c1fcc8d9d73d619,05712603c24c8b61188179fa2d3b3dda1ed794c5..13ad1707bf8ce92662df4f80e4749954c51c09d4
+++ b/main.cpp
  #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 a15d699cb26f4eed883b21353ea6b402751094be,97b690147c15d128c8b5423e974cfbc2d76f5f5d..6d583e8068b9915a9573da9860591aa0d71f64bc
@@@ -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 6233bd13cd59381d340c921cd294a2ec90f5ffa2,968c24c56a1583aababa5c5e6198e66d31398e57..f53b678e6dcc9cb8567a07128cf2795dc1069044
@@@ -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) {
diff --cc savestate.cpp
Simple merge