aboutsummaryrefslogtreecommitdiff
path: root/sdl
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2017-09-19 00:53:41 +0900
committerTakamichi Horikawa <takamichiho@gmail.com>2017-09-19 00:53:41 +0900
commit96d11d0e5bd23b6a7128f48dfc6233132c6166c6 (patch)
tree0ee18914da8f3721137a939016cafd7327695cae /sdl
parent1ff3793322585443909d11284457811c461f8de4 (diff)
fmdsp-pacc: add comment display
Diffstat (limited to 'sdl')
-rw-r--r--sdl/main.c18
-rw-r--r--sdl/unix/Makefile2
2 files changed, 19 insertions, 1 deletions
diff --git a/sdl/main.c b/sdl/main.c
index e46a660..5a103b4 100644
--- a/sdl/main.c
+++ b/sdl/main.c
@@ -3,12 +3,14 @@
#include <stdatomic.h>
#include "pacc/pacc.h"
#include "fmdsp/fmdsp-pacc.h"
+#include "fmdsp/font.h"
#include "libopna/opna.h"
#include "libopna/opnatimer.h"
#include "fmdriver/fmdriver.h"
#include "common/fmplayer_file.h"
#include "common/fmplayer_common.h"
#include "fft/fft.h"
+#include "fmdsp/fontrom_shinonome.inc"
bool loadgl(void);
@@ -32,6 +34,7 @@ static struct {
struct fmdsp_pacc *fp;
atomic_flag fftdata_flag;
int scale;
+ struct fmdsp_font font16;
} g = {
.fftdata_flag = ATOMIC_FLAG_INIT,
.scale = 1,
@@ -65,6 +68,7 @@ static void openfile(const char *path) {
g.fmfile = file;
fmplayer_init_work_opna(&g.work, &g.ppz8, &g.opna, &g.timer, &g.adpcmram);
fmplayer_file_load(&g.work, g.fmfile, 1);
+ fmdsp_pacc_comment_reset(g.fp);
SDL_UnlockAudioDevice(g.adev);
SDL_PauseAudioDevice(g.adev, 0);
}
@@ -156,6 +160,8 @@ int main(int argc, char **argv) {
return 1;
}
fmdsp_pacc_set(g.fp, &g.work, &g.opna, &g.fftin);
+ fmdsp_font_from_font_rom(&g.font16, fmdsp_shinonome_font_rom);
+ fmdsp_pacc_set_font16(g.fp, &g.font16);
SDL_EventState(SDL_DROPFILE, SDL_ENABLE);
@@ -193,6 +199,18 @@ int main(int argc, char **argv) {
default:
break;
}
+ if (e.key.keysym.mod & KMOD_SHIFT) {
+ switch (e.key.keysym.scancode) {
+ case SDL_SCANCODE_UP:
+ fmdsp_pacc_comment_scroll(g.fp, false);
+ break;
+ case SDL_SCANCODE_DOWN:
+ fmdsp_pacc_comment_scroll(g.fp, true);
+ break;
+ default:
+ break;
+ }
+ }
if (e.key.keysym.mod & KMOD_CTRL) {
switch (e.key.keysym.scancode) {
case SDL_SCANCODE_F1:
diff --git a/sdl/unix/Makefile b/sdl/unix/Makefile
index ea22098..62dd177 100644
--- a/sdl/unix/Makefile
+++ b/sdl/unix/Makefile
@@ -8,7 +8,7 @@ vpath %.c ../../fft
SDLCONFIG:=sdl2-config
OBJS:=main.o
OBJS+=pacc-gl.o
-OBJS+=fmdsp-pacc.o font_fmdsp_small.o fmdsp_platform_unix.o
+OBJS+=fmdsp-pacc.o font_fmdsp_small.o fmdsp_platform_unix.o font_rom.o
OBJS+=opna.o opnafm.o opnassg.o opnadrum.o opnaadpcm.o opnatimer.o opnassg-sinc-c.o opnassg-sinc-sse2.o
OBJS+=fmdriver_pmd.o fmdriver_fmp.o ppz8.o fmdriver_common.o
OBJS+=fmplayer_file.o fmplayer_work_opna.o fmplayer_file_unix.o fmplayer_drumrom_unix.o