diff --git a/chipnomad_player/fonts/Silkscreen/readme.txt b/chipnomad_player/fonts/Silkscreen/readme.txt new file mode 100644 index 0000000..dd3627d --- /dev/null +++ b/chipnomad_player/fonts/Silkscreen/readme.txt @@ -0,0 +1,6 @@ +Silkscreen was created by Jason Kottke and is distributed under the Open Font License, which means that you can use, distribute, or modify it however you wish. More information about the license and Silkscreen is available on the web: + +http://scripts.sil.org/OFL +http://www.kottke.org/plus/type/silkscreen/ + +To install Silkscreen, simply copy the two .ttf files to your fonts directory. \ No newline at end of file diff --git a/chipnomad_player/fonts/Silkscreen/slkscr.ttf b/chipnomad_player/fonts/Silkscreen/slkscr.ttf new file mode 100644 index 0000000..b110719 Binary files /dev/null and b/chipnomad_player/fonts/Silkscreen/slkscr.ttf differ diff --git a/tracker/Makefile.funkey b/tracker/Makefile.funkey new file mode 100644 index 0000000..7816cd2 --- /dev/null +++ b/tracker/Makefile.funkey @@ -0,0 +1,39 @@ +# Funkey S / RG Nano makefile + +# Funkey S platform identifier +PLATFORM = funkey + +include Makefile.common + +# funkey-specific settings +LIBS = $(COMMON_LIBS) platforms/sdl12 +OUTPUT_EXT = +# DOCKER = docker run --platform linux/amd64 --rm --user $$(id -u):$$(id -g) -v`pwd`/..:/src -w/src/tracker + +#XTRA_CFLAGS = -I${SYSROOT}/usr/include -L${SYSROOT}/usr/lib +XTRA_CFLAGS= -DFUNKEY_BUILD +XTRA_LIBS = -lSDL +CFLAGS = $(COMMON_CFLAGS) $(INCLUDES) $(SOURCES) $(XTRA_CFLAGS) + +.PHONY: .funkey.elf +.funkey.elf: + mkdir -p $(BUILD) + $(CC) $(CFLAGS) $(XTRA_LIBS) -o $(BUILD)/chipnomad.funkey.elf + +#.PHONY: funkey +#funkey: +# $(DOCKER) nfriedly/miyoo-toolchain:steward make -f Makefile.funkey .funkey CC=gcc + +# funkey deployment +APP := ChipNomad + +.PHONY: funkey-deploy +funkey-deploy: .funkey.elf + echo TODO actual deploy + cp packaging/funkey-s/ChipNomad.funkey-s.desktop $(BUILD)/ + cp packaging/funkey-s/chipnomad.png $(BUILD)/ + mksquashfs $(BUILD)/ $(BUILD)/chipnomad.opk + +.PHONY: clean +clean: + rm -rf $(BUILD) \ No newline at end of file diff --git a/tracker/packaging/funkey-s/ChipNomad.funkey-s.desktop b/tracker/packaging/funkey-s/ChipNomad.funkey-s.desktop new file mode 100644 index 0000000..d90e5fa --- /dev/null +++ b/tracker/packaging/funkey-s/ChipNomad.funkey-s.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=ChipNomad +Comment=A multi-platform tracker with LSDJ-like interface +Exec=chipnomad.funkey.elf +Icon=chipnomad +Categories=applications diff --git a/tracker/packaging/funkey-s/chipnomad.png b/tracker/packaging/funkey-s/chipnomad.png new file mode 100644 index 0000000..8026cda Binary files /dev/null and b/tracker/packaging/funkey-s/chipnomad.png differ diff --git a/tracker/platforms/sdl12/corelib_gfx.c b/tracker/platforms/sdl12/corelib_gfx.c index acddc2e..881e5c7 100644 --- a/tracker/platforms/sdl12/corelib_gfx.c +++ b/tracker/platforms/sdl12/corelib_gfx.c @@ -4,8 +4,16 @@ #include "corelib_gfx.h" #include "corelib_font.h" +#ifdef FUNKEY_BUILD +#define WINDOW_WIDTH (240) +#define WINDOW_HEIGHT (240) +#define WINDOW_BPP (16) +#else #define WINDOW_WIDTH (640) #define WINDOW_HEIGHT (480) +#define WINDOW_BPP (32) +#endif + #define PRINT_BUFFER_SIZE (256) #define CHAR_X(x) ((x) * fontW * 8) @@ -64,7 +72,7 @@ int gfxSetup(int *screenWidth, int *screenHeight) { return 1; } - sdlScreen = SDL_SetVideoMode(WINDOW_WIDTH, WINDOW_HEIGHT, 32, SDL_HWSURFACE); + sdlScreen = SDL_SetVideoMode(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_BPP, SDL_HWSURFACE); if (!sdlScreen) { printf("SDL1.2 Set Video Mode Error: %s\n", SDL_GetError()); SDL_Quit(); diff --git a/tracker/platforms/sdl12/corelib_mainloop.c b/tracker/platforms/sdl12/corelib_mainloop.c index 8462057..78b1d76 100644 --- a/tracker/platforms/sdl12/corelib_mainloop.c +++ b/tracker/platforms/sdl12/corelib_mainloop.c @@ -30,6 +30,29 @@ #define BTN_VOLUME_DOWN 45 #define BTN_POWER 0 #define BTN_EXIT 0 +#elif FUNKEY_BUILD +// Funkey S/RG Nano mapping +#define BTN_UP SDLK_u +#define BTN_DOWN SDLK_d +#define BTN_LEFT SDLK_l +#define BTN_RIGHT SDLK_r +#define BTN_A SDLK_a +#define BTN_B SDLK_b +#define BTN_X SDLK_x +#define BTN_Y SDLK_y +#define BTN_Z 0 +#define BTN_L1 0 +#define BTN_R1 0 +#define BTN_L2 0 +#define BTN_R2 0 +#define BTN_SELECT SDLK_m +#define BTN_START SDLK_s +#define BTN_MENU 306 +#define BTN_VOLUME_UP 61 +#define BTN_VOLUME_DOWN 45 +#define BTN_POWER 0 +#define BTN_EXIT 0 + #else // RG35xx mapping #define BTN_UP 119 diff --git a/tracker/platforms/shared/font6x8.c b/tracker/platforms/shared/font6x8.c new file mode 100644 index 0000000..b806c77 --- /dev/null +++ b/tracker/platforms/shared/font6x8.c @@ -0,0 +1,389 @@ +#include + +// Generated from Jason Kottke's Silkscreen +// https://kottke.org/plus/type/silkscreen/ +// which is licensed under the SIL Open Font License, +// packaged as chipnomad_player/fonts/Silkscreen/slkscr.ttf +// using font-generator/ +const uint8_t font6x8[] = { + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x20, + 0x20, 0x20, + 0x00, 0x20, + 0x00, 0x00, + 0x00, 0x50, + 0x50, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x50, + 0xf8, 0x50, + 0xf8, 0x50, + 0x00, 0x00, + 0x10, 0x38, + 0x40, 0x30, + 0x08, 0x78, + 0x20, 0x00, + 0x00, 0xd0, + 0xd0, 0x20, + 0x58, 0x58, + 0x00, 0x00, + 0x10, 0x38, + 0x40, 0x30, + 0x40, 0x38, + 0x10, 0x00, + 0x00, 0x20, + 0x20, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x10, + 0x20, 0x20, + 0x20, 0x10, + 0x00, 0x00, + 0x00, 0x20, + 0x10, 0x10, + 0x10, 0x20, + 0x00, 0x00, + 0x00, 0x20, + 0xa8, 0x70, + 0xa8, 0x20, + 0x00, 0x00, + 0x00, 0x20, + 0x20, 0xf8, + 0x20, 0x20, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x10, + 0x20, 0x00, + 0x00, 0x00, + 0x00, 0x70, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x20, + 0x00, 0x00, + 0x00, 0x10, + 0x10, 0x20, + 0x40, 0x40, + 0x00, 0x00, + 0x00, 0x30, + 0x48, 0x48, + 0x48, 0x30, + 0x00, 0x00, + 0x00, 0x60, + 0x20, 0x20, + 0x20, 0x70, + 0x00, 0x00, + 0x00, 0x70, + 0x08, 0x30, + 0x40, 0x78, + 0x00, 0x00, + 0x00, 0x70, + 0x08, 0x30, + 0x08, 0x70, + 0x00, 0x00, + 0x00, 0x50, + 0x50, 0x50, + 0x78, 0x10, + 0x00, 0x00, + 0x00, 0x78, + 0x40, 0x70, + 0x08, 0x70, + 0x00, 0x00, + 0x00, 0x30, + 0x40, 0x70, + 0x48, 0x30, + 0x00, 0x00, + 0x00, 0x78, + 0x08, 0x10, + 0x20, 0x20, + 0x00, 0x00, + 0x00, 0x30, + 0x48, 0x30, + 0x48, 0x30, + 0x00, 0x00, + 0x00, 0x30, + 0x48, 0x38, + 0x08, 0x30, + 0x00, 0x00, + 0x00, 0x00, + 0x20, 0x00, + 0x20, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x10, 0x00, + 0x10, 0x20, + 0x00, 0x00, + 0x00, 0x10, + 0x20, 0x40, + 0x20, 0x10, + 0x00, 0x00, + 0x00, 0x00, + 0x70, 0x00, + 0x70, 0x00, + 0x00, 0x00, + 0x00, 0x40, + 0x20, 0x10, + 0x20, 0x40, + 0x00, 0x00, + 0x00, 0x70, + 0x08, 0x30, + 0x00, 0x20, + 0x00, 0x00, + 0x00, 0x70, + 0xa8, 0xb0, + 0x80, 0x70, + 0x00, 0x00, + 0x00, 0x30, + 0x48, 0x78, + 0x48, 0x48, + 0x00, 0x00, + 0x00, 0x70, + 0x48, 0x70, + 0x48, 0x70, + 0x00, 0x00, + 0x00, 0x30, + 0x48, 0x40, + 0x48, 0x30, + 0x00, 0x00, + 0x00, 0x70, + 0x48, 0x48, + 0x48, 0x70, + 0x00, 0x00, + 0x00, 0x70, + 0x40, 0x70, + 0x40, 0x70, + 0x00, 0x00, + 0x00, 0x70, + 0x40, 0x70, + 0x40, 0x40, + 0x00, 0x00, + 0x00, 0x38, + 0x40, 0x58, + 0x48, 0x30, + 0x00, 0x00, + 0x00, 0x48, + 0x48, 0x78, + 0x48, 0x48, + 0x00, 0x00, + 0x00, 0x20, + 0x20, 0x20, + 0x20, 0x20, + 0x00, 0x00, + 0x00, 0x08, + 0x08, 0x08, + 0x48, 0x30, + 0x00, 0x00, + 0x00, 0x48, + 0x50, 0x60, + 0x50, 0x48, + 0x00, 0x00, + 0x00, 0x40, + 0x40, 0x40, + 0x40, 0x70, + 0x00, 0x00, + 0x00, 0x88, + 0xd8, 0xa8, + 0x88, 0x88, + 0x00, 0x00, + 0x00, 0x88, + 0xc8, 0xa8, + 0x98, 0x88, + 0x00, 0x00, + 0x00, 0x30, + 0x48, 0x48, + 0x48, 0x30, + 0x00, 0x00, + 0x00, 0x70, + 0x48, 0x70, + 0x40, 0x40, + 0x00, 0x00, + 0x00, 0x30, + 0x48, 0x48, + 0x48, 0x30, + 0x08, 0x00, + 0x00, 0x70, + 0x48, 0x70, + 0x50, 0x48, + 0x00, 0x00, + 0x00, 0x38, + 0x40, 0x30, + 0x08, 0x70, + 0x00, 0x00, + 0x00, 0x70, + 0x20, 0x20, + 0x20, 0x20, + 0x00, 0x00, + 0x00, 0x48, + 0x48, 0x48, + 0x48, 0x30, + 0x00, 0x00, + 0x00, 0x88, + 0x88, 0x50, + 0x50, 0x20, + 0x00, 0x00, + 0x00, 0x88, + 0xa8, 0xa8, + 0xa8, 0x50, + 0x00, 0x00, + 0x00, 0x88, + 0x50, 0x20, + 0x50, 0x88, + 0x00, 0x00, + 0x00, 0x88, + 0x50, 0x20, + 0x20, 0x20, + 0x00, 0x00, + 0x00, 0x70, + 0x10, 0x20, + 0x40, 0x70, + 0x00, 0x00, + 0x00, 0x30, + 0x20, 0x20, + 0x20, 0x30, + 0x00, 0x00, + 0x00, 0x40, + 0x40, 0x20, + 0x10, 0x10, + 0x00, 0x00, + 0x00, 0x30, + 0x10, 0x10, + 0x10, 0x30, + 0x00, 0x00, + 0x00, 0x20, + 0x50, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x78, 0x00, + 0x00, 0x20, + 0x10, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x30, + 0x48, 0x78, + 0x48, 0x48, + 0x00, 0x00, + 0x00, 0x70, + 0x48, 0x70, + 0x48, 0x70, + 0x00, 0x00, + 0x00, 0x30, + 0x48, 0x40, + 0x48, 0x30, + 0x00, 0x00, + 0x00, 0x70, + 0x48, 0x48, + 0x48, 0x70, + 0x00, 0x00, + 0x00, 0x70, + 0x40, 0x70, + 0x40, 0x70, + 0x00, 0x00, + 0x00, 0x70, + 0x40, 0x70, + 0x40, 0x40, + 0x00, 0x00, + 0x00, 0x38, + 0x40, 0x58, + 0x48, 0x30, + 0x00, 0x00, + 0x00, 0x48, + 0x48, 0x78, + 0x48, 0x48, + 0x00, 0x00, + 0x00, 0x20, + 0x20, 0x20, + 0x20, 0x20, + 0x00, 0x00, + 0x00, 0x08, + 0x08, 0x08, + 0x48, 0x30, + 0x00, 0x00, + 0x00, 0x48, + 0x50, 0x60, + 0x50, 0x48, + 0x00, 0x00, + 0x00, 0x40, + 0x40, 0x40, + 0x40, 0x70, + 0x00, 0x00, + 0x00, 0x88, + 0xd8, 0xa8, + 0x88, 0x88, + 0x00, 0x00, + 0x00, 0x88, + 0xc8, 0xa8, + 0x98, 0x88, + 0x00, 0x00, + 0x00, 0x30, + 0x48, 0x48, + 0x48, 0x30, + 0x00, 0x00, + 0x00, 0x70, + 0x48, 0x70, + 0x40, 0x40, + 0x00, 0x00, + 0x00, 0x30, + 0x48, 0x48, + 0x48, 0x30, + 0x08, 0x00, + 0x00, 0x70, + 0x48, 0x70, + 0x50, 0x48, + 0x00, 0x00, + 0x00, 0x38, + 0x40, 0x30, + 0x08, 0x70, + 0x00, 0x00, + 0x00, 0x70, + 0x20, 0x20, + 0x20, 0x20, + 0x00, 0x00, + 0x00, 0x48, + 0x48, 0x48, + 0x48, 0x30, + 0x00, 0x00, + 0x00, 0x88, + 0x88, 0x50, + 0x50, 0x20, + 0x00, 0x00, + 0x00, 0x88, + 0xa8, 0xa8, + 0xa8, 0x50, + 0x00, 0x00, + 0x00, 0x88, + 0x50, 0x20, + 0x50, 0x88, + 0x00, 0x00, + 0x00, 0x88, + 0x50, 0x20, + 0x20, 0x20, + 0x00, 0x00, + 0x00, 0x70, + 0x10, 0x20, + 0x40, 0x70, + 0x00, 0x00, + 0x00, 0x30, + 0x20, 0x40, + 0x20, 0x30, + 0x00, 0x00, + 0x20, 0x20, + 0x20, 0x20, + 0x20, 0x20, + 0x20, 0x00, + 0x00, 0x60, + 0x20, 0x10, + 0x20, 0x60, + 0x00, 0x00, + 0x00, 0x28, + 0x50, 0x00, + 0x00, 0x00, + 0x00, 0x00 +}; diff --git a/tracker/src/corelib/corelib_font.c b/tracker/src/corelib/corelib_font.c index 492166f..2426bc3 100644 --- a/tracker/src/corelib/corelib_font.c +++ b/tracker/src/corelib/corelib_font.c @@ -9,6 +9,7 @@ #define TEXT_COLS 40 #define TEXT_ROWS 20 +extern uint8_t font6x8[]; extern uint8_t font12x16[]; extern uint8_t font16x24[]; extern uint8_t font24x36[]; @@ -18,13 +19,14 @@ extern uint8_t font48x54[]; static const Font defaultFont = { .name = "Default", .resolutions = { + {6, 8, font6x8}, {12, 16, font12x16}, {16, 24, font16x24}, {24, 36, font24x36}, {32, 48, font32x48}, {48, 54, font48x54} }, - .resolutionCount = 5 + .resolutionCount = 6 }; static const Font* currentFont = &defaultFont; diff --git a/tracker/src/corelib/corelib_font.h b/tracker/src/corelib/corelib_font.h index c1fffdb..8565c7a 100644 --- a/tracker/src/corelib/corelib_font.h +++ b/tracker/src/corelib/corelib_font.h @@ -13,7 +13,7 @@ typedef struct { // Font with multiple resolutions typedef struct { char name[16]; - FontResolution resolutions[5]; // Up to 5 resolutions + FontResolution resolutions[6]; // Up to 6 resolutions int resolutionCount; } Font;