DEBUG finished

This commit is contained in:
Luxdragon 2024-01-09 10:58:58 +01:00
parent ba3a89628a
commit dabe8f1ff6

View file

@ -412,15 +412,18 @@ int emulate8080(State8080* state) {
} }
break; break;
case 0x11: // LXI D, word case 0x11: // LXI D, word
{
state->d = opcode[2]; state->d = opcode[2];
state->e = opcode[1]; state->e = opcode[1];
state->pc += 2; state->pc += 2;
}
break; break;
case 0x13: // INX D case 0x13: // INX D
{
state->e++; state->e++;
if (state->e == 0) { if (state->e == 0) {
state->d++; state->d++;
} }}
break; break;
case 0x19: // DAD D case 0x19: // DAD D
{ {
@ -440,19 +443,24 @@ int emulate8080(State8080* state) {
break; break;
case 0x21: // LXI H, word case 0x21: // LXI H, word
{
state->h = opcode[2]; state->h = opcode[2];
state->l = opcode[1]; state->l = opcode[1];
state->pc += 2; state->pc += 2;
break; break;
}
case 0x23: // INX H case 0x23: // INX H
{
state->l++; state->l++;
if (state->l == 0) { if (state->l == 0) {
state->h++; state->h++;
} }}
break; break;
case 0x26: // MVI H, byte case 0x26: // MVI H, byte
{
state->h = opcode[1]; state->h = opcode[1];
state->pc++; state->pc++;
}
break; break;
case 0x29: // DAD H case 0x29: // DAD H
{ {
@ -625,8 +633,8 @@ int emulate8080(State8080* state) {
} }
break; break;
case 0xc9: // RET case 0xc9: // RET
state->sp += 2;
state->pc = (state->memory[state->sp+1] << 8) | state->memory[state->sp]; state->pc = (state->memory[state->sp+1] << 8) | state->memory[state->sp];
state->sp += 2;
break; break;
case 0xcd: // CALL adress case 0xcd: // CALL adress
{ {