memory timing passed

This commit is contained in:
Samuel Walker 2025-02-04 15:46:38 -07:00
parent 645ae2f7d3
commit e35f05b94f
Signed by: piwalker
GPG Key ID: BE1F84BF85111255

View File

@ -117,7 +117,7 @@ static void proc_cb(cpu_context *ctx) {
emu_cycles(1);
if(reg == RT_HL) {
emu_cycles(2);
//emu_cycles(2);
}
switch(bit_op) {
@ -333,11 +333,11 @@ static void proc_inc(cpu_context *ctx) {
u16 val = cpu_read_reg(ctx->cur_inst->reg_1) + 1;
if(is_16_bit(ctx->cur_inst->reg_1)) {
emu_cycles(1);
//emu_cycles(1);
}
if (ctx->cur_inst->reg_1 == RT_HL && ctx->dest_is_mem) {
val = bus_read(cpu_read_reg(RT_HL)) + 1;
val = ctx->fetched_data + 1;
val &= 0xFF;
bus_write(cpu_read_reg(RT_HL), val);
} else {
@ -356,11 +356,11 @@ static void proc_dec(cpu_context *ctx) {
u16 val = cpu_read_reg(ctx->cur_inst->reg_1) - 1;
if(is_16_bit(ctx->cur_inst->reg_1)) {
emu_cycles(1);
//emu_cycles(1);
}
if (ctx->cur_inst->reg_1 == RT_HL && ctx->dest_is_mem) {
val = bus_read(cpu_read_reg(RT_HL)) - 1;
val = ctx->fetched_data - 1;
val &= 0xFF;
bus_write(cpu_read_reg(RT_HL), val);
} else {