1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-11 08:30:55 +00:00

Experimentally flipping interpretation of the output bit gives something closer to coherent.

This commit is contained in:
Thomas Harte 2021-01-25 22:02:39 -05:00
parent c8beb59172
commit fc4bda0047
2 changed files with 9 additions and 9 deletions

View File

@ -68,7 +68,7 @@ uint8_t Executor::read(uint16_t address) {
// "Port R"; sixteen four-bit ports // "Port R"; sixteen four-bit ports
case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7:
case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf: case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf:
printf("TODO: Port R [r %04x]\n", address); // printf("TODO: Port R [r %04x]\n", address);
return 0xff; return 0xff;
// Ports P0P3. // Ports P0P3.
@ -78,12 +78,12 @@ uint8_t Executor::read(uint16_t address) {
case 0xe1: case 0xe3: case 0xe1: case 0xe3:
case 0xe5: case 0xe9: case 0xe5: case 0xe9:
printf("TODO: Ports P0P3 direction [r %04x]\n", address); // printf("TODO: Ports P0P3 direction [r %04x]\n", address);
return 0xff; return 0xff;
// Timers. // Timers.
case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff:
printf("TODO: Timers [r %04x]\n", address); // printf("TODO: Timers [r %04x]\n", address);
return 0xff; return 0xff;
} }
} }
@ -104,7 +104,7 @@ void Executor::write(uint16_t address, uint8_t value) {
// "Port R"; sixteen four-bit ports // "Port R"; sixteen four-bit ports
case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7:
case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf: case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf:
printf("TODO: Port R [w %04x %02x]\n", address, value); // printf("TODO: Port R [w %04x %02x]\n", address, value);
break; break;
// Ports P0P3. // Ports P0P3.
@ -114,12 +114,12 @@ void Executor::write(uint16_t address, uint8_t value) {
case 0xe1: case 0xe3: case 0xe1: case 0xe3:
case 0xe5: case 0xe9: case 0xe5: case 0xe9:
printf("TODO: Ports P0P3 direction [w %04x %02x]\n", address, value); // printf("TODO: Ports P0P3 direction [w %04x %02x]\n", address, value);
break; break;
// Timers. // Timers.
case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff:
printf("TODO: Timers [w %04x %02x]\n", address, value); // printf("TODO: Timers [w %04x %02x]\n", address, value);
break; break;
} }
} }

View File

@ -229,7 +229,7 @@ void GLU::set_port_output(int port, uint8_t value) {
ports_[port] = value; ports_[port] = value;
switch(port) { switch(port) {
case 0: case 0:
printf("Set R%d: %02x\n", register_address_, value); // printf("Set R%d: %02x\n", register_address_, value);
registers_[register_address_] = value; registers_[register_address_] = value;
break; break;
case 1: case 1:
@ -247,7 +247,7 @@ void GLU::set_port_output(int port, uint8_t value) {
// printf("IIe KWS: %d\n", (value >> 6)&3); // printf("IIe KWS: %d\n", (value >> 6)&3);
// printf("ADB data line output: %d\n", (value >> 3)&1); // printf("ADB data line output: %d\n", (value >> 3)&1);
const bool new_adb_level = value & 0x08; const bool new_adb_level = !(value & 0x08);
if(new_adb_level != adb_level_) { if(new_adb_level != adb_level_) {
if(!new_adb_level) { if(!new_adb_level) {
// Transition to low. // Transition to low.
@ -278,7 +278,7 @@ void GLU::set_port_output(int port, uint8_t value) {
uint8_t GLU::get_port_input(int port) { uint8_t GLU::get_port_input(int port) {
switch(port) { switch(port) {
case 0: case 0:
printf("Get R%d\n", register_address_); // printf("Get R%d\n", register_address_);
return registers_[register_address_]; return registers_[register_address_];
case 1: case 1:
// printf("IIe keyboard read\n"); // printf("IIe keyboard read\n");