Skip to content

Commit 65c5d24

Browse files
joevtdingusdev
authored andcommitted
maciotwo: Fix IDE read/write mask.
1 parent f2676e0 commit 65c5d24

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

devices/ioctrl/maciotwo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ uint32_t MacIoTwo::read(uint32_t rgn_start, uint32_t offset, int size) {
110110
value = this->viacuda->read((offset >> 9) & 0xF);
111111
break;
112112
case 0x20: // IDE 0
113-
value = this->ide_0->read((offset >> 4) & 0x1F, size);
113+
value = this->ide_0->read((offset >> 4) & 0x3F, size);
114114
break;
115115
case 0x21: // IDE 1
116-
value = this->ide_1 ? this->ide_1->read((offset >> 4) & 0x1F, size) : 0;
116+
value = this->ide_1 ? this->ide_1->read((offset >> 4) & 0x3F, size) : 0;
117117
break;
118118
default:
119119
if (sub_addr >= 0x60) {
@@ -172,11 +172,11 @@ void MacIoTwo::write(uint32_t rgn_start, uint32_t offset, uint32_t value, int si
172172
this->viacuda->write((offset >> 9) & 0xF, value);
173173
break;
174174
case 0x20: // IDE 0
175-
this->ide_0->write((offset >> 4) & 0x1F, value, size);
175+
this->ide_0->write((offset >> 4) & 0x3F, value, size);
176176
break;
177177
case 0x21: // IDE 1
178178
if (this->ide_1)
179-
this->ide_1->write((offset >> 4) & 0x1F, value, size);
179+
this->ide_1->write((offset >> 4) & 0x3F, value, size);
180180
break;
181181
default:
182182
if (sub_addr >= 0x60) {

0 commit comments

Comments
 (0)