mirror of
https://codeberg.org/sethm/symon.git
synced 2026-11-08 03:12:23 +00:00
more accurate emulation of the SD controller
This commit is contained in:
1 parent
7cb4e1c945
commit
c61a63d5bb
1 file changed
+9
-7
@@ -111,12 +111,6 @@ public class SdController extends Device {
|
|||||||
return readData();
|
return readData();
|
||||||
case 1:
|
case 1:
|
||||||
return readStatus();
|
return readStatus();
|
||||||
case 2:
|
|
||||||
return lba0;
|
|
||||||
case 3:
|
|
||||||
return lba1;
|
|
||||||
case 4:
|
|
||||||
return lba2;
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -129,8 +123,16 @@ public class SdController extends Device {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int readData() {
|
private int readData() {
|
||||||
|
if(status != Status.READ) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
this.position %= this.sdcontent.length;
|
this.position %= this.sdcontent.length;
|
||||||
return this.sdcontent[this.position++];
|
int data = this.sdcontent[this.position++];
|
||||||
|
if(this.position % 512 == 0) {
|
||||||
|
this.status = Status.IDLE;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeData(int data) {
|
private void writeData(int data) {
|
||||||
|
|||||||
Reference in new issue
Block a user