mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Handle low/high switches.
This commit is contained in:
parent
931e6e7a56
commit
acdf32e820
@ -152,6 +152,7 @@ class i8255PortHandler : public Intel::i8255::PortHandler {
|
|||||||
void set_value(int port, uint8_t value) {
|
void set_value(int port, uint8_t value) {
|
||||||
switch(port) {
|
switch(port) {
|
||||||
case 1:
|
case 1:
|
||||||
|
high_switches_ = value & 0x08;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
printf("PPI: %02x to %d\n", value, port);
|
printf("PPI: %02x to %d\n", value, port);
|
||||||
@ -159,21 +160,31 @@ class i8255PortHandler : public Intel::i8255::PortHandler {
|
|||||||
|
|
||||||
uint8_t get_value(int port) {
|
uint8_t get_value(int port) {
|
||||||
switch(port) {
|
switch(port) {
|
||||||
// TODO: returned value should depend on 'PBSW', a value written... somewhere?
|
|
||||||
case 2:
|
case 2:
|
||||||
|
// Common:
|
||||||
|
//
|
||||||
// b7: 1 => memory parity error; 0 => none;
|
// b7: 1 => memory parity error; 0 => none;
|
||||||
// b6: 1 => IO channel error; 0 => none;
|
// b6: 1 => IO channel error; 0 => none;
|
||||||
// b5: timer 2 output; [TODO]
|
// b5: timer 2 output; [TODO]
|
||||||
// b4: cassette data input; [TODO]
|
// b4: cassette data input; [TODO]
|
||||||
// b3, b2: RAM on motherboard (64 * bit pattern)
|
return
|
||||||
// b1: 1 => FPU present; 0 => absent;
|
high_switches_ ?
|
||||||
// b0: 1 => floppy drive present; 0 => absent.
|
// b3, b2: drive count; 00 = 1, 01 = 2, etc
|
||||||
return 0b0000'1100;
|
// b1, b0: video mode (00 = ROM; 01 = CGA40; 10 = CGA80; 11 = MDA)
|
||||||
|
0b0000'0011
|
||||||
|
:
|
||||||
|
// b3, b2: RAM on motherboard (64 * bit pattern)
|
||||||
|
// b1: 1 => FPU present; 0 => absent;
|
||||||
|
// b0: 1 => floppy drive present; 0 => absent.
|
||||||
|
0b0000'1100;
|
||||||
}
|
}
|
||||||
printf("PPI: from %d\n", port);
|
printf("PPI: from %d\n", port);
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool high_switches_ = false;
|
||||||
|
|
||||||
// Provisionally, possibly:
|
// Provisionally, possibly:
|
||||||
//
|
//
|
||||||
// port 0 = keyboard data output buffer;
|
// port 0 = keyboard data output buffer;
|
||||||
|
Loading…
Reference in New Issue
Block a user