- don't read from secure area buffer for ROMs with GBA Loader;
- fix declare importData function in BackupDevice class;
This commit is contained in:
mtabachenko 2013-11-09 20:49:42 +00:00
parent 4700d63db8
commit 95d32bc4d2
3 changed files with 5 additions and 4 deletions

View File

@ -488,8 +488,9 @@ void GameInfo::closeROM()
u32 GameInfo::readROM(u32 pos) u32 GameInfo::readROM(u32 pos)
{ {
//TODO - this should not be done here! it's a property of the slot-1 device, not the rom! //TODO - this should not be done here! it's a property of the slot-1 device, not the rom!
if ((pos < 0x8000) && (pos >= 0x4000)) //required only for FAKE boot
return *(u32*)(secureArea + (pos - 0x4000)); if ((romType == ROM_NDS) && (pos < 0x8000) && (pos >= 0x4000))
return *(u32*)(secureArea + (pos - 0x4000));
if (!romdata) if (!romdata)
{ {

View File

@ -42,7 +42,7 @@ u32 Slot1Comp_Rom::read()
{ {
//see B7 for details //see B7 for details
address &= gameInfo.mask; //sanity check address &= gameInfo.mask; //sanity check
u32 ret = gameInfo.readROM(address); u32 ret = *(u32*)(gameInfo.secureArea + (address - 0x4000));
address = (address&~0xFFF) + ((address+4)&0xFFF); address = (address&~0xFFF) + ((address+4)&0xFFF);
return ret; return ret;
} }

View File

@ -122,7 +122,7 @@ public:
bool isMovieMode; bool isMovieMode;
u32 importDataSize(const char *filename); u32 importDataSize(const char *filename);
u32 importData(const char *filename, u32 force_size); u32 importData(const char *filename, u32 force_size = 0);
bool exportData(const char *filename); bool exportData(const char *filename);
private: private:
void detect(); void detect();