CDDA support for emscripten

This commit is contained in:
kichikuou
2017-04-30 10:14:54 +09:00
parent bd2e483704
commit 3fd5d1e8fb
3 changed files with 42 additions and 6 deletions
+36
View File
@@ -0,0 +1,36 @@
/*
ALICE SOFT SYSTEM 3 for Emscripten
[ MAKO ]
*/
#include <emscripten.h>
#include "mako.h"
MAKO::MAKO(NACT* parent)
: current_music(0)
, next_loop(0)
{
for (int i = 1; i <= 99; i++)
cd_track[i] = i;
}
void MAKO::play_music(int page)
{
if (current_music == page)
return;
current_music = page;
int loop_count = next_loop;
next_loop = 0;
EM_ASM_ARGS({ xsystem35.cdPlayer.play($0, $1); },
cd_track[page] + 1, loop_count);
}
void MAKO::stop_music()
{
if (current_music)
EM_ASM( xsystem35.cdPlayer.stop(); );
current_music = 0;
}