Skip to content

Commit

Permalink
Bittboy port update, readme update, supported music formats detected …
Browse files Browse the repository at this point in the history
…dynamically
  • Loading branch information
szymor committed Nov 18, 2020
1 parent ab5019c commit 691154d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile.bittboy
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SRC = src/main.c src/data_persistence.c src/video.c src/sound.c \
OBJ = $(SRC:.c=.o)
DEP = $(SRC:.c=.d)
CFLAGS = -Iinc -D_BITTBOY -Ofast -march=armv5te -mtune=arm926ej-s
LDFLAGS = -s $(shell $(BIN_BASE)pkg-config --libs sdl SDL_image SDL_ttf SDL_mixer) -ljpeg -logg -lfreetype -lpng -lz
LDFLAGS = -s $(shell $(BIN_BASE)pkg-config --libs sdl SDL_image SDL_ttf SDL_mixer) -ljpeg -logg -lfreetype -lpng -lz -lbz2
CC = arm-linux-gcc

all: $(PROJECT)
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ Feel free to report errors.

For more, please refer to the source code.

### custom music support
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.

### ideas / plans
- animated mascot (becchi?) evolving while playing or saying random things during gameplay
- better score system (combos, T-spins)
Expand Down
36 changes: 25 additions & 11 deletions src/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,31 @@ static void loadNextTrack(void)

void initSound(void)
{
#if defined(_RETROFW)
int mixflags = MIX_INIT_OGG | MIX_INIT_MOD;
#elif defined(_BITTBOY)
int mixflags = MIX_INIT_OGG;
#else
int mixflags = MIX_INIT_OGG | MIX_INIT_MOD | MIX_INIT_MP3;
#endif
if (Mix_Init(mixflags) != mixflags)
{
printf("Mix_Init failed.\n");
exit(ERROR_MIXINIT);
int mixflags = -1;
int retflags = Mix_Init(mixflags);
if (retflags != mixflags)
{
retflags = Mix_Init(retflags);
}
if (retflags & MIX_INIT_FLAC)
{
printf("Mix_Init: FLAC supported.\n");
}
if (retflags & MIX_INIT_MOD)
{
printf("Mix_Init: MOD supported.\n");
}
if (retflags & MIX_INIT_MP3)
{
printf("Mix_Init: MP3 supported.\n");
}
if (retflags & MIX_INIT_OGG)
{
printf("Mix_Init: OGG supported.\n");
}
if (retflags & MIX_INIT_FLUIDSYNTH)
{
printf("Mix_Init: MIDI supported (FluidSynth?).\n");
}
if (Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 1, 1024) < 0)
{
Expand Down

0 comments on commit 691154d

Please sign in to comment.