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
+2 -1
View File
@@ -31,4 +31,5 @@ LINUXOBJS := \
src/linux/mako_linux.o
EMOBJS := \
src/linux/nact_linux.o
src/linux/nact_linux.o \
src/emscripten/mako.o
+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;
}
+4 -5
View File
@@ -132,11 +132,11 @@ public:
class MAKO {
public:
MAKO(NACT* parent) {}
MAKO(NACT* parent);
void play_music(int page) { playing = true; }
void stop_music() { playing = false; }
bool check_music() { return playing; }
void play_music(int page);
void stop_music();
bool check_music() { return current_music != 0; }
void get_mark(int* mark, int* loop) {}
void notify_mci(int status) {}
@@ -157,7 +157,6 @@ public:
_TCHAR amus[16];
_TCHAR amse[16];
bool playing;
int current_music;
int next_loop; // Y19
int cd_track[100]; // Z