NTR_Launcher/arm9/common/audio.twl.cpp
ApacheThunder de31f9cb2b 1.3 Refactor
* Added DSOnei kernel to included nds files for Stage2 menu.
* Added N-Card rom dump to included nds files for Stage2 menu.
* Added CycloDS, and DSTWo bootloader dumps to included nds files for
Stage2 menu.
* DSTwo now boots correctly from cart launcher.
* R4 SDHC Gold and other similar DEMON time bomb DSTTi clones now boot
correctly from cart launcher.
* Added back option for enabling/disabling TWL ram.
* Added fixes to allow DS only carts to run with TWL ram enabled.
* Initial modcrypt code added for TWL carts. Currently works in
emulation however TWL carts will fail to boot on hardware (when twl
mode, ram, etc is enabled).
* If TWL mode and ram is enabled, cart loader will now load the DSi
extended binaries into ram. Currently however they will only boot in
emulation. Have not resolved why it's not working on hardware yet.
* Stage2 menu now allowed to load dsi extended binaries of SRLs if TWL
mode and TWL ram is enabled. Booting rom dumps as a method of booting
into TWL carts is confirmed working. At least for System Flaw it does.
:D
* Despite the improvents Acekard 2i still appears to require using the
stage2 menu to boot into.
* Fixes that allowed Demon timebomb carts to boot from cart
launcher/autoboot may allow other non working carts to work. Further
testing needed.
2024-11-27 21:50:32 -06:00

125 lines
2.6 KiB
C++

/*
NitroHax -- Cheat tool for the Nintendo DS
Copyright (C) 2008 Michael "Chishm" Chisholm
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stddef.h>
#include <nds.h>
#include <maxmod9.h>
#include "soundbank.h"
#include "soundbank_bin.h"
static mm_sound_effect dsboot;
static mm_sound_effect dsiboot;
static mm_sound_effect sfxBack;
static mm_sound_effect sfxLaunch;
static mm_sound_effect sfxSelect;
static mm_sound_effect sfxWrong;
static bool audioReady = false;
void InitAudio() {
mmInitDefaultMem((mm_addr)soundbank_bin);
mmLoadEffect( SFX_DSBOOT );
mmLoadEffect( SFX_DSIBOOT );
mmLoadEffect( SFX_BACK );
mmLoadEffect( SFX_LAUNCH );
mmLoadEffect( SFX_SELECT );
mmLoadEffect( SFX_WRONG );
dsiboot = {
{ SFX_DSIBOOT } , // id
(int)(1.0f * (1<<10)), // rate
0, // handle
255, // volume
128, // panning
};
dsboot = {
{ SFX_DSBOOT } , // id
(int)(1.0f * (1<<10)), // rate
0, // handle
255, // volume
128, // panning
};
sfxBack = {
{ SFX_BACK } , // id
(int)(1.0f * (1<<10)), // rate
0, // handle
255, // volume
128, // panning
};
sfxLaunch = {
{ SFX_LAUNCH } , // id
(int)(1.0f * (1<<10)), // rate
0, // handle
255, // volume
128, // panning
};
sfxSelect = {
{ SFX_SELECT } , // id
(int)(1.0f * (1<<10)), // rate
0, // handle
255, // volume
128, // panning
};
sfxWrong = {
{ SFX_WRONG } , // id
(int)(1.0f * (1<<10)), // rate
0, // handle
255, // volume
128, // panning
};
audioReady = true;
}
void PlayBootJingle() {
if (!audioReady)InitAudio();
mmEffectEx(&dsboot);
}
void PlayBootJingleDSi() {
if (!audioReady)InitAudio();
mmEffectEx(&dsiboot);
}
void PlayLaunchSFX() {
if (!audioReady)InitAudio();
mmEffectEx(&sfxLaunch);
}
void PlayWrongSFX() {
if (!audioReady)InitAudio();
mmEffectEx(&sfxWrong);
}
void PlaySelectSFX() {
if (!audioReady)InitAudio();
mmEffectEx(&sfxSelect);
}
void PlayBackSFX() {
if (!audioReady)InitAudio();
mmEffectEx(&sfxBack);
}