+#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
self->out_byte_context = out_byte_context;
}
+void cpu_z80_reset(struct cpu_z80 *self) {
+ self->regs.word.pc = CPU_Z80_RESET_ADDR;
+ self->regs.word.af = 0xffff;
+ self->regs.word.sp = 0xffff;
+ self->regs.word.iflags = 0;
+}
+
// instruction decode
void cpu_z80_execute(struct cpu_z80 *self) {
+ if (self->regs.bit.nmi_pending) {
+ self->regs.bit.nmi_pending = false;
+
+ self->regs.word.pc += self->regs.bit.halt_flag;
+ self->regs.bit.halt_flag = false;
+
+ self->regs.bit.iff1 = false;
+ cpu_z80_call(self, true, CPU_Z80_NMI_ADDR);
+ return;
+ }
+
+ if (
+ self->regs.bit.irq_pending &&
+ self->regs.bit.iff1 &&
+ !self->regs.bit.ei_flag
+ ) {
+ self->regs.bit.irq_pending = false;
+
+ self->regs.word.pc += self->regs.bit.halt_flag;
+ self->regs.bit.halt_flag = false;
+
+ self->regs.bit.iff1 = false;
+ self->regs.bit.iff2 = false;
+ switch (self->regs.bit.im) {
+ case 0:
+ // self->regs.byte.v contains the opcode placed on bus by peripheral
+ // only RST instructions are supported at the moment (systems with
+ // 8259 / 8228 could also use CALL, that would be extra complexity)
+ assert((self->regs.byte.v & 0xc7) == 0xc7);
+ cpu_z80_call(self, true, self->regs.byte.v & 0x38);
+ break;
+ case 1:
+ cpu_z80_call(self, true, CPU_Z80_IRQ_ADDR);
+ break;
+ case 2:
+ // self->regs.byte.v contains the vector placed on bus by peripheral
+ // it is combined with self->regs.byte.i to create vector word "iv"
+ cpu_z80_call(self, true, cpu_z80_read_word(self, self->regs.word.iv & 0xfffe));
+ break;
+ default:
+ abort();
+ }
+ return;
+ }
+
+ self->regs.bit.halt_flag = false;
+ self->regs.bit.ei_flag = false;
switch (cpu_z80_fetch_byte(self)) {
case 0x00:
cpu_z80_nop(self);
void cpu_z80_execute_cb(struct cpu_z80 *self) {
switch (cpu_z80_fetch_byte(self)) {
case 0x00:
- cpu_z80_rlc(self, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_rlc(self, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0x01:
- cpu_z80_rlc(self, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_rlc(self, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0x02:
- cpu_z80_rlc(self, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_rlc(self, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0x03:
- cpu_z80_rlc(self, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_rlc(self, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0x04:
- cpu_z80_rlc(self, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_rlc(self, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0x05:
- cpu_z80_rlc(self, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_rlc(self, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0x06:
- cpu_z80_rlc(self, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_rlc(self, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0x07:
- cpu_z80_rlc(self, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_rlc(self, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0x08:
- cpu_z80_rrc(self, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_rrc(self, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0x09:
- cpu_z80_rrc(self, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_rrc(self, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0x0a:
- cpu_z80_rrc(self, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_rrc(self, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0x0b:
- cpu_z80_rrc(self, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_rrc(self, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0x0c:
- cpu_z80_rrc(self, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_rrc(self, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0x0d:
- cpu_z80_rrc(self, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_rrc(self, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0x0e:
- cpu_z80_rrc(self, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_rrc(self, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0x0f:
- cpu_z80_rrc(self, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_rrc(self, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0x10:
- cpu_z80_rl(self, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_rl(self, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0x11:
- cpu_z80_rl(self, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_rl(self, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0x12:
- cpu_z80_rl(self, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_rl(self, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0x13:
- cpu_z80_rl(self, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_rl(self, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0x14:
- cpu_z80_rl(self, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_rl(self, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0x15:
- cpu_z80_rl(self, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_rl(self, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0x16:
- cpu_z80_rl(self, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_rl(self, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0x17:
- cpu_z80_rl(self, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_rl(self, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0x18:
- cpu_z80_rr(self, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_rr(self, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0x19:
- cpu_z80_rr(self, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_rr(self, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0x1a:
- cpu_z80_rr(self, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_rr(self, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0x1b:
- cpu_z80_rr(self, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_rr(self, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0x1c:
- cpu_z80_rr(self, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_rr(self, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0x1d:
- cpu_z80_rr(self, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_rr(self, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0x1e:
- cpu_z80_rr(self, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_rr(self, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0x1f:
- cpu_z80_rr(self, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_rr(self, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0x20:
- cpu_z80_sla(self, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_sla(self, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0x21:
- cpu_z80_sla(self, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_sla(self, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0x22:
- cpu_z80_sla(self, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_sla(self, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0x23:
- cpu_z80_sla(self, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_sla(self, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0x24:
- cpu_z80_sla(self, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_sla(self, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0x25:
- cpu_z80_sla(self, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_sla(self, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0x26:
- cpu_z80_sla(self, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_sla(self, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0x27:
- cpu_z80_sla(self, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_sla(self, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0x28:
- cpu_z80_sra(self, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_sra(self, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0x29:
- cpu_z80_sra(self, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_sra(self, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0x2a:
- cpu_z80_sra(self, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_sra(self, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0x2b:
- cpu_z80_sra(self, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_sra(self, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0x2c:
- cpu_z80_sra(self, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_sra(self, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0x2d:
- cpu_z80_sra(self, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_sra(self, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0x2e:
- cpu_z80_sra(self, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_sra(self, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0x2f:
- cpu_z80_sra(self, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_sra(self, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0x30:
- cpu_z80_sll(self, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_sll(self, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0x31:
- cpu_z80_sll(self, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_sll(self, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0x32:
- cpu_z80_sll(self, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_sll(self, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0x33:
- cpu_z80_sll(self, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_sll(self, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0x34:
- cpu_z80_sll(self, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_sll(self, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0x35:
- cpu_z80_sll(self, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_sll(self, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0x36:
- cpu_z80_sll(self, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_sll(self, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0x37:
- cpu_z80_sll(self, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_sll(self, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0x38:
- cpu_z80_srl(self, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_srl(self, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0x39:
- cpu_z80_srl(self, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_srl(self, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0x3a:
- cpu_z80_srl(self, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_srl(self, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0x3b:
- cpu_z80_srl(self, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_srl(self, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0x3c:
- cpu_z80_srl(self, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_srl(self, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0x3d:
- cpu_z80_srl(self, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_srl(self, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0x3e:
- cpu_z80_srl(self, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_srl(self, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0x3f:
- cpu_z80_srl(self, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_srl(self, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0x40:
cpu_z80_bit(self, 0, self->regs.byte.b);
cpu_z80_bit(self, 7, self->regs.byte.a);
break;
case 0x80:
- cpu_z80_res(self, 0, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 0, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0x81:
- cpu_z80_res(self, 0, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 0, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0x82:
- cpu_z80_res(self, 0, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 0, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0x83:
- cpu_z80_res(self, 0, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 0, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0x84:
- cpu_z80_res(self, 0, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 0, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0x85:
- cpu_z80_res(self, 0, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 0, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0x86:
- cpu_z80_res(self, 0, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 0, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0x87:
- cpu_z80_res(self, 0, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 0, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0x88:
- cpu_z80_res(self, 1, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 1, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0x89:
- cpu_z80_res(self, 1, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 1, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0x8a:
- cpu_z80_res(self, 1, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 1, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0x8b:
- cpu_z80_res(self, 1, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 1, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0x8c:
- cpu_z80_res(self, 1, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 1, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0x8d:
- cpu_z80_res(self, 1, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 1, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0x8e:
- cpu_z80_res(self, 1, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 1, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0x8f:
- cpu_z80_res(self, 1, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 1, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0x90:
- cpu_z80_res(self, 2, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 2, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0x91:
- cpu_z80_res(self, 2, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 2, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0x92:
- cpu_z80_res(self, 2, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 2, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0x93:
- cpu_z80_res(self, 2, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 2, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0x94:
- cpu_z80_res(self, 2, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 2, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0x95:
- cpu_z80_res(self, 2, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 2, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0x96:
- cpu_z80_res(self, 2, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 2, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0x97:
- cpu_z80_res(self, 2, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 2, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0x98:
- cpu_z80_res(self, 3, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 3, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0x99:
- cpu_z80_res(self, 3, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 3, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0x9a:
- cpu_z80_res(self, 3, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 3, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0x9b:
- cpu_z80_res(self, 3, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 3, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0x9c:
- cpu_z80_res(self, 3, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 3, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0x9d:
- cpu_z80_res(self, 3, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 3, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0x9e:
- cpu_z80_res(self, 3, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 3, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0x9f:
- cpu_z80_res(self, 3, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 3, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0xa0:
- cpu_z80_res(self, 4, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 4, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0xa1:
- cpu_z80_res(self, 4, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 4, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0xa2:
- cpu_z80_res(self, 4, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 4, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0xa3:
- cpu_z80_res(self, 4, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 4, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0xa4:
- cpu_z80_res(self, 4, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 4, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0xa5:
- cpu_z80_res(self, 4, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 4, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0xa6:
- cpu_z80_res(self, 4, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 4, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0xa7:
- cpu_z80_res(self, 4, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 4, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0xa8:
- cpu_z80_res(self, 5, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 5, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0xa9:
- cpu_z80_res(self, 5, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 5, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0xaa:
- cpu_z80_res(self, 5, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 5, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0xab:
- cpu_z80_res(self, 5, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 5, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0xac:
- cpu_z80_res(self, 5, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 5, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0xad:
- cpu_z80_res(self, 5, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 5, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0xae:
- cpu_z80_res(self, 5, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 5, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0xaf:
- cpu_z80_res(self, 5, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 5, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0xb0:
- cpu_z80_res(self, 6, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 6, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0xb1:
- cpu_z80_res(self, 6, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 6, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0xb2:
- cpu_z80_res(self, 6, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 6, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0xb3:
- cpu_z80_res(self, 6, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 6, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0xb4:
- cpu_z80_res(self, 6, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 6, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0xb5:
- cpu_z80_res(self, 6, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 6, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0xb6:
- cpu_z80_res(self, 6, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 6, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0xb7:
- cpu_z80_res(self, 6, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 6, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0xb8:
- cpu_z80_res(self, 7, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 7, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0xb9:
- cpu_z80_res(self, 7, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 7, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0xba:
- cpu_z80_res(self, 7, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 7, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0xbb:
- cpu_z80_res(self, 7, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 7, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0xbc:
- cpu_z80_res(self, 7, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 7, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0xbd:
- cpu_z80_res(self, 7, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 7, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0xbe:
- cpu_z80_res(self, 7, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 7, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0xbf:
- cpu_z80_res(self, 7, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 7, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0xc0:
- cpu_z80_set(self, 0, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 0, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0xc1:
- cpu_z80_set(self, 0, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 0, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0xc2:
- cpu_z80_set(self, 0, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 0, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0xc3:
- cpu_z80_set(self, 0, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 0, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0xc4:
- cpu_z80_set(self, 0, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 0, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0xc5:
- cpu_z80_set(self, 0, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 0, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0xc6:
- cpu_z80_set(self, 0, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 0, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0xc7:
- cpu_z80_set(self, 0, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 0, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0xc8:
- cpu_z80_set(self, 1, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 1, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0xc9:
- cpu_z80_set(self, 1, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 1, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0xca:
- cpu_z80_set(self, 1, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 1, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0xcb:
- cpu_z80_set(self, 1, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 1, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0xcc:
- cpu_z80_set(self, 1, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 1, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0xcd:
- cpu_z80_set(self, 1, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 1, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0xce:
- cpu_z80_set(self, 1, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 1, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0xcf:
- cpu_z80_set(self, 1, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 1, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0xd0:
- cpu_z80_set(self, 2, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 2, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0xd1:
- cpu_z80_set(self, 2, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 2, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0xd2:
- cpu_z80_set(self, 2, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 2, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0xd3:
- cpu_z80_set(self, 2, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 2, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0xd4:
- cpu_z80_set(self, 2, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 2, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0xd5:
- cpu_z80_set(self, 2, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 2, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0xd6:
- cpu_z80_set(self, 2, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 2, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0xd7:
- cpu_z80_set(self, 2, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 2, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0xd8:
- cpu_z80_set(self, 3, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 3, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0xd9:
- cpu_z80_set(self, 3, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 3, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0xda:
- cpu_z80_set(self, 3, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 3, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0xdb:
- cpu_z80_set(self, 3, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 3, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0xdc:
- cpu_z80_set(self, 3, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 3, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0xdd:
- cpu_z80_set(self, 3, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 3, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0xde:
- cpu_z80_set(self, 3, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 3, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0xdf:
- cpu_z80_set(self, 3, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 3, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0xe0:
- cpu_z80_set(self, 4, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 4, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0xe1:
- cpu_z80_set(self, 4, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 4, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0xe2:
- cpu_z80_set(self, 4, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 4, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0xe3:
- cpu_z80_set(self, 4, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 4, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0xe4:
- cpu_z80_set(self, 4, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 4, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0xe5:
- cpu_z80_set(self, 4, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 4, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0xe6:
- cpu_z80_set(self, 4, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 4, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0xe7:
- cpu_z80_set(self, 4, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 4, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0xe8:
- cpu_z80_set(self, 5, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 5, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0xe9:
- cpu_z80_set(self, 5, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 5, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0xea:
- cpu_z80_set(self, 5, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 5, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0xeb:
- cpu_z80_set(self, 5, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 5, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0xec:
- cpu_z80_set(self, 5, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 5, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0xed:
- cpu_z80_set(self, 5, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 5, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0xee:
- cpu_z80_set(self, 5, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 5, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0xef:
- cpu_z80_set(self, 5, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 5, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0xf0:
- cpu_z80_set(self, 6, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 6, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0xf1:
- cpu_z80_set(self, 6, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 6, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0xf2:
- cpu_z80_set(self, 6, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 6, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0xf3:
- cpu_z80_set(self, 6, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 6, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0xf4:
- cpu_z80_set(self, 6, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 6, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0xf5:
- cpu_z80_set(self, 6, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 6, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0xf6:
- cpu_z80_set(self, 6, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 6, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0xf7:
- cpu_z80_set(self, 6, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 6, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
case 0xf8:
- cpu_z80_set(self, 7, CPU_Z80_EA_B, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 7, CPU_Z80_EA_B, CPU_Z80_EA_SINK);
break;
case 0xf9:
- cpu_z80_set(self, 7, CPU_Z80_EA_C, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 7, CPU_Z80_EA_C, CPU_Z80_EA_SINK);
break;
case 0xfa:
- cpu_z80_set(self, 7, CPU_Z80_EA_D, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 7, CPU_Z80_EA_D, CPU_Z80_EA_SINK);
break;
case 0xfb:
- cpu_z80_set(self, 7, CPU_Z80_EA_E, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 7, CPU_Z80_EA_E, CPU_Z80_EA_SINK);
break;
case 0xfc:
- cpu_z80_set(self, 7, CPU_Z80_EA_H, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 7, CPU_Z80_EA_H, CPU_Z80_EA_SINK);
break;
case 0xfd:
- cpu_z80_set(self, 7, CPU_Z80_EA_L, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 7, CPU_Z80_EA_L, CPU_Z80_EA_SINK);
break;
case 0xfe:
- cpu_z80_set(self, 7, self->regs.word.hl, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 7, self->regs.word.hl, CPU_Z80_EA_SINK);
break;
case 0xff:
- cpu_z80_set(self, 7, CPU_Z80_EA_A, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 7, CPU_Z80_EA_A, CPU_Z80_EA_SINK);
break;
}
}
cpu_z80_rlc(self, ea, CPU_Z80_EA_L);
break;
case 0x06:
- cpu_z80_rlc(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_rlc(self, ea, CPU_Z80_EA_SINK);
break;
case 0x07:
cpu_z80_rlc(self, ea, CPU_Z80_EA_A);
cpu_z80_rrc(self, ea, CPU_Z80_EA_L);
break;
case 0x0e:
- cpu_z80_rrc(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_rrc(self, ea, CPU_Z80_EA_SINK);
break;
case 0x0f:
cpu_z80_rrc(self, ea, CPU_Z80_EA_A);
cpu_z80_rl(self, ea, CPU_Z80_EA_L);
break;
case 0x16:
- cpu_z80_rl(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_rl(self, ea, CPU_Z80_EA_SINK);
break;
case 0x17:
cpu_z80_rl(self, ea, CPU_Z80_EA_A);
cpu_z80_rr(self, ea, CPU_Z80_EA_L);
break;
case 0x1e:
- cpu_z80_rr(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_rr(self, ea, CPU_Z80_EA_SINK);
break;
case 0x1f:
cpu_z80_rr(self, ea, CPU_Z80_EA_A);
cpu_z80_sla(self, ea, CPU_Z80_EA_L);
break;
case 0x26:
- cpu_z80_sla(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_sla(self, ea, CPU_Z80_EA_SINK);
break;
case 0x27:
cpu_z80_sla(self, ea, CPU_Z80_EA_A);
cpu_z80_sra(self, ea, CPU_Z80_EA_L);
break;
case 0x2e:
- cpu_z80_sra(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_sra(self, ea, CPU_Z80_EA_SINK);
break;
case 0x2f:
cpu_z80_sra(self, ea, CPU_Z80_EA_A);
cpu_z80_sll(self, ea, CPU_Z80_EA_L);
break;
case 0x36:
- cpu_z80_sll(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_sll(self, ea, CPU_Z80_EA_SINK);
break;
case 0x37:
cpu_z80_sll(self, ea, CPU_Z80_EA_A);
cpu_z80_srl(self, ea, CPU_Z80_EA_L);
break;
case 0x3e:
- cpu_z80_srl(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_srl(self, ea, CPU_Z80_EA_SINK);
break;
case 0x3f:
cpu_z80_srl(self, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 0, ea, CPU_Z80_EA_L);
break;
case 0x86:
- cpu_z80_res(self, 0, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 0, ea, CPU_Z80_EA_SINK);
break;
case 0x87:
cpu_z80_res(self, 0, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 1, ea, CPU_Z80_EA_L);
break;
case 0x8e:
- cpu_z80_res(self, 1, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 1, ea, CPU_Z80_EA_SINK);
break;
case 0x8f:
cpu_z80_res(self, 1, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 2, ea, CPU_Z80_EA_L);
break;
case 0x96:
- cpu_z80_res(self, 2, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 2, ea, CPU_Z80_EA_SINK);
break;
case 0x97:
cpu_z80_res(self, 2, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 3, ea, CPU_Z80_EA_L);
break;
case 0x9e:
- cpu_z80_res(self, 3, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 3, ea, CPU_Z80_EA_SINK);
break;
case 0x9f:
cpu_z80_res(self, 3, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 4, ea, CPU_Z80_EA_L);
break;
case 0xa6:
- cpu_z80_res(self, 4, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 4, ea, CPU_Z80_EA_SINK);
break;
case 0xa7:
cpu_z80_res(self, 4, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 5, ea, CPU_Z80_EA_L);
break;
case 0xae:
- cpu_z80_res(self, 5, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 5, ea, CPU_Z80_EA_SINK);
break;
case 0xaf:
cpu_z80_res(self, 5, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 6, ea, CPU_Z80_EA_L);
break;
case 0xb6:
- cpu_z80_res(self, 6, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 6, ea, CPU_Z80_EA_SINK);
break;
case 0xb7:
cpu_z80_res(self, 6, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 7, ea, CPU_Z80_EA_L);
break;
case 0xbe:
- cpu_z80_res(self, 7, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 7, ea, CPU_Z80_EA_SINK);
break;
case 0xbf:
cpu_z80_res(self, 7, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 0, ea, CPU_Z80_EA_L);
break;
case 0xc6:
- cpu_z80_set(self, 0, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 0, ea, CPU_Z80_EA_SINK);
break;
case 0xc7:
cpu_z80_set(self, 0, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 1, ea, CPU_Z80_EA_L);
break;
case 0xce:
- cpu_z80_set(self, 1, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 1, ea, CPU_Z80_EA_SINK);
break;
case 0xcf:
cpu_z80_set(self, 1, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 2, ea, CPU_Z80_EA_L);
break;
case 0xd6:
- cpu_z80_set(self, 2, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 2, ea, CPU_Z80_EA_SINK);
break;
case 0xd7:
cpu_z80_set(self, 2, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 3, ea, CPU_Z80_EA_L);
break;
case 0xde:
- cpu_z80_set(self, 3, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 3, ea, CPU_Z80_EA_SINK);
break;
case 0xdf:
cpu_z80_set(self, 3, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 4, ea, CPU_Z80_EA_L);
break;
case 0xe6:
- cpu_z80_set(self, 4, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 4, ea, CPU_Z80_EA_SINK);
break;
case 0xe7:
cpu_z80_set(self, 4, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 5, ea, CPU_Z80_EA_L);
break;
case 0xee:
- cpu_z80_set(self, 5, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 5, ea, CPU_Z80_EA_SINK);
break;
case 0xef:
cpu_z80_set(self, 5, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 6, ea, CPU_Z80_EA_L);
break;
case 0xf6:
- cpu_z80_set(self, 6, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 6, ea, CPU_Z80_EA_SINK);
break;
case 0xf7:
cpu_z80_set(self, 6, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 7, ea, CPU_Z80_EA_L);
break;
case 0xfe:
- cpu_z80_set(self, 7, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 7, ea, CPU_Z80_EA_SINK);
break;
case 0xff:
cpu_z80_set(self, 7, ea, CPU_Z80_EA_A);
cpu_z80_rld(self);
break;
case 0x70:
- cpu_z80_in_test(self, CPU_Z80_EA_NONE, cpu_z80_in_byte(self, self->regs.word.bc));
+ cpu_z80_in_test(self, CPU_Z80_EA_SINK, cpu_z80_in_byte(self, self->regs.word.bc));
break;
case 0x71:
cpu_z80_out(self, self->regs.word.bc, 0);
cpu_z80_rlc(self, ea, CPU_Z80_EA_L);
break;
case 0x06:
- cpu_z80_rlc(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_rlc(self, ea, CPU_Z80_EA_SINK);
break;
case 0x07:
cpu_z80_rlc(self, ea, CPU_Z80_EA_A);
cpu_z80_rrc(self, ea, CPU_Z80_EA_L);
break;
case 0x0e:
- cpu_z80_rrc(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_rrc(self, ea, CPU_Z80_EA_SINK);
break;
case 0x0f:
cpu_z80_rrc(self, ea, CPU_Z80_EA_A);
cpu_z80_rl(self, ea, CPU_Z80_EA_L);
break;
case 0x16:
- cpu_z80_rl(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_rl(self, ea, CPU_Z80_EA_SINK);
break;
case 0x17:
cpu_z80_rl(self, ea, CPU_Z80_EA_A);
cpu_z80_rr(self, ea, CPU_Z80_EA_L);
break;
case 0x1e:
- cpu_z80_rr(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_rr(self, ea, CPU_Z80_EA_SINK);
break;
case 0x1f:
cpu_z80_rr(self, ea, CPU_Z80_EA_A);
cpu_z80_sla(self, ea, CPU_Z80_EA_L);
break;
case 0x26:
- cpu_z80_sla(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_sla(self, ea, CPU_Z80_EA_SINK);
break;
case 0x27:
cpu_z80_sla(self, ea, CPU_Z80_EA_A);
cpu_z80_sra(self, ea, CPU_Z80_EA_L);
break;
case 0x2e:
- cpu_z80_sra(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_sra(self, ea, CPU_Z80_EA_SINK);
break;
case 0x2f:
cpu_z80_sra(self, ea, CPU_Z80_EA_A);
cpu_z80_sll(self, ea, CPU_Z80_EA_L);
break;
case 0x36:
- cpu_z80_sll(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_sll(self, ea, CPU_Z80_EA_SINK);
break;
case 0x37:
cpu_z80_sll(self, ea, CPU_Z80_EA_A);
cpu_z80_srl(self, ea, CPU_Z80_EA_L);
break;
case 0x3e:
- cpu_z80_srl(self, ea, CPU_Z80_EA_NONE);
+ cpu_z80_srl(self, ea, CPU_Z80_EA_SINK);
break;
case 0x3f:
cpu_z80_srl(self, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 0, ea, CPU_Z80_EA_L);
break;
case 0x86:
- cpu_z80_res(self, 0, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 0, ea, CPU_Z80_EA_SINK);
break;
case 0x87:
cpu_z80_res(self, 0, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 1, ea, CPU_Z80_EA_L);
break;
case 0x8e:
- cpu_z80_res(self, 1, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 1, ea, CPU_Z80_EA_SINK);
break;
case 0x8f:
cpu_z80_res(self, 1, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 2, ea, CPU_Z80_EA_L);
break;
case 0x96:
- cpu_z80_res(self, 2, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 2, ea, CPU_Z80_EA_SINK);
break;
case 0x97:
cpu_z80_res(self, 2, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 3, ea, CPU_Z80_EA_L);
break;
case 0x9e:
- cpu_z80_res(self, 3, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 3, ea, CPU_Z80_EA_SINK);
break;
case 0x9f:
cpu_z80_res(self, 3, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 4, ea, CPU_Z80_EA_L);
break;
case 0xa6:
- cpu_z80_res(self, 4, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 4, ea, CPU_Z80_EA_SINK);
break;
case 0xa7:
cpu_z80_res(self, 4, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 5, ea, CPU_Z80_EA_L);
break;
case 0xae:
- cpu_z80_res(self, 5, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 5, ea, CPU_Z80_EA_SINK);
break;
case 0xaf:
cpu_z80_res(self, 5, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 6, ea, CPU_Z80_EA_L);
break;
case 0xb6:
- cpu_z80_res(self, 6, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 6, ea, CPU_Z80_EA_SINK);
break;
case 0xb7:
cpu_z80_res(self, 6, ea, CPU_Z80_EA_A);
cpu_z80_res(self, 7, ea, CPU_Z80_EA_L);
break;
case 0xbe:
- cpu_z80_res(self, 7, ea, CPU_Z80_EA_NONE);
+ cpu_z80_res(self, 7, ea, CPU_Z80_EA_SINK);
break;
case 0xbf:
cpu_z80_res(self, 7, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 0, ea, CPU_Z80_EA_L);
break;
case 0xc6:
- cpu_z80_set(self, 0, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 0, ea, CPU_Z80_EA_SINK);
break;
case 0xc7:
cpu_z80_set(self, 0, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 1, ea, CPU_Z80_EA_L);
break;
case 0xce:
- cpu_z80_set(self, 1, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 1, ea, CPU_Z80_EA_SINK);
break;
case 0xcf:
cpu_z80_set(self, 1, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 2, ea, CPU_Z80_EA_L);
break;
case 0xd6:
- cpu_z80_set(self, 2, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 2, ea, CPU_Z80_EA_SINK);
break;
case 0xd7:
cpu_z80_set(self, 2, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 3, ea, CPU_Z80_EA_L);
break;
case 0xde:
- cpu_z80_set(self, 3, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 3, ea, CPU_Z80_EA_SINK);
break;
case 0xdf:
cpu_z80_set(self, 3, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 4, ea, CPU_Z80_EA_L);
break;
case 0xe6:
- cpu_z80_set(self, 4, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 4, ea, CPU_Z80_EA_SINK);
break;
case 0xe7:
cpu_z80_set(self, 4, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 5, ea, CPU_Z80_EA_L);
break;
case 0xee:
- cpu_z80_set(self, 5, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 5, ea, CPU_Z80_EA_SINK);
break;
case 0xef:
cpu_z80_set(self, 5, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 6, ea, CPU_Z80_EA_L);
break;
case 0xf6:
- cpu_z80_set(self, 6, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 6, ea, CPU_Z80_EA_SINK);
break;
case 0xf7:
cpu_z80_set(self, 6, ea, CPU_Z80_EA_A);
cpu_z80_set(self, 7, ea, CPU_Z80_EA_L);
break;
case 0xfe:
- cpu_z80_set(self, 7, ea, CPU_Z80_EA_NONE);
+ cpu_z80_set(self, 7, ea, CPU_Z80_EA_SINK);
break;
case 0xff:
cpu_z80_set(self, 7, ea, CPU_Z80_EA_A);