DS Slot-1: Add PW flash command

This commit is contained in:
Vicki Pfau 2017-02-27 01:43:13 -08:00
parent 1d89cb9ba0
commit e7d6cba361
1 changed files with 10 additions and 2 deletions

View File

@ -264,13 +264,21 @@ static uint8_t _slot1SPIFlash(struct DSCommon* dscore, uint8_t datum) {
}
}
uint8_t oldValue;
switch (dscore->p->memory.slot1.spiCommand) {
case 0x03: // RD
return dscore->p->memory.slot1.spiData[dscore->p->memory.slot1.spiAddress++];
case 0x02: // WR
oldValue = dscore->p->memory.slot1.spiData[dscore->p->memory.slot1.spiAddress];
++dscore->p->memory.slot1.spiAddress;
return oldValue;
case 0x02: // PP
dscore->p->memory.slot1.spiData[dscore->p->memory.slot1.spiAddress] = datum;
++dscore->p->memory.slot1.spiAddress;
break;
case 0x0A: // PW
oldValue = dscore->p->memory.slot1.spiData[dscore->p->memory.slot1.spiAddress];
dscore->p->memory.slot1.spiData[dscore->p->memory.slot1.spiAddress] = datum;
++dscore->p->memory.slot1.spiAddress;
return oldValue;
default:
mLOG(DS_SLOT1, STUB, "Unimplemented SPI Flash write: %04X:%02X:%02X", control, dscore->p->memory.slot1.spiCommand, datum);
break;