Skip to content

Add SDL_mixer support#772

Open
PaulMDemers wants to merge 3 commits into
XboxDev:masterfrom
PaulMDemers:feature/sdl-mixer
Open

Add SDL_mixer support#772
PaulMDemers wants to merge 3 commits into
XboxDev:masterfrom
PaulMDemers:feature/sdl-mixer

Conversation

@PaulMDemers

Copy link
Copy Markdown

Summary

Adds SDL_mixer support to nxdk as an SDL2 companion library.

This first pass enables the core SDL_mixer library with WAV/chunk playback support only. Compressed/music codec support such as OGG, MP3, MOD, MIDI, and FLAC is intentionally deferred to follow-up work so the initial integration stays small and reviewable.

Changes

  • Add lib/sdl/SDL_mixer submodule
  • Build libSDL2_mixer.lib when NXDK_SDL = y
  • Enable SDL_mixer core + MUSIC_WAV
  • Add lib/pkgconfig/SDL2_mixer.pc
  • Add samples/sdl_mixer
  • Update README SDL library summary

SDL_mixer submodule

The SDL_mixer submodule points at PaulMDemers/SDL_mixer, branch nxdk-sdl-mixer.

That branch is based on SDL_mixer release-2.0.4 and contains one small nxdk compatibility change: use the existing strtok() path for XBOX builds instead of the Windows strtok_s() path.

Verification

Built successfully on Windows/MSYS2 with:

make -C samples/sdl_mixer

This produced:

  • lib/libSDL2_mixer.lib
  • samples/sdl_mixer/bin/default.xbe
  • samples/sdl_mixer/nxdk sample - SDL2_mixer.iso

The sample generates a small in-memory WAV tone, loads it through Mix_LoadWAV_RW, and plays it through SDL_mixer.

@JayFoxRox

Copy link
Copy Markdown
Member

I don't think this should be merged. See reasons in #601


use the existing strtok() path for XBOX builds instead of the Windows strtok_s() path.

Sounds like upstream should check for __STDC_LIB_EXT1__ instead, then nxdk would work without changes.
nxdk could also add a dummy wrapper for strtok_s (upstream in pdclib?) or to the WIN32 code (as part of the win32 libc).

@tifasoftware

Copy link
Copy Markdown

Is there any recent developments to adding SDL2_mixer to the nxdk? My project requires SDL2_mixer, and I might possibly assist getting the full SDL2_mixer to the SDK.

@PaulMDemers

Copy link
Copy Markdown
Author

@tifasoftware the work hasn't been forgotten, I am distracted with another project at the moment.

This port currently is just the initial base WAV support, additional help is more than welcome. :)

It'll be probably a week or two before I'm back working on libraries.

@tifasoftware

Copy link
Copy Markdown

That's absolutely okay, take your time. I too can get distracted with other parts of my game engine too. I'll probably be working on my other ports to the PS2, GameCube, and the Dreamcast in the meantime.

@tifasoftware

Copy link
Copy Markdown

My project also will need ogg support, but I'll try to help in any way i can in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants