mirror of
https://github.com/rvtr/GodMode9i.git
synced 2025-11-02 00:11:07 -04:00
Make sure cart is inserted correctly before mounting flashcard
This commit is contained in:
parent
7721df24c4
commit
1c99a3a613
@ -11,6 +11,8 @@ static sNDSHeader nds;
|
|||||||
|
|
||||||
u8 stored_SCFG_MC = 0;
|
u8 stored_SCFG_MC = 0;
|
||||||
|
|
||||||
|
static bool slot1Enabled = true;
|
||||||
|
|
||||||
bool sdMounted = false;
|
bool sdMounted = false;
|
||||||
bool sdMountedDone = false; // true if SD mount is successful once
|
bool sdMountedDone = false; // true if SD mount is successful once
|
||||||
bool flashcardMounted = false;
|
bool flashcardMounted = false;
|
||||||
@ -137,10 +139,23 @@ TWL_CODE bool twl_flashcardMount(void) {
|
|||||||
sysSetCardOwner (BUS_OWNER_ARM9);
|
sysSetCardOwner (BUS_OWNER_ARM9);
|
||||||
|
|
||||||
// Reset Slot-1 to allow reading title name and ID
|
// Reset Slot-1 to allow reading title name and ID
|
||||||
disableSlot1();
|
if (slot1Enabled) {
|
||||||
for(int i = 0; i < 25; i++) { swiWaitForVBlank(); }
|
disableSlot1();
|
||||||
enableSlot1();
|
for(int i = 0; i < 25; i++) { swiWaitForVBlank(); }
|
||||||
for(int i = 0; i < 15; i++) { swiWaitForVBlank(); }
|
slot1Enabled = false;
|
||||||
|
}
|
||||||
|
if (appInited) {
|
||||||
|
for(int i = 0; i < 35; i++) { swiWaitForVBlank(); } // Make sure cart is inserted correctly
|
||||||
|
}
|
||||||
|
if (REG_SCFG_MC == 0x11) {
|
||||||
|
sysSetCardOwner (BUS_OWNER_ARM7);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!slot1Enabled) {
|
||||||
|
enableSlot1();
|
||||||
|
for(int i = 0; i < 15; i++) { swiWaitForVBlank(); }
|
||||||
|
slot1Enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
nds.gameCode[0] = 0;
|
nds.gameCode[0] = 0;
|
||||||
nds.gameTitle[0] = 0;
|
nds.gameTitle[0] = 0;
|
||||||
|
|||||||
@ -40,6 +40,8 @@ char titleName[32] = {" "};
|
|||||||
|
|
||||||
int screenMode = 0;
|
int screenMode = 0;
|
||||||
|
|
||||||
|
bool appInited = false;
|
||||||
|
|
||||||
bool arm7SCFGLocked = false;
|
bool arm7SCFGLocked = false;
|
||||||
bool isRegularDS = true;
|
bool isRegularDS = true;
|
||||||
bool is3DS = true;
|
bool is3DS = true;
|
||||||
@ -150,6 +152,8 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
keysSetRepeat(25,5);
|
keysSetRepeat(25,5);
|
||||||
|
|
||||||
|
appInited = true;
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
|
||||||
if (screenMode == 0) {
|
if (screenMode == 0) {
|
||||||
|
|||||||
@ -8,6 +8,8 @@ extern char titleName[32];
|
|||||||
|
|
||||||
extern int screenMode;
|
extern int screenMode;
|
||||||
|
|
||||||
|
extern bool appInited;
|
||||||
|
|
||||||
extern bool arm7SCFGLocked;
|
extern bool arm7SCFGLocked;
|
||||||
extern bool isRegularDS;
|
extern bool isRegularDS;
|
||||||
extern bool is3DS;
|
extern bool is3DS;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user