[Maintenance] [th04/th05] Declare BGM and SE modes in C land

Part of P0077, funded by Splashman and -Tom-.
This commit is contained in:
nmlgc 2020-02-22 17:59:46 +01:00
parent 803c079a5d
commit a1c3acd9f1
3 changed files with 24 additions and 7 deletions

View File

@ -1,8 +1,4 @@
; 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, but the game doesn't care.
; int __pascal snd_determine_modes(int req_bgm_mode, int req_se_mode)
public SND_DETERMINE_MODES
snd_determine_modes proc
@@req_se_mode = word ptr (cPtrSize + 2)
@@req_bgm_mode = word ptr (cPtrSize + 4)

23
th04/snd/snd.h Normal file
View File

@ -0,0 +1,23 @@
#include "th02/snd/snd.h"
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;
// 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);

View File

@ -1,11 +1,9 @@
; enum BGM_MODE
SND_BGM_OFF = 0
SND_BGM_FM26 = 1
SND_BGM_FM86 = 2
SND_BGM_MODE_COUNT = 3
SND_BGM_MIDI = 3 ; unsupported
; enum SE_MODE
SND_SE_OFF = 0
SND_SE_FM = 1
SND_SE_BEEP = 2