Add Windows native implementaton of MAKO

The MIDI synthesizer bundled with SDL_Mixer doesn't sound as good as
Windows' built-in software synthesizer.

This adds Windows native implementation of MAKO as win/mako.cpp. It
plays MIDI by writing out SMF to a temporary file and play it with MCI.
CD emulation (--playlist) is also implemented using MCI.
The PCM implementation is copyed from TOTO's original Win32 impl.

This removes SDL_mixer dependency in Windows.

Fixes #1.
This commit is contained in:
kichikuou
2020-05-16 17:36:23 +09:00
parent b475c465fd
commit 9f5f4e6843
5 changed files with 349 additions and 23 deletions
+16 -3
View File
@@ -4,13 +4,19 @@
[ NACT - input ]
*/
#ifdef _WIN32
#include <windows.h>
#undef ERROR
#endif
#include <SDL_syswm.h>
#include "nact.h"
#include "ags.h"
#include "mako.h"
#include "texthook.h"
static int mousex, mousey, fingers;
static bool pump_events(AGS* ags)
static bool pump_events(AGS* ags, MAKO* mako)
{
SDL_Event e;
while (SDL_PollEvent(&e)) {
@@ -34,6 +40,13 @@ static bool pump_events(AGS* ags)
case SDL_APP_DIDENTERFOREGROUND:
ags->flush_screen(false);
break;
#ifdef _WIN32
case SDL_SYSWMEVENT:
if (e.syswm.msg->msg.win.msg == MM_MCINOTIFY)
mako->on_mci_notify(e.syswm.msg);
break;
#endif
}
}
return false;
@@ -45,7 +58,7 @@ uint8 NACT::get_key()
texthook_keywait();
if (pump_events(ags))
if (pump_events(ags, mako))
terminate = true;
// キーボード&マウス
@@ -90,7 +103,7 @@ uint8 NACT::get_key()
void NACT::get_cursor(int* x, int* y)
{
if (pump_events(ags))
if (pump_events(ags, mako))
terminate = true;
*x = mousex;
*y = mousey;