mirror of
https://github.com/sethm/symon.git
synced 2025-04-22 12:37:42 +00:00
more accurate emulation of the SD controller
This commit is contained in:
parent
7cb4e1c945
commit
c61a63d5bb
@ -111,12 +111,6 @@ public class SdController extends Device {
|
||||
return readData();
|
||||
case 1:
|
||||
return readStatus();
|
||||
case 2:
|
||||
return lba0;
|
||||
case 3:
|
||||
return lba1;
|
||||
case 4:
|
||||
return lba2;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@ -129,8 +123,16 @@ public class SdController extends Device {
|
||||
}
|
||||
|
||||
private int readData() {
|
||||
if(status != Status.READ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user