26 static Uint8 z180_ports[0x40];
27 static int z180_incompatibility_reported = 0;
31 static const Uint8 _z180_ports_default[0x40] = {
32 0x10, 0x00, 0x27, 0x07, 0x04, 0x02, 0xFF, 0xFF,
33 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
34 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
35 0x7A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x80,
36 0x00, 0xFE, 0x00, 0x00, 0xFE, 0x00, 0x00, 0xFE,
37 0x00, 0xFE, 0x00, 0x00, 0xFE, 0x00, 0x00, 0xFE,
38 0x32, 0xC1, 0x00, 0x00, 0x39, 0xFF, 0xFC, 0xFF,
39 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F
46 z180_ports[0x34] = (z180_ports[0x34] & 0x3F) | itc76;
47 DEBUG(
"Z180: setting ICT register to: %02Xh" NL, z180_ports[0x34]);
48 DEBUG(
"Z180: Invalid Z180 opcode <prefix=%02Xh series=%02Xh opcode=%02Xh> at PC=%04Xh [%02Xh:%04Xh]" NL,
49 prefix, series, opcode,
51 ports[0xB0 | (
pc >> 14)],
54 if (z180_incompatibility_reported)
return;
55 z180_incompatibility_reported = 1;
56 INFO_WINDOW(
"Z180: Invalid Z180 opcode <prefix=%02Xh series=%02Xh opcode=%02Xh> at PC=%04Xh [%02Xh:%04Xh]\nThere will be NO further error reports about this kind of problem to avoid window flooding :)",
57 prefix, series, opcode,
59 ports[0xB0 | (
pc >> 14)],
65 void z180_internal_reset (
void )
68 memcpy(z180_ports, _z180_ports_default, 0x40);
69 z180_incompatibility_reported = 0;
77 DEBUG(
"Z180: write internal port (%02Xh/%02Xh) data = %02Xh" NL, port, port | z180_port_start,
value);
80 value = (z180_ports[port] & 0x07) | 0x38;
83 z180_port_start =
value & 0xC0;
84 DEBUG(
"Z180: internal ports are moved to %02Xh-%02Xh" NL, z180_port_start, z180_port_start + 0x3F);
88 z180_ports[port] =
value;
94 DEBUG(
"Z180: read internal port (%02Xh/%02Xh)" NL, port, port | z180_port_start);
95 return z180_ports[port];