passing call timings

This commit is contained in:
2025-05-31 09:52:10 -06:00
parent 2543ba04b5
commit dd6a22ccc4
2 changed files with 5 additions and 3 deletions

View File

@ -19,7 +19,7 @@ FILE *log;
void cpu_init() { void cpu_init() {
ctx.regs.a = 0x01; ctx.regs.a = 0x01;
ctx.regs.f = 0xB0; ctx.regs.f = 0xB0;
ctx.regs.b = 0x19; ctx.regs.b = 0x0;
ctx.regs.c = 0x13; ctx.regs.c = 0x13;
ctx.regs.d = 0x00; ctx.regs.d = 0x00;
ctx.regs.e = 0xD8; ctx.regs.e = 0xD8;

View File

@ -497,8 +497,10 @@ static void goto_addr(cpu_context *ctx, u16 addr, bool pushpc){
if(ctx->cur_inst->reg_1 != RT_HL) if(ctx->cur_inst->reg_1 != RT_HL)
emu_cycles(1); emu_cycles(1);
if(pushpc) { if(pushpc) {
stack_push16(ctx->regs.pc); stack_push((ctx->regs.pc >> 8) & 0xFF);
emu_cycles(2); emu_cycles(1);
stack_push(ctx->regs.pc & 0xFF);
emu_cycles(1);
} }
ctx->regs.pc = addr; ctx->regs.pc = addr;
} }