Extra commands

This commit is contained in:
Luxdragon 2024-01-06 22:47:44 +01:00
parent ee40bed389
commit 5188e5cb3a

View file

@ -78,7 +78,7 @@ int emulate8080(State8080* state) {
uint32_t res = h1 + bc; uint32_t res = h1 + bc;
state->h = (res & 0xff) >> 8; state->h = (res & 0xff) >> 8;
state->l = res & 0xff; state->l = res & 0xff;
state->cc.cy = ((res & 0xffff0000) > 0); state->cc.cy = ((res & 0xffff0000) != 0);
break; break;
case 0x0d: // DCR C case 0x0d: // DCR C
@ -134,6 +134,12 @@ int emulate8080(State8080* state) {
state->h = opcode[1]; state->h = opcode[1];
state->pc += 1; state->pc += 1;
break; break;
case 0x29: // DAD H
uint32_t h1 = (state->h << 8) | state->l;
uint32_t res = hl + hl;
state->h = (res & 0xff00) >> 8;
state->l = res & 0xff;
state->cc.cy = ((res & 0xffff0000) != 0);
case 0x31: // LXI SP, word case 0x31: // LXI SP, word
state->sp = (opcode[2] << 8) | opcode[1]); state->sp = (opcode[2] << 8) | opcode[1]);
state->pc += 2; state->pc += 2;