Skip to content

Commit

Permalink
Try to fix no sound bug again
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Aug 6, 2018
1 parent c30c45a commit 339ed82
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions titleandsettings/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
bool renderScreens = false;
bool fadeType = false; // false = out, true = in

bool soundfreqsettingChanged = false;

const char* settingsinipath = "/_nds/dsimenuplusplus/settings.ini";
const char* hiyacfwinipath = "sd:/hiya/settings.ini";
const char* bootstrapinipath = "sd:/_nds/nds-bootstrap.ini";
Expand Down Expand Up @@ -357,8 +359,10 @@ void loadROMselect() {
fadeType = false;
for (int i = 0; i < 30; i++) swiWaitForVBlank();
renderScreens = false;
if(soundfreq) fifoSendValue32(FIFO_USER_07, 2);
else fifoSendValue32(FIFO_USER_07, 1);
if (soundfreqsettingChanged) {
if(soundfreq) fifoSendValue32(FIFO_USER_07, 2);
else fifoSendValue32(FIFO_USER_07, 1);
}
if (theme==2) {
runNdsFile ("/_nds/dsimenuplusplus/r4menu.srldr", 0, NULL, false);
} else {
Expand All @@ -370,8 +374,10 @@ int lastRanROM() {
fadeType = false;
for (int i = 0; i < 30; i++) swiWaitForVBlank();
renderScreens = false;
if(soundfreq) fifoSendValue32(FIFO_USER_07, 2);
else fifoSendValue32(FIFO_USER_07, 1);
if (soundfreqsettingChanged) {
if(soundfreq) fifoSendValue32(FIFO_USER_07, 2);
else fifoSendValue32(FIFO_USER_07, 1);
}

vector<char*> argarray;
if (launchType > 2) {
Expand Down Expand Up @@ -499,6 +505,9 @@ int main(int argc, char **argv) {
if (arm7_SNDEXCNT != 0) soundfreqsetting = true;
fifoSendValue32(FIFO_USER_07, 0);

if(soundfreq) fifoSendValue32(FIFO_USER_07, 2);
else fifoSendValue32(FIFO_USER_07, 1);

scanKeys();

if (arm7SCFGLocked && !gotosettings && autorun && !(keysHeld() & KEY_B)) {
Expand All @@ -515,7 +524,7 @@ int main(int argc, char **argv) {
}

InitSound();

char vertext[12];
// snprintf(vertext, sizeof(vertext), "Ver %d.%d.%d ", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); // Doesn't work :(
snprintf(vertext, sizeof(vertext), "Ver %d.%d.%d ", 5, 4, 0);
Expand Down Expand Up @@ -1044,6 +1053,7 @@ int main(int argc, char **argv) {
break;
case 5:
soundfreq = !soundfreq;
soundfreqsettingChanged = !soundfreqsettingChanged;
break;
case 6:
slot1LaunchMethod = !slot1LaunchMethod;
Expand All @@ -1068,8 +1078,12 @@ int main(int argc, char **argv) {
subscreenmode = 3;
break;
case 1:
if(soundfreqsetting) soundfreq = !soundfreq;
else useGbarunner = !useGbarunner;
if(soundfreqsetting) {
soundfreq = !soundfreq;
soundfreqsettingChanged = !soundfreqsettingChanged;
} else {
useGbarunner = !useGbarunner;
}
break;
}
}
Expand Down

0 comments on commit 339ed82

Please sign in to comment.