Skip to content

Commit 691154d

Browse files
committed
Bittboy port update, readme update, supported music formats detected dynamically
1 parent ab5019c commit 691154d

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

Makefile.bittboy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SRC = src/main.c src/data_persistence.c src/video.c src/sound.c \
88
OBJ = $(SRC:.c=.o)
99
DEP = $(SRC:.c=.d)
1010
CFLAGS = -Iinc -D_BITTBOY -Ofast -march=armv5te -mtune=arm926ej-s
11-
LDFLAGS = -s $(shell $(BIN_BASE)pkg-config --libs sdl SDL_image SDL_ttf SDL_mixer) -ljpeg -logg -lfreetype -lpng -lz
11+
LDFLAGS = -s $(shell $(BIN_BASE)pkg-config --libs sdl SDL_image SDL_ttf SDL_mixer) -ljpeg -logg -lfreetype -lpng -lz -lbz2
1212
CC = arm-linux-gcc
1313

1414
all: $(PROJECT)

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ Feel free to report errors.
3030

3131
For more, please refer to the source code.
3232

33+
### custom music support
34+
The game supports custom music playback. In order to listen to your favourite songs, you need to copy them to $HOME/.yatka/music. If the folder does not exist, create it. Supported music formats depend on your platform, but usually MOD, MP3, OGG and WAV files are accepted.
35+
3336
### ideas / plans
3437
- animated mascot (becchi?) evolving while playing or saying random things during gameplay
3538
- better score system (combos, T-spins)

src/sound.c

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,31 @@ static void loadNextTrack(void)
7373

7474
void initSound(void)
7575
{
76-
#if defined(_RETROFW)
77-
int mixflags = MIX_INIT_OGG | MIX_INIT_MOD;
78-
#elif defined(_BITTBOY)
79-
int mixflags = MIX_INIT_OGG;
80-
#else
81-
int mixflags = MIX_INIT_OGG | MIX_INIT_MOD | MIX_INIT_MP3;
82-
#endif
83-
if (Mix_Init(mixflags) != mixflags)
84-
{
85-
printf("Mix_Init failed.\n");
86-
exit(ERROR_MIXINIT);
76+
int mixflags = -1;
77+
int retflags = Mix_Init(mixflags);
78+
if (retflags != mixflags)
79+
{
80+
retflags = Mix_Init(retflags);
81+
}
82+
if (retflags & MIX_INIT_FLAC)
83+
{
84+
printf("Mix_Init: FLAC supported.\n");
85+
}
86+
if (retflags & MIX_INIT_MOD)
87+
{
88+
printf("Mix_Init: MOD supported.\n");
89+
}
90+
if (retflags & MIX_INIT_MP3)
91+
{
92+
printf("Mix_Init: MP3 supported.\n");
93+
}
94+
if (retflags & MIX_INIT_OGG)
95+
{
96+
printf("Mix_Init: OGG supported.\n");
97+
}
98+
if (retflags & MIX_INIT_FLUIDSYNTH)
99+
{
100+
printf("Mix_Init: MIDI supported (FluidSynth?).\n");
87101
}
88102
if (Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 1, 1024) < 0)
89103
{

0 commit comments

Comments
 (0)