From: Toni Wilen Date: Sat, 26 Nov 2022 17:43:27 +0000 (+0200) Subject: Mark copper allocated but unused cycles in DMA debugger X-Git-Tag: 41000~57 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=ecd90f92037190451891a5615f94534b22abc871;p=francis%2Fwinuae.git Mark copper allocated but unused cycles in DMA debugger --- diff --git a/custom.cpp b/custom.cpp index 29c14d49..6cc95db7 100644 --- a/custom.cpp +++ b/custom.cpp @@ -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; diff --git a/debug.cpp b/debug.cpp index 18cfa1ee..f7c6cc78 100644 --- 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) { diff --git a/include/debug.h b/include/debug.h index 69d416de..d69e1ef9 100644 --- a/include/debug.h +++ b/include/debug.h @@ -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);