]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Mark copper allocated but unused cycles in DMA debugger
authorToni Wilen <twilen@winuae.net>
Sat, 26 Nov 2022 17:43:27 +0000 (19:43 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 26 Nov 2022 17:43:27 +0000 (19:43 +0200)
custom.cpp
debug.cpp
include/debug.h

index 29c14d49af6ee812727ced95253962f141ee5676..6cc95db76d19e070dafd535cfefbcc5c48937111 100644 (file)
@@ -9281,6 +9281,9 @@ static bool copper_cant_read(int hpos, uae_u16 alloc)
                if (alloc && !bitplane_dma_access(hpos, coffset) && !cycle_line_pipe[offset]) {
                        cycle_line_pipe[offset] = CYCLE_PIPE_NONE | CYCLE_PIPE_COPPER;
                        blitter_pipe[offset] = CYCLE_PIPE_COPPER;
+#ifdef DEBUGGER
+                       record_dma_event2(DMA_EVENT2_COPPERUSE, offset, vpos);
+#endif
                }
                coffset++;
        }
@@ -9694,6 +9697,7 @@ static void do_copper_fetch(int hpos, uae_u16 id)
        {
                // COPJMP when previous instruction is mid-cycle
                cop_state.state = COP_read1;
+               record_dma_event2(DMA_EVENT2_COPPERUSE, hpos, vpos);
                alloc_cycle(hpos, CYCLE_COPPER);
        }
        break;
index 18cfa1ee68e5c208d8bdcb5332dd3473c6182ab7..f7c6cc781765285be366160f971d736372541f3f 100644 (file)
--- a/debug.cpp
+++ b/debug.cpp
@@ -2001,6 +2001,19 @@ void record_dma_event(uae_u32 evt, int hpos, int vpos)
        dr->ipl = regs.ipl_pin;
 }
 
+void record_dma_event2(uae_u32 evt2, int hpos, int vpos)
+{
+       struct dma_rec *dr;
+
+       if (!dma_record[0])
+               return;
+       if (hpos >= NR_DMA_REC_HPOS || vpos >= NR_DMA_REC_VPOS)
+               return;
+       dr = &dma_record[dma_record_toggle][vpos * NR_DMA_REC_HPOS + hpos];
+       dr->evt2 |= evt2;
+       dr->ipl = regs.ipl_pin;
+}
+
 void record_dma_event_data(uae_u32 evt, int hpos, int vpos, uae_u32 data)
 {
        struct dma_rec *dr;
@@ -2447,6 +2460,9 @@ static bool get_record_dma_info(struct dma_rec *dr, int hpos, int vpos, TCHAR *l
                if (dr->evt2 & DMA_EVENT2_IPLSAMPLE) {
                        l3[cl2++] = '^';
                }
+               if (dr->evt2 & DMA_EVENT2_COPPERUSE) {
+                       l3[cl2++] = 'C';
+               }
 
        }
        if (l5) {
index 69d416de264837e4b39f226712f395bc5d4f7691..d69e1ef9aa6c5273d8ea9df2568e666e9708bed4 100644 (file)
@@ -275,6 +275,7 @@ extern struct dma_rec *last_dma_rec;
 #define DMA_EVENT_CPUINS       0x80000000
 #define DMA_EVENT2_IPL         0x00000001
 #define DMA_EVENT2_IPLSAMPLE 0x00000002
+#define DMA_EVENT2_COPPERUSE 0x00000004
 
 #define DMARECORD_REFRESH 1
 #define DMARECORD_CPU 2
@@ -295,6 +296,7 @@ extern void record_dma_read_value_wide(uae_u64 v, bool quad);
 extern void record_dma_replace(int hpos, int vpos, int type, int extra);
 extern void record_dma_reset(int);
 extern void record_dma_event(uae_u32 evt, int hpos, int vpos);
+extern void record_dma_event2(uae_u32 evt, int hpos, int vpos);
 extern void record_dma_event_data(uae_u32 evt, int hpos, int vpos, uae_u32 data);
 extern void record_dma_clear(int hpos, int vpos);
 extern bool record_dma_check(int hpos, int vpos);