annotate what parts of the NDSCart module are used from outside.

also might want to support ROM writing on both ARM9 and ARM7 and properly check EXMEMCNT.
This commit is contained in:
Arisotura 2021-04-10 20:04:00 +02:00
parent af3fa1236e
commit 150ce7af61
2 changed files with 30 additions and 26 deletions

View File

@ -3528,7 +3528,7 @@ void ARM9IOWrite32(u32 addr, u32 val)
return;
case 0x04100010:
NDSCart::WriteROMData(val);
if (!(ExMemCnt[0] & (1<<11))) NDSCart::WriteROMData(val);
return;
}
@ -4074,6 +4074,10 @@ void ARM7IOWrite32(u32 addr, u32 val)
if (ARM7BIOSProt == 0)
ARM7BIOSProt = val & 0xFFFE;
return;
case 0x04100010:
if (ExMemCnt[0] & (1<<11)) NDSCart::WriteROMData(val);
return;
}
if (addr >= 0x04000400 && addr < 0x04000520)

View File

@ -34,49 +34,49 @@
namespace NDSCart
{
extern u16 SPICnt;
extern u32 ROMCnt;
extern u16 SPICnt; //
extern u32 ROMCnt; //
extern u8 ROMCommand[8];
extern u8 ROMCommand[8]; //
extern u32 ROMDataOut;
extern u8 EncSeed0[5];
extern u8 EncSeed1[5];
extern u8* CartROM;
extern u8* CartROM; // used only for header??
extern u32 CartROMSize;
extern u32 CartID;
extern u32 CartID; //
bool Init();
void DeInit();
void Reset();
bool Init(); //
void DeInit(); //
void Reset(); //
void DoSavestate(Savestate* file);
void DoSavestate(Savestate* file); //
void DecryptSecureArea(u8* out);
bool LoadROM(const char* path, const char* sram, bool direct);
bool LoadROM(const u8* romdata, u32 filelength, const char *sram, bool direct);
void DecryptSecureArea(u8* out); // direct-boot shito
bool LoadROM(const char* path, const char* sram, bool direct); //
bool LoadROM(const u8* romdata, u32 filelength, const char *sram, bool direct); //
void FlushSRAMFile();
void FlushSRAMFile(); //
void RelocateSave(const char* path, bool write);
void RelocateSave(const char* path, bool write); //
int ImportSRAM(const u8* data, u32 length);
int ImportSRAM(const u8* data, u32 length); //
void ResetCart();
void ResetCart(); //
void WriteROMCnt(u32 val);
u32 ReadROMData();
void WriteROMData(u32 val);
void WriteROMCnt(u32 val); //
u32 ReadROMData(); //
void WriteROMData(u32 val); //
void WriteSPICnt(u16 val);
u8 ReadSPIData();
void WriteSPIData(u8 val);
void WriteSPICnt(u16 val); //
u8 ReadSPIData(); //
void WriteSPIData(u8 val); //
void ROMPrepareData(u32 param);
void ROMEndTransfer(u32 param);
void SPITransferDone(u32 param);
void ROMPrepareData(u32 param); // scheduler callbacks
void ROMEndTransfer(u32 param); //
void SPITransferDone(u32 param); //
}