diff options
Diffstat (limited to 'sdl')
| -rw-r--r-- | sdl/main.c | 18 | ||||
| -rw-r--r-- | sdl/unix/Makefile | 2 | 
2 files changed, 19 insertions, 1 deletions
| @@ -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 | 
