dma and mbc1 passing

This commit is contained in:
2025-05-30 11:15:21 -06:00
parent 1455bc5666
commit 26b1f10e16
7 changed files with 76 additions and 23 deletions

View File

@ -8,7 +8,7 @@
#include <memory.h>
cpu_context ctx = {0};
#define CPU_DEBUG 0
#define CPU_DEBUG 1
#define FILE_LOG 0
#if FILE_LOG == 1
@ -54,10 +54,6 @@ static void execute() {
}
bool cpu_step() {
if(ctx.regs.pc == 0x4348) {
printf("made it!\n");
}
if(!ctx.halted) {
u16 pc = ctx.regs.pc;
@ -81,15 +77,15 @@ bool cpu_step() {
char inst[16];
inst_to_str(&ctx, inst);
printf("%08lX - %04X: %-12s (%02X %02X %02X) A: %02X F: %s BC: %02X%02X DE: %02X%02X HL: %02X%02X SP: %04X PC: %04X\n", emu_get_context()->ticks, pc, inst, ctx.cur_opcode, bus_read(pc+1), bus_read(pc+2), ctx.regs.a, flags, ctx.regs.b, ctx.regs.c, ctx.regs.d, ctx.regs.e, ctx.regs.h, ctx.regs.l, ctx.regs.sp, ctx.regs.pc);
//printf("%-12s\n", inst);
//printf("%08lX - %04X: %-12s (%02X %02X %02X) A: %02X F: %s BC: %02X%02X DE: %02X%02X HL: %02X%02X SP: %04X PC: %04X\n", emu_get_context()->ticks, pc, inst, ctx.cur_opcode, bus_read(pc+1), bus_read(pc+2), ctx.regs.a, flags, ctx.regs.b, ctx.regs.c, ctx.regs.d, ctx.regs.e, ctx.regs.h, ctx.regs.l, ctx.regs.sp, ctx.regs.pc);
if(ctx.cur_inst == NULL){
printf("Unknown Instruction! %02X\n", ctx.cur_opcode);
exit(-7);
}
dbg_update();
dbg_print();
//dbg_update();
//dbg_print();
#endif
execute();