mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-11-15 17:08:19 +00:00
grandcentral: respect size when reading from IOBus devices.
This commit is contained in:
parent
078aa79270
commit
705dd390e9
@ -123,8 +123,10 @@ uint32_t GrandCentral::read(uint32_t rgn_start, uint32_t offset, int size)
|
|||||||
case 0xC: // IOBus dev #3
|
case 0xC: // IOBus dev #3
|
||||||
case 0xE: // IOBus dev #5
|
case 0xE: // IOBus dev #5
|
||||||
if (this->iobus_devs[subdev_num - 10] != nullptr) {
|
if (this->iobus_devs[subdev_num - 10] != nullptr) {
|
||||||
return BYTESWAP_16(this->iobus_devs[subdev_num - 10]->iodev_read(
|
uint32_t result = this->iobus_devs[subdev_num - 10]->iodev_read(
|
||||||
(offset >> 4) & 0x1F));
|
(offset >> 4) & 0x1F);
|
||||||
|
result &= 0xFFFFFFFFUL >> (4 - size) * 8; // strip unused bits
|
||||||
|
return BYTESWAP_SIZED(result, size);
|
||||||
} else {
|
} else {
|
||||||
LOG_F(ERROR, "GC: IOBus device #%d doesn't exist", subdev_num - 9);
|
LOG_F(ERROR, "GC: IOBus device #%d doesn't exist", subdev_num - 9);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user