27 static Uint8 z180_ports[0x40];
28 static int z180_incompatibility_reported = 0;
32 static const Uint8 _z180_ports_default[0x40] = {
33 0x10, 0x00, 0x27, 0x07, 0x04, 0x02, 0xFF, 0xFF,
34 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
35 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
36 0x7A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x80,
37 0x00, 0xFE, 0x00, 0x00, 0xFE, 0x00, 0x00, 0xFE,
38 0x00, 0xFE, 0x00, 0x00, 0xFE, 0x00, 0x00, 0xFE,
39 0x32, 0xC1, 0x00, 0x00, 0x39, 0xFF, 0xFC, 0xFF,
40 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F
47 z180_ports[0x34] = (z180_ports[0x34] & 0x3F) | itc76;
48 DEBUG(
"Z180: setting ICT register to: %02Xh" NL, z180_ports[0x34]);
49 DEBUG(
"Z180: Invalid Z180 opcode <prefix=%02Xh series=%02Xh opcode=%02Xh> at PC=%04Xh [%02Xh:%04Xh]" NL,
50 prefix, series, opcode,
52 ports[0xB0 | (
pc >> 14)],
55 if (z180_incompatibility_reported)
return;
56 z180_incompatibility_reported = 1;
57 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 :)",
58 prefix, series, opcode,
60 ports[0xB0 | (
pc >> 14)],
66 void z180_internal_reset (
void )
69 memcpy(z180_ports, _z180_ports_default, 0x40);
70 z180_incompatibility_reported = 0;
78 DEBUG(
"Z180: write internal port (%02Xh/%02Xh) data = %02Xh" NL, port, port | z180_port_start,
value);
81 value = (z180_ports[port] & 0x07) | 0x38;
84 z180_port_start =
value & 0xC0;
85 DEBUG(
"Z180: internal ports are moved to %02Xh-%02Xh" NL, z180_port_start, z180_port_start + 0x3F);
89 z180_ports[port] =
value;
95 DEBUG(
"Z180: read internal port (%02Xh/%02Xh)" NL, port, port | z180_port_start);
96 return z180_ports[port];