Windows: Add "MIDI Sound" menu item

Now "FM Sound" really means FM sound, not MIDI.
This commit is contained in:
kichikuou
2020-12-11 17:15:12 +09:00
parent 2de55f9f4d
commit 33a0595016
5 changed files with 20 additions and 8 deletions
+1
View File
@@ -42,6 +42,7 @@ BEGIN
POPUP "Sound"
BEGIN
MENUITEM "FM Sound", ID_SOUND_FM
MENUITEM "MIDI Sound", ID_SOUND_MIDI
MENUITEM "CD Audio", ID_SOUND_CD
END
POPUP "Message"
+4 -3
View File
@@ -25,9 +25,10 @@
#define ID_SCREEN_WINDOW 40003
#define ID_SCREEN_FULL 40004
#define ID_SOUND_FM 40005
#define ID_SOUND_CD 40006
#define ID_TEXT_SKIP 40007
#define ID_TEXT_WAIT 40008
#define ID_SOUND_MIDI 40006
#define ID_SOUND_CD 40007
#define ID_TEXT_SKIP 40008
#define ID_TEXT_WAIT 40009
// Next default values for new objects
//
+1
View File
@@ -16,6 +16,7 @@
enum BGMDevice {
BGM_FM,
BGM_MIDI,
BGM_CD
};
+11 -5
View File
@@ -350,8 +350,7 @@ void MAKO::stop_music()
delete music;
music = nullptr;
}
if (use_fm)
SDL_PauseAudio(1);
SDL_PauseAudio(1);
current_music = 0;
}
@@ -364,12 +363,18 @@ void MAKO::select_sound(BGMDevice dev)
{
// 強制的に音源を変更する
int page = current_music;
int old_dev = (1 <= page && page <= 99 && cd_track[page]) ? BGM_CD : BGM_FM;
int old_dev = (1 <= page && page <= 99 && cd_track[page]) ? BGM_CD :
use_fm ? BGM_FM : BGM_MIDI;
if (dev == BGM_FM) {
switch (dev) {
case BGM_FM:
case BGM_MIDI:
for (int i = 1; i <= 99; i++)
cd_track[i] = 0;
} else {
use_fm = dev == BGM_FM;
break;
case BGM_CD:
const int8* tracks;
switch (nact->crc32_a) {
@@ -392,6 +397,7 @@ void MAKO::select_sound(BGMDevice dev)
for (int i = 1; i <= 99; i++)
cd_track[i] = i;
}
break;
}
// デバイスが変更された場合は再演奏する
+3
View File
@@ -156,6 +156,9 @@ bool NACT::handle_platform_event(const SDL_Event& e)
case ID_SOUND_FM:
mako->select_sound(BGM_FM);
break;
case ID_SOUND_MIDI:
mako->select_sound(BGM_MIDI);
break;
case ID_SOUND_CD:
mako->select_sound(BGM_CD);
break;