cpu: make blarg cpu instr test 7 pass
This commit is contained in:
@@ -615,7 +615,7 @@ int lr35902_cycle(struct lr35902_state *cpu)
|
||||
break;
|
||||
case 0x35: /* DEC (HL) */
|
||||
val = gb_mem_read(cpu->memory, cpu->hl);
|
||||
cpu->hf = CALC_H_ADD(val, 1);
|
||||
cpu->hf = CALC_H_SUB(val, 1);
|
||||
cpu->zf = (val == 0);
|
||||
cpu->nf = 1;
|
||||
val--;
|
||||
@@ -1586,7 +1586,7 @@ int lr35902_cycle(struct lr35902_state *cpu)
|
||||
}
|
||||
break;
|
||||
case 0xd4: /* CALL NC */
|
||||
if (!cpu->nf) {
|
||||
if (!cpu->cf) {
|
||||
CALL(cpu);
|
||||
} else {
|
||||
cpu->pc += 2;
|
||||
@@ -1608,13 +1608,16 @@ int lr35902_cycle(struct lr35902_state *cpu)
|
||||
}
|
||||
break;
|
||||
case 0xd9: /* RETI */
|
||||
gb_log("Interrupts ON\n");
|
||||
RET(cpu);
|
||||
ASSERT(0);
|
||||
cpu->int_state = LR35902_INT_ON;
|
||||
break;
|
||||
case 0xda:
|
||||
ASSERT(0);
|
||||
case 0xda: /* JP C, a16 */
|
||||
val_16 = gb_mem_read(cpu->memory, cpu->pc++);
|
||||
val_16 |= ((uint16_t) gb_mem_read(cpu->memory, cpu->pc++) << 8);
|
||||
if (cpu->cf) {
|
||||
cpu->pc = val_16;
|
||||
}
|
||||
break;
|
||||
case 0xdb: /* UNDEF */
|
||||
break;
|
||||
case 0xdc: /* CALL C */
|
||||
@@ -1627,7 +1630,7 @@ int lr35902_cycle(struct lr35902_state *cpu)
|
||||
case 0xdd: /* UNDEF */
|
||||
ASSERT(0);
|
||||
break;
|
||||
case 0xde:
|
||||
case 0xde: /* SBC A, d8 */
|
||||
ASSERT(0);
|
||||
case 0xdf: /* RST 0x18 */
|
||||
RST(cpu, 0x18);
|
||||
@@ -1704,7 +1707,6 @@ int lr35902_cycle(struct lr35902_state *cpu)
|
||||
cpu->a = gb_mem_read(cpu->memory, 0xFF00 + cpu->c);
|
||||
break;
|
||||
case 0xf3: /* DI */
|
||||
gb_log("Interrupts OFF\n");
|
||||
/*TODO: implement me */
|
||||
case 0xf4: /* UNDEF */
|
||||
break;
|
||||
@@ -1743,7 +1745,7 @@ int lr35902_cycle(struct lr35902_state *cpu)
|
||||
cpu->a = gb_mem_read(cpu->memory, val_16);
|
||||
break;
|
||||
case 0xfb: /* EI */
|
||||
gb_log("Interrupts ON\n");
|
||||
/* TODO: implement me */
|
||||
break;
|
||||
case 0xfc: /* UNDEF */
|
||||
ASSERT(0);
|
||||
|
||||
Reference in New Issue
Block a user