maxmod program hangs after pressing a key
Posted: Tue May 07, 2019 8:28 pm
read title
im sure what is wrong looks really obvious but im a noob so i dont see it
[mod edit: add code]
https://www.dropbox.com/s/ytpemyssacgecdc/arm9.7z?dl=0 here's download
(press start or select to change song, also desmume doesnt detect the key presses so use melonds or real hardware)
im sure what is wrong looks really obvious but im a noob so i dont see it
[mod edit: add code]
Code: Select all
#include <nds.h>
#include <maxmod9.h>
#include <stdio.h>
#include "soundbank.h"
#include "soundbank_bin.h"
int main() {
consoleDemoInit();
keyboardDemoInit();
mmInitDefaultMem((mm_addr)soundbank_bin);
int loadedsound = -1;
// load the module
//mmLoad( MOD_BB );
// load sound effects
// Start playing module
//mmStart( MOD_BB, MM_PLAY_LOOP );
while(1) {
swiWaitForVBlank();
scanKeys();
int pressed = keysDown();
//if(pressed & KEY_START) break;
if(pressed & KEY_START){
loadedsound = MOD_ENIGMA;
printf("Key pressed");
mmStop();
if(loadedsound != -1) mmUnload(loadedsound);
mmLoad(MOD_ENIGMA);
mmStart(MOD_ENIGMA, MM_PLAY_LOOP);
}
if(pressed & KEY_SELECT){
loadedsound = MOD_BB;
printf("Key pressed");
mmStop();
if(loadedsound != -1) mmUnload(loadedsound);
mmLoad(MOD_BB);
mmStart(MOD_BB, MM_PLAY_LOOP);
}
}
}
(press start or select to change song, also desmume doesnt detect the key presses so use melonds or real hardware)