Commit Graph
10 Commits
Author SHA1 Message Date
kichikuou 9543bf1761 Flash: sound support
The DefineSound tag in SWF has raw PCM data, so we create a WAV file in-
memory and pass it to audio_play_archive_data(). This is not strictly
necessary since libsndfile can handle raw PCM data, but keeps the audio
and mixer interfaces simple.
2023-07-09 17:05:21 +09:00
Nunuhara Cabbage f7cf2264fa Fix multiple issues with resetting HLLs
Clear PartsEngine/SACT2/CharSpriteManager/audio state when resetting the
VM.

Fixes #113
2023-04-14 16:00:40 -07:00
Nunuhara Cabbage 6080af3621 Implement Sound_GetGroupNumFromDataNum
Part of StoatSpriteEngine and KiwiSoundEngine.

This fixes an issue with per-channel volume settings not working
correctly in Haruurare (and presumably other games).
2022-05-04 20:30:03 -07:00
kichikuou f725e4e830 Implement ChrLoader.LoadWavFile 2022-03-25 10:49:25 +09:00
Nunuhara Cabbage fc8e7eee22 Replace SDL_mixer with libsndfile + sts_mixer
Replace SDL_mixer with an audio implementation using libsndfile,
sts_mixer (a single-file header library) and SDL's basic audio
interface.

This allows for much more flexibility in controlling audio playback.
Fading is now properly implemented, as well as various other functions
from the SACT2/KiwiSoundEngine interface.

sts_mixer can support recursive mixing, so it will be possible to
implement the "VolumeValancer" mixer channels specified in
System40.ini in the future (once I figure out how the mapping of audio
files to mixer channels is supposed to work).
2021-09-30 22:07:04 -07:00
Nunuhara Cabbage 7eb6216b80 Add audio_play_sound function
Implement a system for allocating anonymous channels so that libraries
can play sounds without having to manage channels.

A library that uses audio_play_sound must ensure that audio_update is
called periodically to garbage collect finished channels.
2021-05-21 23:30:16 -07:00
Nunuhara Cabbage d9d8a201e8 Implement miscellaneous HLL functions
Reduce console spam by implementing some commonly used functions.

DrawGraph.SetFontName
SACT2.Mouse_SetPos
SACT2.Sound_ReverseLR
2020-08-16 19:57:46 -07:00
Nunuhara Cabbage 81a947d74d Partial InputString hll implementation
Not implemented: display of intermediate results.
2020-07-12 16:10:10 -07:00
Nunuhara Cabbage 0e4e52a25d Refactor audio to enable bgm looping
SDL_mixer reads loop information from WAV files if you use the Mix_Music
interface, but NOT the Mix_Chunk interface. So bgm now uses the
Mix_Music interface to get proper looping.

There's also some code here for reading bgi files (taken from xsystem35)
but it's not actually used. There doesn't seem to be a simple way to set
up custom loops with SDL_mixer.
2020-07-12 12:07:40 -07:00
Nunuhara Cabbage 5d6f148e1b Reorganize project file structure
- Create separate directories for source and header files.
- Build code shared between xsystem4 and aindump as a static library.
- Create header dirs gfx/ system4/ and vm/
- Make CG.c/h usable without a running VM
2019-12-31 17:50:40 -08:00