mirror of
https://github.com/switchbrew/switch-examples.git
synced 2025-07-01 09:12:14 +02:00
romfs added
This commit is contained in:
parent
3c3a0b3f5a
commit
1fbda95f43
@ -42,7 +42,7 @@ BUILD := build
|
|||||||
SOURCES := source
|
SOURCES := source
|
||||||
DATA := data
|
DATA := data
|
||||||
INCLUDES := include
|
INCLUDES := include
|
||||||
#ROMFS := romfs
|
ROMFS := romfs
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# options for code generation
|
# options for code generation
|
||||||
|
BIN
audio/sdl2-audio/romfs/test.mp3
Normal file
BIN
audio/sdl2-audio/romfs/test.mp3
Normal file
Binary file not shown.
@ -17,7 +17,13 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
consoleInit(NULL);
|
consoleInit(NULL);
|
||||||
|
|
||||||
printf("Press A button to play the sound!\n");
|
|
||||||
|
Result rc = romfsInit();
|
||||||
|
if (R_FAILED(rc))
|
||||||
|
printf("romfsInit: %08X\n", rc);
|
||||||
|
|
||||||
|
else
|
||||||
|
printf("Press A button to play the sound!\n");
|
||||||
|
|
||||||
// Start SDL with audio support
|
// Start SDL with audio support
|
||||||
SDL_Init(SDL_INIT_AUDIO);
|
SDL_Init(SDL_INIT_AUDIO);
|
||||||
@ -30,7 +36,8 @@ int main(int argc, char* argv[])
|
|||||||
Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 4096);
|
Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 4096);
|
||||||
|
|
||||||
// Load sound file to use
|
// Load sound file to use
|
||||||
Mix_Music *audio = Mix_LoadMUS("test.mp3");
|
//Sound from https://freesound.org/people/jens.enk/sounds/434610/
|
||||||
|
Mix_Music *audio = Mix_LoadMUS("romfs:/test.mp3");
|
||||||
|
|
||||||
// Main loop
|
// Main loop
|
||||||
while (appletMainLoop())
|
while (appletMainLoop())
|
||||||
|
Loading…
Reference in New Issue
Block a user