Fix NVRAM->Heathrow connection.

This commit is contained in:
Maxim Poliakovski 2020-01-08 19:33:38 +01:00
parent e1793b6305
commit a3601f224c

View File

@ -67,9 +67,9 @@ uint32_t HeathrowIC::read(uint32_t offset, int size)
cout << this->name << ": reading from offset " << hex << offset << endl; cout << this->name << ": reading from offset " << hex << offset << endl;
unsigned sub_dev = (offset >> 12) & 0x3F; unsigned sub_addr = (offset >> 12) & 0x7F;
switch(sub_dev) { switch(sub_addr) {
case 0: case 0:
res = mio_ctrl_read(offset, size); res = mio_ctrl_read(offset, size);
break; break;
@ -83,11 +83,12 @@ uint32_t HeathrowIC::read(uint32_t offset, int size)
case 0x17: case 0x17:
res = this->viacuda->read((offset - 0x16000) >> 9); res = this->viacuda->read((offset - 0x16000) >> 9);
break; break;
case 0x60:
case 0x70:
res = this->nvram->read_byte((offset - 0x60000) >> 4);
default: default:
cout << "unmapped I/O space: " << sub_dev << endl; if (sub_addr >= 0x60) {
res = this->nvram->read_byte((offset - 0x60000) >> 4);
} else {
cout << "unmapped I/O space: " << hex << offset << endl;
}
} }
return res; return res;
@ -97,9 +98,9 @@ void HeathrowIC::write(uint32_t offset, uint32_t value, int size)
{ {
cout << this->name << ": writing to offset " << hex << offset << endl; cout << this->name << ": writing to offset " << hex << offset << endl;
unsigned sub_dev = (offset >> 12) & 0x3F; unsigned sub_addr = (offset >> 12) & 0x7F;
switch(sub_dev) { switch(sub_addr) {
case 0: case 0:
mio_ctrl_write(offset, value, size); mio_ctrl_write(offset, value, size);
break; break;
@ -114,7 +115,11 @@ void HeathrowIC::write(uint32_t offset, uint32_t value, int size)
this->viacuda->write((offset - 0x16000) >> 9, value); this->viacuda->write((offset - 0x16000) >> 9, value);
break; break;
default: default:
cout << "unmapped I/O space: " << sub_dev << endl; if (sub_addr >= 0x60) {
this->nvram->write_byte((offset - 0x60000) >> 4, value);
} else {
cout << "unmapped I/O space: " << hex << offset << endl;
}
} }
} }