From: Toni Wilen Date: Sun, 10 Oct 2021 07:32:54 +0000 (+0300) Subject: Copper DMA debugger events fixed. X-Git-Tag: 4900~45 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=8133f6d5bd068053e08a8905d2c3ec1567cbf972;p=francis%2Fwinuae.git Copper DMA debugger events fixed. --- diff --git a/custom.cpp b/custom.cpp index 165e7986..166c66a6 100644 --- a/custom.cpp +++ b/custom.cpp @@ -8113,25 +8113,6 @@ static void do_copper_fetch(int hpos, uae_u8 id) { if (id == COPPER_CYCLE_IDLE) { // copper allocated cycle without DMA request - switch (cop_state.state) - { - case COP_wait: -#ifdef DEBUGGER - if (debug_dma) - record_dma_event(DMA_EVENT_COPPERWAKE, hpos, vpos); - if (debug_copper) - record_copper(cop_state.ip - 4, 0xffffffff, cop_state.ir[0], cop_state.ir[1], hpos, vpos); -#endif - break; - case COP_skip: -#ifdef DEBUGGER - if (debug_dma && cop_state.ignore_next > 0) - record_dma_event(DMA_EVENT_COPPERSKIP, hpos, vpos); - if (debug_copper) - record_copper(cop_state.ip - 4, 0xffffffff, cop_state.ir[0], cop_state.ir[1], hpos, vpos); -#endif - break; - } alloc_cycle(hpos, CYCLE_COPPER); return; } @@ -8514,14 +8495,14 @@ static void update_copper(int until_hpos) } cop_state.strobe = 0; } else { - copper_cant_read(hpos, 0x88); + copper_cant_read(hpos, CYCLE_PIPE_COPPER | 0x08); } } break; case COP_strobe_delay2: // Second cycle after COPJMP does basically skipped MOVE (MOVE to 1FE) // Cycle is used and needs to be free. - copper_cant_read(hpos, 0x80); + copper_cant_read(hpos, CYCLE_PIPE_COPPER); break; case COP_strobe_delay1x: @@ -8538,22 +8519,22 @@ static void update_copper(int until_hpos) // Second cycle fetches following word and tosses it away. // Cycle can be free and copper won't allocate it. // If Blitter uses this cycle = Copper's PC gets copied to blitter DMA pointer.. - copper_cant_read(hpos, 0x89); + copper_cant_read(hpos, CYCLE_PIPE_COPPER | 0x09); break; case COP_start_delay: // cycle after vblank strobe fetches word from old pointer first - copper_cant_read(hpos, 0x81); + copper_cant_read(hpos, CYCLE_PIPE_COPPER | 0x01); break; // Request IR1 case COP_read1: - copper_cant_read(hpos, 0x82); + copper_cant_read(hpos, CYCLE_PIPE_COPPER | 0x02); break; // Request IR2 case COP_read2: - copper_cant_read(hpos, 0x83); + copper_cant_read(hpos, CYCLE_PIPE_COPPER | 0x03); break; // WAIT: Got IR2, first idle cycle. @@ -8601,7 +8582,13 @@ static void update_copper(int until_hpos) // Wait finished, request IR1. case COP_wait: { - if (copper_cant_read(hpos, 0x84)) { +#ifdef DEBUGGER + if (debug_dma) + record_dma_event(DMA_EVENT_COPPERWAKE, hpos, vpos); + if (debug_copper) + record_copper(cop_state.ip - 4, 0xffffffff, cop_state.ir[0], cop_state.ir[1], hpos, vpos); +#endif + if (copper_cant_read(hpos, CYCLE_PIPE_COPPER | 0x04)) { goto next; } @@ -8628,6 +8615,14 @@ static void update_copper(int until_hpos) if (!coppercomp(hpos, false)) { cop_state.ignore_next = 1; + +#ifdef DEBUGGER + if (debug_dma && cop_state.ignore_next > 0) + record_dma_event(DMA_EVENT_COPPERSKIP, hpos, vpos); + if (debug_copper) + record_copper(cop_state.ip - 4, 0xffffffff, cop_state.ir[0], cop_state.ir[1], hpos, vpos); +#endif + } else { cop_state.ignore_next = -1; } @@ -8637,7 +8632,7 @@ static void update_copper(int until_hpos) // SKIP finished. Request IR1. case COP_skip: - if (copper_cant_read(hpos, 0x85)) { + if (copper_cant_read(hpos, CYCLE_PIPE_COPPER | 0x005)) { goto next; } cop_state.state = COP_read1; diff --git a/debug.cpp b/debug.cpp index d182f802..6ce6fc01 100644 --- a/debug.cpp +++ b/debug.cpp @@ -2079,10 +2079,8 @@ static bool get_record_dma_info(struct dma_rec *dr, int hpos, int vpos, uae_u32 l3[cl2++] = 'b'; if (dr->evt & DMA_EVENT_BPLFETCHUPDATE) l3[cl2++] = 'p'; - if (dr->evt & DMA_EVENT_COPPERWAKE) + if (dr->evt & (DMA_EVENT_COPPERWAKE | DMA_EVENT_COPPERSKIP)) l3[cl2++] = 'W'; - if (dr->evt & DMA_EVENT_COPPERSKIP) - l3[cl2++] = 'S'; if (dr->evt & DMA_EVENT_NOONEGETS) { l3[cl2++] = '#'; } else if (dr->evt & DMA_EVENT_COPPERWANTED) {