Commit graph

80 commits

Author SHA1 Message Date
Clownacy
afb2b22e58 Merge branch 'accurate' into portable 2020-10-23 19:10:36 +01:00
Clownacy
d81c46a79c Release custom code under the MIT licence
Of course, Pixel's code is still proprietary.
2020-10-23 19:09:55 +01:00
Clownacy
ab217f7f6f Document MakePixToneObject a bit more 2020-09-22 01:43:09 +01:00
Clownacy
b1090cd8f9 Correct some mistakes that this branch has 2020-09-03 21:29:48 +01:00
Clownacy
a05b802904 Merge branch 'accurate' into portable 2020-09-03 21:11:16 +01:00
Clownacy
0c367cecf7 Add FIX_MAJOR_BUGS option
This one specifically fixes bugs that either invoke undefined
behaviour or cause memory leaks. Essentially, they affect stability.
Bugs that just affect gameplay will remain covered by FIX_BUGS.
2020-09-03 21:05:14 +01:00
Clownacy
c7a3e9c308 Comment-out unused variable 2020-07-08 20:43:56 +01:00
Clownacy
adb09e19b7 Merge branch 'accurate' into portable 2020-07-08 19:42:28 +01:00
Clownacy
13985fb349 Added SoundMode enum
Controls whether a PlaySoundObject call start, stops, or loops a
sound
2020-07-08 18:52:32 +01:00
Clownacy
92ce7aeb5d Use fixed-size types for the WAV header struct
This matches the WAVEFORMATEX struct
2020-07-08 16:35:09 +01:00
Clownacy
81641c82f3 Fix InitSoundObject 2020-07-08 02:37:19 +01:00
Clownacy
72af19d056 Merge branch 'accurate' into portable 2020-07-08 02:12:32 +01:00
Clownacy
788e5ea2d8 Add some sound fixes and documentation 2020-07-08 02:07:22 +01:00
Clownacy
4afb0f494e Fix .wav file offsets 2020-07-08 01:56:31 +01:00
Clownacy
82a6160a31 Add missing sanity checks 2020-07-08 01:02:56 +01:00
Clownacy
a015d4d02e Restored LoadSoundObject
Can be used to load SFX from .wav files
2020-07-08 00:56:02 +01:00
Clownacy
cc0464e774 Restore InitSoundObject
Can be used to load SFX from .wav resource files (as long as they're
mono unsigned 8-bit samples).
2020-07-08 00:40:49 +01:00
Clownacy
720b1dfea7
Reword a comment 2020-07-02 14:55:18 +01:00
Gabriel Ravier
41c3afd927 src/Sound.cpp: Re-added Main.h include but commented it out with an explanation as to why
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-07-02 14:54:29 +02:00
Gabriel Ravier
32c8795ead src: Cleaned up includes to only (and always) include what we use
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-07-01 18:26:22 +02:00
Clownacy
a3a8c4df94 Remove an include which isn't needed 2020-06-30 17:33:03 +01:00
Clownacy
e934cae696 Merge branch 'accurate' into portable 2020-06-30 17:32:19 +01:00
Gabriel Ravier
a62141e185 src: Added back stddef.h where accurate to get NULL/size_t properly (stdio.h provides them, but it's for file I/O, not essential definitions and types)
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-06-30 01:52:38 +02:00
Gabriel Ravier
66e4995135 src: Remove unnecessary includes
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-06-30 00:12:17 +02:00
Clownacy
5daea02ac6 Change the audio backend API
Removes locking and unlocking: instead, samples are passed to Create.
2020-04-06 19:44:45 +01:00
Clownacy
9cbaa0be00 Merge branch 'accurate' into portable 2020-01-08 13:16:21 +00:00
Clownacy
32d635581a Sound.cpp variable arrangement tweaks
Not much can be done for this file, considering how heavily it was
modified in the Linux port.

While I was here, I noted the unused .wav loading function.
2020-01-07 22:03:49 +00:00
Clownacy
84626ea710 Merge branch 'accurate' into portable 2020-01-07 04:55:16 +00:00
Clownacy
58d7a45392 Empty Tags.h
There's no evidence Tags.h contained these variables (if anything, it
appears that Pixel manually declared them in every file that used
them).

gg Pixel
2020-01-06 21:20:17 +00:00
Clownacy
dabf04f8ab Remove leftover macro 2019-11-17 17:53:50 +00:00
Clownacy
531a6a0aeb Merge branch 'accurate' into portable 2019-11-10 12:17:40 +00:00
Gabriel Ravier
5b18283e5f Documentation : Made some comments clearer
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2019-11-09 23:37:10 +01:00
Gabriel Ravier
17f7f66fc9 Documentation : Comment an always true expression
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2019-11-09 23:37:10 +01:00
Clownacy
266bb13be2 Compare some pointers to NULL
Doesn't affect ASM-accuracy - I just think it looks neater.
2019-11-09 14:53:34 +00:00
Clownacy
88f22510ee Fix crash when AudioBackend_Init fails
Similar checks existed in the original code (see the accurate
branch), but they were removed in the Organya source code release, so
I figured they were useless. Turns out they're not.

Fixes #48.
2019-09-10 17:59:54 +00:00
Clownacy
aede7b6069 Restore the FREQUENCY constant
Cave Story at 2000Hz is fun
2019-09-10 14:04:06 +00:00
Clownacy
0dc9bb6b1b Change the audio backend API again 2019-09-06 14:46:31 +00:00
Clownacy
d80adf9cc8 Comment on a bug in MakePixToneObject 2019-09-05 21:41:40 +00:00
Clownacy
46fdc08ecd Fix PixTone sounds missing their ends
I was accidentally replicating a bug from the original code in the
wrong place. I should probably comment on that bug in the accurate
branch.
2019-09-05 21:39:38 +00:00
Clownacy
0531a2c482 Remove the Windows-style path separators
There, *now* the game runs on Linux
2019-09-04 13:54:19 +00:00
Clownacy
a3bb651194 Change the audio backend API a little
AudioBackend_SetSoundPosition was very loosely-defined.
2019-09-04 03:16:33 +01:00
Clownacy
b553b0c2e9 Remove DWORD and BYTE
They're not as deeprooted as BOOL.
2019-09-04 01:10:54 +01:00
Clownacy
5ea356a3bd Weed out a lot of the Windows dependency
Storytime: Cucky's original SDL2 port work involved using SDL2's
threading API to emulate the original WinAPI threading.

I can't be assed with that stuff, so I used the same trick Cucky did
for the Wii port, and hooked Organya up to the SDL2 audio callback.
This actually opens up the possibility for perfectly-synchronised
Organya playback. By that I mean, instead of needing a super
low-latency audio callback, I can have the callback synchronise its
audio mixing with Organya itself. I haven't done it yet, I plan to
soon.
2019-09-04 00:28:23 +01:00
Clownacy
5a9492166d Restored the new SDL2 audio system
While I was at it, I overhauled the thing and found a bunch of
optimisations,
2019-09-03 22:29:57 +01:00
Clownacy
8f1bc269f0 I might have found out why Sound.cpp uses DSBUFFERDESC1 2019-09-03 00:34:47 +01:00
Clownacy
09b188ac29 Add a bugfix for a bizarre function call 2019-09-03 00:17:42 +01:00
Clownacy
03e513365b PATH_LENGTH is actually Windows's MAX_PATH
When MAX_PATH isn't available, use FILENAME_MAX. This might be a bad
idea.
2019-08-31 01:44:53 +01:00
Clownacy
8bce9ffc7a Cleanup 2019-08-28 17:40:43 +01:00
Clownacy
e738541afd Note an inaccuracy 2019-08-28 07:56:51 +01:00
Clownacy
470c5d86d5 ASM-accurate Sound.cpp and Organya.cpp (except for one function) 2019-08-28 07:55:42 +01:00