Wii: Allow loading of more than one game

This commit is contained in:
Jeffrey Pfau 2015-08-23 02:11:02 -07:00
parent 1525eee8d2
commit f6731d50ea
1 changed files with 99 additions and 98 deletions

View File

@ -165,6 +165,7 @@ int main() {
blip_set_rates(context.gba->audio.right, GBA_ARM7TDMI_FREQUENCY, 48000);
#endif
while (true) {
char path[256];
guOrtho(proj, -20, 240, 0, 352, 0, 300);
GX_LoadProjectionMtx(proj, GX_ORTHOGRAPHIC);
@ -174,9 +175,7 @@ int main() {
font, _drawStart, _drawEnd, _pollInput
};
if (!selectFile(&params, "/", path, sizeof(path), "gba") || !GBAWiiLoadGame(path)) {
free(renderer.outputBuffer);
GUIFontDestroy(font);
return 1;
break;
}
GBAContextStart(&context);
@ -184,7 +183,7 @@ int main() {
GX_LoadProjectionMtx(proj, GX_ORTHOGRAPHIC);
while (true) {
#if RESAMPLE_LIBRARY == RESAMPLE_BLIP_BUF
#if RESAMPLE_LIBRARY == RESAMPLE_BLIP_BUF
int available = blip_samples_avail(context.gba->audio.left);
if (available + audioBufferSize > SAMPLES) {
available = SAMPLES - audioBufferSize;
@ -199,7 +198,7 @@ int main() {
_audioDMA();
AUDIO_StartDMA();
}
#endif
#endif
PAD_ScanPads();
u16 padkeys = PAD_ButtonsHeld(0);
WPAD_ScanPads();
@ -267,11 +266,13 @@ int main() {
}
GBAContextFrame(&context, keys);
}
AUDIO_StopDMA();
GBAContextStop(&context);
}
fclose(logfile);
free(fifo);
GBAContextStop(&context);
GBAContextDeinit(&context);
free(renderer.outputBuffer);