Mercurial > repos > blastem
comparison m68k_util.c @ 2656:ec02a08196d5
Remove some debug cruft
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 03 Mar 2025 22:11:13 -0800 |
parents | 6068d32b756c |
children | 38c281ef57b0 |
comparison
equal
deleted
inserted
replaced
2655:f40f06c220bf | 2656:ec02a08196d5 |
---|---|
6 #ifdef DEBUG_DISASM | 6 #ifdef DEBUG_DISASM |
7 uint32_t tmp = context->scratch1; | 7 uint32_t tmp = context->scratch1; |
8 #endif | 8 #endif |
9 context->scratch1 = read_byte(context->scratch1, (void**)context->mem_pointers, &context->opts->gen, context); | 9 context->scratch1 = read_byte(context->scratch1, (void**)context->mem_pointers, &context->opts->gen, context); |
10 #ifdef DEBUG_DISASM | 10 #ifdef DEBUG_DISASM |
11 if (context->pc >= 0x3F48 && context->pc < 0x3FCE) { | 11 printf("Read.b %05X: %02X\n", tmp, context->scratch1); |
12 printf("Read.b %05X: %02X\n", tmp, context->scratch1); | |
13 } | |
14 #endif | 12 #endif |
15 } | 13 } |
16 | 14 |
17 #ifdef DEBUG_DISASM | 15 #ifdef DEBUG_DISASM |
18 #include "68kinst.h" | 16 #include "68kinst.h" |
28 #ifdef DEBUG_DISASM | 26 #ifdef DEBUG_DISASM |
29 uint32_t tmp = context->scratch1; | 27 uint32_t tmp = context->scratch1; |
30 #endif | 28 #endif |
31 context->scratch1 = read_word(context->scratch1, (void**)context->mem_pointers, &context->opts->gen, context); | 29 context->scratch1 = read_word(context->scratch1, (void**)context->mem_pointers, &context->opts->gen, context); |
32 #ifdef DEBUG_DISASM | 30 #ifdef DEBUG_DISASM |
33 if (context->pc >= 0x3F48 && context->pc < 0x3FCE) { | |
34 if (tmp == context->pc) { | 31 if (tmp == context->pc) { |
35 m68kinst inst; | 32 m68kinst inst; |
36 m68k_decode(debug_disasm_fetch, context, &inst, tmp); | 33 m68k_decode(debug_disasm_fetch, context, &inst, tmp); |
37 static char disasm_buf[256]; | 34 static char disasm_buf[256]; |
38 m68k_disasm(&inst, disasm_buf); | 35 m68k_disasm(&inst, disasm_buf); |
41 context->dregs[4], context->dregs[6], context->dregs[7], context->aregs[3], context->aregs[7], context->xflag | 38 context->dregs[4], context->dregs[6], context->dregs[7], context->aregs[3], context->aregs[7], context->xflag |
42 ); | 39 ); |
43 } else { | 40 } else { |
44 printf("Read %05X: %04X\n", tmp, context->scratch1); | 41 printf("Read %05X: %04X\n", tmp, context->scratch1); |
45 } | 42 } |
46 } | |
47 #endif | 43 #endif |
48 } | 44 } |
49 | 45 |
50 void m68k_write_8(m68k_context *context) | 46 void m68k_write_8(m68k_context *context) |
51 { | 47 { |
52 context->cycles += 4 * context->opts->gen.clock_divider; | 48 context->cycles += 4 * context->opts->gen.clock_divider; |
53 write_byte(context->scratch2, context->scratch1, (void**)context->mem_pointers, &context->opts->gen, context); | 49 write_byte(context->scratch2, context->scratch1, (void**)context->mem_pointers, &context->opts->gen, context); |
54 #ifdef DEBUG_DISASM | 50 #ifdef DEBUG_DISASM |
55 if (context->pc >= 0x3F48 && context->pc < 0x3FCE) { | |
56 printf("Write.b %05X: %02X\n", context->scratch2, context->scratch1); | 51 printf("Write.b %05X: %02X\n", context->scratch2, context->scratch1); |
57 } | |
58 #endif | 52 #endif |
59 } | 53 } |
60 | 54 |
61 void m68k_rmw_writeback(m68k_context *context) | 55 void m68k_rmw_writeback(m68k_context *context) |
62 { | 56 { |
70 void m68k_write_16(m68k_context *context) | 64 void m68k_write_16(m68k_context *context) |
71 { | 65 { |
72 context->cycles += 4 * context->opts->gen.clock_divider; | 66 context->cycles += 4 * context->opts->gen.clock_divider; |
73 write_word(context->scratch2, context->scratch1, (void**)context->mem_pointers, &context->opts->gen, context); | 67 write_word(context->scratch2, context->scratch1, (void**)context->mem_pointers, &context->opts->gen, context); |
74 #ifdef DEBUG_DISASM | 68 #ifdef DEBUG_DISASM |
75 if (context->pc >= 0x3F48 && context->pc < 0x3FCE) { | |
76 printf("Write %05X: %04X\n", context->scratch2, context->scratch1); | 69 printf("Write %05X: %04X\n", context->scratch2, context->scratch1); |
77 } | |
78 #endif | 70 #endif |
79 } | 71 } |
80 | 72 |
81 void m68k_sync_cycle(m68k_context *context, uint32_t target_cycle) | 73 void m68k_sync_cycle(m68k_context *context, uint32_t target_cycle) |
82 { | 74 { |