[Decompilation] [th05] snd_bgm_measure(), snd_delay_until_measure()
Umm… but this can't be in the same translation unit as frame_delay(),
because OP.EXE has cdg_put_nocolors() inbetween, which means we'd have
to compile it twice.
What probably happened there: ZUN originally wrote this in C when
frame_delay() was still next to it, then generated ASM from it,
tinkered with that, and ultimately only linked that ASM into the final
game, with the NOPCALL still in there. That might very well be the one
temporary NOPCALL workaround we can never get rid of…
Oh well, at least we got lucky with the padding, and can keep the
cdg_put_nocolors() decompilation from the last commit.
Part of P0133, funded by [Anonymous].
2021-01-08 18:20:04 +00:00
|
|
|
#include "th03/snd/snd.h"
|
2020-02-22 16:59:46 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
SND_BGM_OFF = 0,
|
|
|
|
SND_BGM_FM26 = 1,
|
|
|
|
SND_BGM_FM86 = 2,
|
|
|
|
SND_BGM_MODE_COUNT = 3,
|
|
|
|
SND_BGM_MIDI = 3, // unsupported
|
|
|
|
} snd_bgm_mode_t;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
SND_SE_OFF = 0,
|
|
|
|
SND_SE_FM = 1,
|
|
|
|
SND_SE_BEEP = 2,
|
|
|
|
SND_SE_MODE_COUNT = 3,
|
|
|
|
} snd_se_mode_t;
|
|
|
|
|
|
|
|
extern unsigned char snd_se_mode;
|
|
|
|
extern unsigned char snd_bgm_mode;
|
|
|
|
|
2020-12-31 16:22:48 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
static inline bool snd_is_active() {
|
|
|
|
return snd_bgm_mode;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-12-29 20:05:57 +00:00
|
|
|
#define snd_bgm_is_fm() \
|
|
|
|
(snd_bgm_mode != SND_BGM_MIDI)
|
|
|
|
|
2020-02-22 16:59:46 +00:00
|
|
|
// Checks the requested BGM and SE modes against the available hardware and
|
|
|
|
// sets [snd_se_mode] and [snd_bgm_mode] accordingly. Returns [snd_bgm_mode].
|
|
|
|
unsigned char pascal snd_determine_modes(int req_bgm_mode, int req_se_mode);
|