DS SPI: Stub out SPI

This commit is contained in:
Vicki Pfau 2017-02-20 13:28:41 -08:00
parent 3cc8926251
commit f6065d3ab4
2 changed files with 13 additions and 17 deletions

View File

@ -104,23 +104,9 @@ enum DS7IORegisters {
DS7_REG_EXTKEYIN = 0x136,
DS7_REG_RTC = 0x138,
// Game card
DS7_REG_AUXSPICNT = 0x1A0,
DS7_REG_AUXSPIDATA = 0x1A2,
DS7_REG_SLOT1CNT_LO = 0x1A4,
DS7_REG_SLOT1CNT_HI = 0x1A6,
DS7_REG_SLOT1CMD_0 = 0x1A8,
DS7_REG_SLOT1CMD_1 = 0x1A9,
DS7_REG_SLOT1CMD_2 = 0x1AA,
DS7_REG_SLOT1CMD_3 = 0x1AB,
DS7_REG_SLOT1CMD_4 = 0x1AC,
DS7_REG_SLOT1CMD_5 = 0x1AD,
DS7_REG_SLOT1CMD_6 = 0x1AE,
DS7_REG_SLOT1CMD_7 = 0x1AF,
DS7_REG_SLOT1DATA_0 = 0x100010,
DS7_REG_SLOT1DATA_1 = 0x100011,
DS7_REG_SLOT1DATA_2 = 0x100012,
DS7_REG_SLOT1DATA_3 = 0x100013,
// SPI
DS7_REG_SPICNT = 0x1C0,
DS7_REG_SPIDATA = 0x1C2,
// Etc
DS7_REG_EXMEMSTAT = 0x204,

View File

@ -8,6 +8,7 @@
#include <mgba/core/interface.h>
#include <mgba/internal/ds/ds.h>
#include <mgba/internal/ds/ipc.h>
#include <mgba/internal/ds/spi.h>
mLOG_DEFINE_CATEGORY(DS_IO, "DS I/O");
@ -168,6 +169,13 @@ void DS7IOInit(struct DS* ds) {
void DS7IOWrite(struct DS* ds, uint32_t address, uint16_t value) {
switch (address) {
case DS7_REG_SPICNT:
value &= 0xCF83;
value = DSSPIWriteControl(ds, value);
break;
case DS7_REG_SPIDATA:
DSSPIWrite(ds, value);
return;
default:
{
uint32_t v2 = DSIOWrite(&ds->ds7, address, value);
@ -280,6 +288,8 @@ uint16_t DS7IORead(struct DS* ds, uint32_t address) {
case DS_REG_TM1CNT_HI:
case DS_REG_TM2CNT_HI:
case DS_REG_TM3CNT_HI:
case DS7_REG_SPICNT:
case DS7_REG_SPIDATA:
case DS_REG_IPCSYNC:
case DS_REG_IPCFIFOCNT:
case DS_REG_IME: