beginning ppu

This commit is contained in:
2025-02-01 00:48:49 -07:00
parent 5206c3871e
commit f4cbfd09c8
25 changed files with 683 additions and 43 deletions

View File

@ -44,7 +44,7 @@ void fetch_data() {
return;
case AM_R_MR: {
u16 addr = cpu_read_reg(ctx.cur_inst->reg_2);
if(ctx.cur_inst->reg_1 == RT_C) {
if(ctx.cur_inst->reg_2 == RT_C) {
addr |= 0xFF00;
}
ctx.fetched_data = bus_read(addr);
@ -74,7 +74,7 @@ void fetch_data() {
cpu_set_reg(RT_HL, cpu_read_reg(RT_HL)-1);
return;
case AM_R_A8:
ctx.fetched_data = bus_read(bus_read(ctx.regs.pc));
ctx.fetched_data = bus_read(ctx.regs.pc);
emu_cycles(2);
ctx.regs.pc++;
return;