From 935497e4a0a9d47cb4c47d4b705c6120259113e3 Mon Sep 17 00:00:00 2001 From: Kei <7037851+coderkei@users.noreply.github.com> Date: Thu, 30 Jan 2025 21:41:45 +0000 Subject: [PATCH] Add card read DMA Add card read DMA --- arm9/source/globalsettings.cpp | 3 +++ arm9/source/globalsettings.h | 3 ++- arm9/source/launcher/NdsBootstrapLauncher.cpp | 6 ++++++ arm9/source/mainwnd.cpp | 10 +++++++--- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/arm9/source/globalsettings.cpp b/arm9/source/globalsettings.cpp index c0c0015..a23aa7c 100644 --- a/arm9/source/globalsettings.cpp +++ b/arm9/source/globalsettings.cpp @@ -40,6 +40,7 @@ cGlobalSettings::cGlobalSettings() { saveExt = true; saveDir = false; nightly = false; + cardDma = true; safeMode = false; show12hrClock = false; autorunWithLastRom = false; @@ -71,6 +72,7 @@ void cGlobalSettings::loadSettings() { saveDir = ini.GetInt("system", "savedir", saveDir); nightly = ini.GetInt("system", "nightly", nightly); dma = ini.GetInt("system", "dma", dma); + cardDma = ini.GetInt("system", "carddma", cardDma); sdsave = ini.GetInt("system", "sdsave", sdsave); safeMode = ini.GetInt("system", "safemode", safeMode); show12hrClock = ini.GetInt("system", "Show12hrClock", show12hrClock); @@ -119,6 +121,7 @@ void cGlobalSettings::saveSettings() { ini.SetInt("system", "cheats", cheats); ini.SetInt("system", "softreset", softreset); ini.SetInt("system", "dma", dma); + ini.SetInt("system", "carddma", cardDma); ini.SetInt("system", "sdsave", sdsave); ini.SetInt("system", "safemode", safeMode); ini.SetInt("system", "savedir", saveDir); diff --git a/arm9/source/globalsettings.h b/arm9/source/globalsettings.h index e8df93a..6c91b7e 100644 --- a/arm9/source/globalsettings.h +++ b/arm9/source/globalsettings.h @@ -53,13 +53,14 @@ class cGlobalSettings { bool Animation; bool cheats; bool softreset; - bool dma; + bool cardDma; bool sdsave; bool cheatDB; int slot2mode; bool saveExt; bool saveDir; bool nightly; + bool dma; bool safeMode; bool show12hrClock; bool autorunWithLastRom; diff --git a/arm9/source/launcher/NdsBootstrapLauncher.cpp b/arm9/source/launcher/NdsBootstrapLauncher.cpp index 7dda012..7ada945 100644 --- a/arm9/source/launcher/NdsBootstrapLauncher.cpp +++ b/arm9/source/launcher/NdsBootstrapLauncher.cpp @@ -69,6 +69,12 @@ bool NdsBootstrapLauncher::prepareIni() { CIniFile ini; ini.SetString("NDS-BOOTSTRAP", "NDS_PATH", mRomPath); ini.SetString("NDS-BOOTSTRAP", "SAV_PATH", mSavePath); + if(gs().cardDma){ + ini.SetInt("NDS-BOOTSTRAP", "CARD_READ_DMA", 1); + } + else{ + ini.SetInt("NDS-BOOTSTRAP", "CARD_READ_DMA", 0); + } ini.SaveIniFile("/_nds/nds-bootstrap.ini"); return true; diff --git a/arm9/source/mainwnd.cpp b/arm9/source/mainwnd.cpp index 2ef1eba..c2825b2 100644 --- a/arm9/source/mainwnd.cpp +++ b/arm9/source/mainwnd.cpp @@ -550,6 +550,10 @@ void cMainWnd::setParam(void) { _values.push_back(LANG("switches", "Disable")); _values.push_back(LANG("switches", "Enable")); settingWnd.addSettingItem(LANG("patches", "cheating system"), _values, gs().cheats); + _values.clear(); + _values.push_back(LANG("switches", "Disable")); + _values.push_back(LANG("switches", "Enable")); + settingWnd.addSettingItem(LANG("patches", "carddma"), _values, gs().cardDma); #ifdef __KERNEL_LAUNCHER_SUPPORT__ _values.clear(); _values.push_back("Kernel"); @@ -603,9 +607,9 @@ void cMainWnd::setParam(void) { // page 4: patches gs().cheats = settingWnd.getItemSelection(3, 0); - gs().softreset = settingWnd.getItemSelection(3, 1); - gs().homebrewreset = settingWnd.getItemSelection(3, 2); - gs().romLauncher = settingWnd.getItemSelection(3, 3); + gs().cardDma = settingWnd.getItemSelection(3, 1); + gs().softreset = settingWnd.getItemSelection(3, 2); + gs().homebrewreset = settingWnd.getItemSelection(3, 3); // page 5: gba gs().gbaSleepHack = settingWnd.getItemSelection(4, 0);