ref: e2fb0db68f1026ff959f7363cfb92aecec206064
parent: c16e507cbccc207373997181781754e73465fb0d
parent: 7de8e37ce4530041837a3ee784d3a5caa1363b40
author: Jonne Kokkonen <jonne.kokkonen@gmail.com>
date: Tue May 23 04:32:23 EDT 2023
Merge pull request #113 from laamaa/feature/fw305 Firmware 3.1.0 support
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,6 @@
result*
cmake-build-*
.idea
+CMakeCache.txt
+CMakeFiles/
+cmake_install.cmake
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,27 +16,7 @@
link_directories(${SDL2_LIBRARY_DIRS} ${LIBSERIALPORT_LIBRARY_DIRS})endif (USE_LIBUSB)
-string(CONCAT FILE_CONTENT "#include <SDL.h>")
-
-file(READ inline_font.h INLINE_FONT_HEADER)
-string(CONCAT FILE_CONTENT ${FILE_CONTENT} "${INLINE_FONT_HEADER}")-
-file(STRINGS inprint2.c INPRINT_C)
-
-unset(ModifiedContents)
-foreach (Line ${INPRINT_C})- if (NOT "${Line}" MATCHES "^#include")- set(ModifiedContents "${ModifiedContents}${Line}\n")- endif ()
-endforeach ()
-
-string(CONCAT FILE_CONTENT "${FILE_CONTENT}" "${ModifiedContents}")-
-file(WRITE font.c "${FILE_CONTENT}")-
file(GLOB m8c_SRC "*.h" "*.c")
-
-list(FILTER m8c_SRC EXCLUDE REGEX ".*inprint2\\.c$")
set(MACOS_CONTENTS "${CMAKE_CURRENT_SOURCE_DIR}/macos/m8c.app/Contents")--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,12 @@
#Set all your object files (the object files of all the .c files in your project, e.g. main.o my_sub_functions.o )
-OBJ = main.o serial.o slip.o command.o render.o ini.o config.o input.o font.o fx_cube.o usb.o audio.o usb_audio.o ringbuffer.o
+OBJ = main.o serial.o slip.o command.o render.o ini.o config.o input.o fx_cube.o usb.o audio.o usb_audio.o ringbuffer.o inprint2.o
#Set any dependant header files so that if they are edited they cause a complete re-compile (e.g. main.h some_subfunctions.h some_definitions_file.h ), or leave blank
-DEPS = serial.h slip.h command.h render.h ini.h config.h input.h fx_cube.h audio.h ringbuffer.h
+DEPS = serial.h slip.h command.h render.h ini.h config.h input.h fx_cube.h audio.h ringbuffer.h inline_font.h
#Any special libraries you are using in your project (e.g. -lbcm2835 -lrt `pkg-config --libs gtk+-3.0` ), or leave blank
INCLUDES = $(shell pkg-config --libs sdl2 libserialport)
-
-
#Set any compiler flags you want to use (e.g. -I/usr/include/somefolder `pkg-config --cflags gtk+-3.0` ), or leave blank
local_CFLAGS = $(CFLAGS) $(shell pkg-config --cflags sdl2 libserialport) -Wall -O2 -pipe -I.
@@ -31,21 +29,11 @@
libusb: local_CFLAGS = $(CFLAGS) $(shell pkg-config --cflags sdl2 libusb-1.0) -Wall -O2 -pipe -I. -DUSE_LIBUSB=1
libusb: m8c
-font.c: inline_font.h
- @echo "#include <SDL.h>" > $@-tmp1
- @cat inline_font.h >> $@-tmp1
- @cat inprint2.c > $@-tmp2
- @sed '/#include/d' $@-tmp2 >> $@-tmp1
- @rm $@-tmp2
- @mv $@-tmp1 $@
- @echo "[~cat] inline_font.h inprint2.c > font.c"
-# $(CC) -c -o font.o font.c $(local_CFLAGS)
-
#Cleanup
.PHONY: clean
clean:
- rm -f *.o *~ m8c *~ font.c
+ rm -f *.o *~ m8c
# PREFIX is environment variable, but if it is not set, then set default value
ifeq ($(PREFIX),)
--- a/SDL2_inprint.h
+++ b/SDL2_inprint.h
@@ -7,7 +7,7 @@
#include <SDL.h>
-extern void prepare_inline_font(void);
+extern void prepare_inline_font(unsigned char bits[],int font_width, int font_height);
extern void kill_inline_font(void);
extern void inrenderer(SDL_Renderer *renderer);
--- a/command.c
+++ b/command.c
@@ -20,7 +20,9 @@
draw_oscilloscope_waveform_command_mindatalength = 1 + 3,
draw_oscilloscope_waveform_command_maxdatalength = 1 + 3 + 320,
joypad_keypressedstate_command = 0xFB,
- joypad_keypressedstate_command_datalength = 2
+ joypad_keypressedstate_command_datalength = 3,
+ system_info_command = 0xFF,
+ system_info_command_datalength = 6
};
static inline void dump_packet(uint32_t size, uint8_t *recv_buf) {@@ -115,21 +117,52 @@
break;
- case joypad_keypressedstate_command:
- /*
+ case joypad_keypressedstate_command: { if (size != joypad_keypressedstate_command_datalength) {- SDL_LogError(SDL_LOG_CATEGORY_ERROR,
- "Invalid joypad keypressed state packet: expected length %d, "
- "got %d\n",
- joypad_keypressedstate_command_datalength, size);
+ SDL_LogError(
+ SDL_LOG_CATEGORY_ERROR,
+ "Invalid joypad keypressed state packet: expected length %d, "
+ "got %d\n",
+ joypad_keypressedstate_command_datalength, size);
dump_packet(size, recv_buf);
+ return 0;
break;
- } */
+ }
// nothing is done with joypad key pressed packets for now
return 1;
break;
+ }
+ case system_info_command: {+ if (size != system_info_command_datalength) {+ SDL_LogError(SDL_LOG_CATEGORY_ERROR,
+ "Invalid system info packet: expected length %d, "
+ "got %d\n",
+ system_info_command_datalength, size);
+ dump_packet(size, recv_buf);
+ break;
+ }
+
+ char *hwtype[3] = {"Headless", "Beta M8", "Production M8"};+
+ static int system_info_printed = 0;
+
+ if (system_info_printed == 0) {+ SDL_Log("** Hardware info ** Device type: %s, Firmware ver %d.%d.%d",+ hwtype[recv_buf[1]], recv_buf[2], recv_buf[3], recv_buf[4]);
+ system_info_printed = 1;
+ }
+
+ if (recv_buf[5] == 0x01) {+ set_large_mode(1);
+ } else {+ set_large_mode(0);
+ }
+ return 1;
+ break;
+ }
+
default:
SDL_LogError(SDL_LOG_CATEGORY_ERROR, "Invalid packet\n");
@@ -137,4 +170,5 @@
return 0;
break;
}
+ return 1;
}
--- a/command.h
+++ b/command.h
@@ -41,16 +41,6 @@
uint16_t waveform_size;
};
-struct command_queues {- struct draw_rectangle_command rectangles[128];
- uint8_t rectangles_queue_size;
- struct draw_character_command characters[128];
- uint8_t characters_queue_size;
- struct draw_oscilloscope_waveform_command waveform;
- uint8_t waveforms_queue_size;
-};
-
-
int process_command(uint8_t *data, uint32_t size);
-#endif
\ No newline at end of file
+#endif
--- a/fx_cube.c
+++ b/fx_cube.c
@@ -70,7 +70,7 @@
SDL_SetRenderDrawColor(fx_renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
SDL_RenderClear(fx_renderer);
- inprint(fx_renderer, text_disconnected, 168, 230, 0xFFFFFF, 0x000000);
+ inprint(fx_renderer, text_disconnected, 150, 228, 0xFFFFFF, 0x000000);
inprint(fx_renderer, text_m8c, 2, 2, 0xFFFFFF, 0x000000);
SDL_SetRenderTarget(fx_renderer, og_target);
--- a/inline_font.h
+++ b/inline_font.h
@@ -1,102 +1,10 @@
-/*
-The FontStruction “M8stealth57”
-(https://fontstruct.com/fontstructions/show/2043303) by “trash80” is licensed
-under a Creative Commons Attribution Share Alike license
-(http://creativecommons.org/licenses/by-sa/3.0/). “M8stealth57” was originally
-cloned (copied) from the FontStruction “stealth57”
-(https://fontstruct.com/fontstructions/show/413734) by “trash80”, which is
-licensed under a Creative Commons Attribution Share Alike license
-(http://creativecommons.org/licenses/by-sa/3.0/).
+#ifndef INLINE_FONT_H_
+#define INLINE_FONT_H_
-Used with permission from the author.
-*/
+struct inline_font {+ int width;
+ int height;
+ unsigned char bits[];
+};
-#define inline_font_width 128
-#define inline_font_height 64
-static unsigned char inline_font_bits[] = {- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf5, 0xff, 0xfb, 0xff, 0xf9, 0xfb,
- 0xef, 0xfe, 0xff, 0xff, 0xff, 0x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0, 0xe0, 0xe0,
- 0xff, 0xef, 0xee, 0xfe, 0xee, 0xee, 0xfb, 0xee, 0xee, 0xfb, 0xf7, 0xf6,
- 0xfb, 0xea, 0xee, 0xee, 0xff, 0xe0, 0xee, 0xfe, 0xee, 0xe0, 0xfb, 0xe0,
- 0xee, 0xfb, 0xf7, 0xfa, 0xfb, 0xea, 0xee, 0xee, 0xff, 0xee, 0xee, 0xfe,
- 0xee, 0xfe, 0xfb, 0xef, 0xee, 0xfb, 0xf7, 0xf4, 0xfb, 0xea, 0xee, 0xee,
- 0xff, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xfb, 0xe0, 0xee, 0xf1, 0xf8, 0xee,
- 0xf1, 0xea, 0xee, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xfb, 0xe0, 0xff, 0xc0,
- 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee,
- 0xfb, 0xee, 0xed, 0xd6, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xee, 0xee, 0xea,
- 0xee, 0xee, 0xe0, 0xee, 0xfb, 0xee, 0xf2, 0xd4, 0xee, 0xee, 0xfe, 0xfe,
- 0xfb, 0xee, 0xee, 0xea, 0xf5, 0xee, 0xf7, 0xee, 0xfb, 0xea, 0xff, 0xda,
- 0xee, 0xee, 0xfe, 0xe0, 0xfb, 0xee, 0xf6, 0xea, 0xfb, 0xe0, 0xfb, 0xee,
- 0xfb, 0xee, 0xff, 0xd4, 0xe0, 0xe0, 0xfe, 0xef, 0xfb, 0xee, 0xfa, 0xea,
- 0xf5, 0xef, 0xfd, 0xee, 0xfb, 0xee, 0xff, 0xd6, 0xfe, 0xef, 0xfe, 0xe0,
- 0xe3, 0xe0, 0xfc, 0xe0, 0xee, 0xe0, 0xe0, 0xe0, 0xfb, 0xe0, 0xff, 0xc0,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff};
+#endif
--- a/inline_font.h.comicsans
+++ /dev/null
@@ -1,82 +1,0 @@
-#define inline_font_width 128
-#define inline_font_height 64
-static unsigned char inline_font_bits[] = {-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xf3, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xfd, 0xf9, 0xff, 0xf1, 0xf9, 0xf9, 0xfb, 0xfd, 0xfb, 0xff, 0xfd, 0xff, 0xff,
-0xff, 0xf7, 0xff, 0xfd, 0xf9, 0xf5, 0xfa, 0xe9, 0xf9, 0xfb, 0xfd, 0xf7, 0xf9,
-0xf8, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xfd, 0xf9, 0xf0, 0xf9, 0xf1, 0xf9, 0xfb,
-0xfd, 0xf7, 0xf0, 0xfd, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xfd, 0xff, 0xf5, 0xe3,
-0xfb, 0xf2, 0xff, 0xfd, 0xf7, 0xf9, 0xff, 0xff, 0xfc, 0xff, 0xfd, 0xff, 0xff,
-0xff, 0xf0, 0xeb, 0xe3, 0xf6, 0xff, 0xfd, 0xf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ff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xfc, 0xfb, 0xfb, 0xfe,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xfd, 0xfb, 0xfd, 0xff, 0xf0, 0xf8, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xf6, 0xf2,
-0xff, 0xff, 0xf1, 0xfd, 0xfb, 0xfd, 0xff, 0xf6, 0xf6, 0xf1, 0xf8, 0xf8, 0xf0,
-0xf6, 0xf5, 0xf2, 0xf6, 0xf6, 0xfb, 0xfd, 0xfb, 0xfe, 0xf5, 0xf6, 0xf6, 0xf6,
-0xfe, 0xfe, 0xfd, 0xf6, 0xf9, 0xf0, 0xf9, 0xf6, 0xfd, 0xfe, 0xfb, 0xf9, 0xf2,
-0xf6, 0xf8, 0xf6, 0xfe, 0xf9, 0xfd, 0xf6, 0xfb, 0xf5, 0xf9, 0xf9, 0xf0, 0xfd,
-0xfb, 0xfd, 0xff, 0xf6, 0xfe, 0xf1, 0xfe, 0xf8, 0xf1, 0xf0, 0xff, 0xff, 0xf6,
-0xfb, 0xff, 0xfd, 0xfb, 0xfd, 0xff, 0xf6, 0xfe, 0xf7, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xfd, 0xff, 0xfb, 0xfb, 0xfe, 0xff, 0xf6 };
--- /dev/null
+++ b/inline_font_large.h
@@ -1,0 +1,133 @@
+#ifndef INLINE_FONT_LARGE_H_
+#define INLINE_FONT_LARGE_H_
+
+#include "inline_font.h"
+
+struct inline_font inline_font_large = {+ 144,
+ 88,
+ {+0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00,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x1f,
+0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0xe7, 0x4f, 0xfe, 0x7f, 0xfe, 0xff, 0xff, 0xf3, 0x3f,
+0xf3, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0x4f, 0xfe, 0x0f,
+0x70, 0xef, 0xf8, 0xf3, 0x9f, 0xe7, 0x87, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f,
+0xff, 0xe7, 0x4f, 0xde, 0x4e, 0xbe, 0x76, 0xf2, 0xf3, 0xcf, 0xcf, 0xcf, 0x3f,
+0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xe7, 0xff, 0x0f, 0x4c, 0x7e, 0x7b, 0xf2,
+0xff, 0xcf, 0xcf, 0x87, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xe7, 0xff,
+0xdf, 0x0e, 0xf0, 0xfd, 0xf8, 0xff, 0xcf, 0xcf, 0x33, 0x0f, 0xfc, 0x3f, 0xf0,
+0xff, 0xf3, 0xff, 0xe7, 0xff, 0xdf, 0x7e, 0xf2, 0x76, 0xf8, 0xff, 0xcf, 0xcf,
+0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff, 0x0f, 0x7c, 0x72,
+0x2b, 0xc3, 0xff, 0xcf, 0xcf, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff,
+0xff, 0xff, 0xdf, 0x0e, 0xb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ff, 0xfc, 0x49,
+0x92, 0xff, 0x79, 0x9e, 0x27, 0x4f, 0x92, 0xc3, 0xcf, 0xcf, 0x7f, 0x7e, 0x7e,
+0xfe, 0xff, 0xff, 0xfc, 0x99, 0x32, 0xff, 0x79, 0x9e, 0x67, 0x66, 0x80, 0x99,
+0xcf, 0xe7, 0x7f, 0xfe, 0x7c, 0xfe, 0xff, 0xff, 0xfc, 0x39, 0x73, 0xe6, 0x79,
+0x9e, 0xe7, 0x70, 0x8c, 0x3c, 0xcf, 0xf3, 0x7f, 0xfe, 0x79, 0xfe, 0xff, 0xff,
+0xfc, 0x43, 0xf2, 0x0c, 0x7c, 0x3e, 0xf0, 0x79, 0x9e, 0x3c, 0xcf, 0x03, 0x7c,
+0xf8, 0x13, 0xfe, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xfc, 0xff, 0xf3, 0xff, 0xff, 0xf3, 0x7f, 0xc0, 0xff, 0xfc, 0xcf,
+0xff, 0xe4, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xf3, 0xff, 0xff, 0xf3,
+0x7f, 0xfe, 0xff, 0xfc, 0xff, 0xff, 0xe7, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xf3,
+0x01, 0x02, 0x04, 0x08, 0x10, 0x60, 0x7e, 0x80, 0x00, 0xc3, 0x07, 0xe4, 0x39,
+0x1f, 0x20, 0x40, 0x80, 0xff, 0x7f, 0xf2, 0xe4, 0xcf, 0x93, 0x27, 0x40, 0x9e,
+0x3c, 0xcf, 0xff, 0xe4, 0x3c, 0x9f, 0x24, 0x4f, 0x9e, 0xff, 0x7f, 0xf2, 0xe4,
+0xcf, 0x93, 0x67, 0x7e, 0x9e, 0x3c, 0xcf, 0xff, 0x64, 0x3e, 0x9f, 0x24, 0x4f,
+0x9e, 0xff, 0x01, 0xf2, 0xe4, 0xcf, 0x13, 0x60, 0x7e, 0x80, 0x3c, 0xcf, 0xff,
+0x04, 0x3f, 0x9f, 0x24, 0x4f, 0x9e, 0xff, 0x79, 0xf2, 0xe4, 0xcf, 0x93, 0x7f,
+0xfe, 0x9f, 0x3c, 0xcf, 0xff, 0x64, 0x3e, 0x9f, 0x24, 0x4f, 0x9e, 0xff, 0x79,
+0xf2, 0xe4, 0xcf, 0x93, 0x7f, 0xfe, 0x9f, 0x3c, 0xcf, 0xff, 0xe4, 0x3c, 0x9f,
+0x24, 0x4f, 0x9e, 0xff, 0x01, 0x02, 0x04, 0x08, 0x10, 0x60, 0x7e, 0x80, 0x3c,
+0x01, 0x02, 0xe4, 0x09, 0x90, 0x24, 0x4f, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0x07, 0x78, 0x1e, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0x79, 0x9e, 0xe7,
+0xff, 0xff, 0x00, 0x01, 0x02, 0x04, 0x08, 0x90, 0x27, 0x4f, 0x92, 0x3c, 0x79,
+0x02, 0xe4, 0x79, 0x9e, 0xe7, 0xff, 0xff, 0x3c, 0x79, 0xf2, 0xe7, 0x9f, 0x9f,
+0x27, 0x67, 0x92, 0x99, 0x79, 0x7e, 0xe6, 0x79, 0x9e, 0x67, 0xfc, 0xff, 0x3c,
+0x79, 0xf2, 0xe7, 0x9f, 0x9f, 0x27, 0x73, 0x92, 0xc3, 0x79, 0x3e, 0xe7, 0x79,
+0x9e, 0x27, 0xc9, 0xff, 0x00, 0x01, 0xf2, 0x07, 0x98, 0x9f, 0x27, 0x79, 0x92,
+0xe7, 0x01, 0x9e, 0xe7, 0x79, 0x9e, 0xe7, 0xe3, 0xff, 0xfc, 0x7f, 0xf2, 0xff,
+0x99, 0x9f, 0x27, 0x7c, 0x92, 0xc3, 0x7f, 0xce, 0xe7, 0x79, 0x9e, 0xe7, 0xff,
+0xff, 0xfc, 0x7f, 0xf2, 0xff, 0x99, 0x9f, 0x27, 0x7e, 0x92, 0x99, 0x7f, 0xe6,
+0xe7, 0x79, 0x9e, 0xe7, 0xff, 0xff, 0xfc, 0x7f, 0xf2, 0x07, 0x18, 0x10, 0x20,
+0x7f, 0x80, 0x3c, 0x01, 0x02, 0x04, 0x78, 0x1e, 0xe0, 0xff, 0xff }};
+
+#endif
--- /dev/null
+++ b/inline_font_small.h
@@ -1,0 +1,84 @@
+/*
+The FontStruction “M8stealth57”
+(https://fontstruct.com/fontstructions/show/2043303) by “trash80” is licensed
+under a Creative Commons Attribution Share Alike license
+(http://creativecommons.org/licenses/by-sa/3.0/). “M8stealth57” was originally
+cloned (copied) from the FontStruction “stealth57”
+(https://fontstruct.com/fontstructions/show/413734) by “trash80”, which is
+licensed under a Creative Commons Attribution Share Alike license
+(http://creativecommons.org/licenses/by-sa/3.0/).
+
+Used with permission from the author.
+*/
+
+#ifndef INLINE_FONT_SMALL_H_
+#define INLINE_FONT_SMALL_H_
+
+#include "inline_font.h"
+
+struct inline_font inline_font_small = {+ 96,
+ 64,
+ {+0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf,
+0x65, 0x59, 0x96, 0x65, 0x59, 0x96, 0x65, 0x59, 0x96, 0x65, 0x59, 0x3f, 0x45,
+0x51, 0x14, 0x45, 0x51, 0x14, 0x45, 0x51, 0x14, 0x45, 0x51, 0xbf, 0xa6, 0x69,
+0x9a, 0xa6, 0x69, 0x9a, 0xa6, 0x69, 0x9a, 0xa6, 0x69, 0x3f, 0x45, 0x51, 0x14,
+0x45, 0x51, 0x14, 0x45, 0x51, 0x14, 0x45, 0x51, 0xbf, 0x65, 0x59, 0x96, 0x65,
+0x59, 0x96, 0x65, 0x59, 0x96, 0x65, 0x59, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x96, 0x65, 0x59, 0x96, 0x65, 0x59, 0x96, 0x65, 0x59,
+0x96, 0x65, 0x59, 0x14, 0x45, 0x51, 0x14, 0x45, 0x51, 0x14, 0x45, 0x51, 0x14,
+0x45, 0x51, 0x9a, 0xa6, 0x69, 0x9a, 0xa6, 0x69, 0x9a, 0xa6, 0x69, 0x9a, 0xa6,
+0x69, 0x14, 0x45, 0x51, 0x14, 0x45, 0x51, 0x14, 0x45, 0x51, 0x14, 0x45, 0x51,
+0x96, 0x65, 0x59, 0x96, 0x65, 0x59, 0x96, 0x65, 0x59, 0x96, 0x65, 0x59, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x5f, 0xff,
+0xfb, 0x9f, 0xef, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xbf, 0x5f, 0xd7, 0x20,
+0x6b, 0xef, 0x77, 0x5f, 0xef, 0xff, 0xff, 0xbf, 0xbf, 0xff, 0x83, 0x3a, 0xad,
+0xff, 0x77, 0xbf, 0xef, 0xff, 0xff, 0xdf, 0xbf, 0xff, 0xd7, 0xe0, 0xde, 0xfe,
+0x77, 0x5f, 0x83, 0x3f, 0xf8, 0xef, 0xbf, 0xff, 0x83, 0x6b, 0xa9, 0xfe, 0x77,
+0xff, 0xef, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xd7, 0xa0, 0x69, 0xff, 0x77, 0xff,
+0xef, 0xfb, 0xff, 0xfb, 0xbf, 0xff, 0xff, 0xfb, 0x9f, 0xfe, 0xaf, 0xff, 0xff,
+0xfb, 0xbf, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xe0, 0x0e, 0x82, 0x2e, 0x08, 0x82, 0x21, 0xf8, 0xff, 0xff, 0xff,
+0xc7, 0x2e, 0xfe, 0xbe, 0xae, 0xef, 0xbf, 0xae, 0xfb, 0xff, 0xf7, 0xdf, 0xbb,
+0xe6, 0xfe, 0xbe, 0xae, 0xef, 0xbf, 0xae, 0xdb, 0xf7, 0x33, 0x98, 0xbf, 0xea,
+0x0e, 0x82, 0x20, 0x08, 0xde, 0x20, 0xf8, 0xff, 0xf1, 0x1f, 0xdf, 0xec, 0xee,
+0xbf, 0xef, 0xeb, 0xee, 0xee, 0xfb, 0xff, 0x33, 0x98, 0xef, 0xee, 0xee, 0xbf,
+0xef, 0xeb, 0xee, 0xee, 0xdb, 0xf7, 0xf7, 0xdf, 0xff, 0x20, 0x08, 0x82, 0x2f,
+0x08, 0xee, 0xf0, 0xfb, 0xf7, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x71, 0x0c, 0xc7, 0x30, 0x08, 0xc6,
+0x2e, 0xf8, 0xba, 0xbe, 0xeb, 0xc6, 0xae, 0xeb, 0xba, 0xae, 0xef, 0xbb, 0xee,
+0xfe, 0xda, 0x3e, 0xc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fb, 0xef, 0xff, 0xef, 0xbf, 0xff, 0xfe, 0xff, 0xfb, 0xfb,
+0xff, 0xff, 0x3f, 0x08, 0x82, 0x20, 0x08, 0x82, 0x60, 0x7e, 0xbb, 0x3b, 0x08,
+0x82, 0xff, 0xeb, 0xfa, 0xae, 0xbb, 0xbb, 0xee, 0x7e, 0xdb, 0xbb, 0xea, 0xba,
+0x3f, 0xe8, 0xfa, 0x2e, 0xb8, 0x83, 0xee, 0x7e, 0xeb, 0xbb, 0xea, 0xba, 0xbf,
+0xeb, 0xfa, 0xae, 0xbf, 0xbf, 0xee, 0x7e, 0xd3, 0xbb, 0xea, 0xba, 0x3f, 0x08,
+0x82, 0x20, 0xb8, 0x83, 0x6e, 0x8c, 0xbb, 0xb1, 0xea, 0x82, 0xff, 0xff, 0xff,
+0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb,
+0xff, 0xff, 0xff, 0xff, 0x83, 0x3b, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff,
+0xff, 0xff, 0xff, 0xbb, 0xbb, 0xdb, 0xfe, 0x20, 0x08, 0x82, 0xa0, 0xeb, 0xaa,
+0xae, 0x0b, 0xba, 0xbb, 0x2b, 0xff, 0xae, 0xeb, 0xfb, 0xbb, 0xeb, 0xaa, 0xb5,
+0x7b, 0xbb, 0xbb, 0xfa, 0xff, 0xae, 0xeb, 0x83, 0xbb, 0x6b, 0xab, 0x3b, 0xb8,
+0xbb, 0xbb, 0xfb, 0xff, 0x20, 0xe8, 0xbf, 0xbb, 0xab, 0xab, 0xf5, 0xdb, 0xbb,
+0xbb, 0xfb, 0xff, 0xfe, 0xeb, 0x83, 0x23, 0xc8, 0x83, 0x2e, 0x08, 0x82, 0x3b,
+0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+0xff }};
+
+#endif
--- a/inprint2.c
+++ b/inprint2.c
@@ -1,11 +1,9 @@
-// Bitmap font routine originally by driedfruit, https://github.com/driedfruit/SDL_inprint
-// Released into public domain.
-// Modified to support adding a background to text.
+// Bitmap font routine originally by driedfruit,
+// https://github.com/driedfruit/SDL_inprint Released into public domain.
+// Modified to support multiple fonts & adding a background to text.
#include <SDL.h>
-#include "inline_font.h" /* Actual font data */
-
#define CHARACTERS_PER_ROW 16 /* I like 16 x 8 fontsets. */
#define CHARACTERS_PER_COLUMN 8 /* 128 x 1 is another popular format. */
@@ -14,14 +12,15 @@
static SDL_Texture *selected_font = NULL;
static Uint16 selected_font_w, selected_font_h;
-void prepare_inline_font() {+void prepare_inline_font(unsigned char bits[], int font_width,
+ int font_height) {Uint32 *pix_ptr, tmp;
int i, len, j;
SDL_Surface *surface;
Uint32 colors[2];
- selected_font_w = inline_font_width;
- selected_font_h = inline_font_height;
+ selected_font_w = font_width;
+ selected_font_h = font_height;
if (inline_font != NULL) {selected_font = inline_font;
@@ -28,7 +27,7 @@
return;
}
- surface = SDL_CreateRGBSurface(0, inline_font_width, inline_font_height, 32,
+ surface = SDL_CreateRGBSurface(0, font_width, font_height, 32,
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff
#else
@@ -45,7 +44,7 @@
/* Copy */
for (i = 0; i < len; i++) {- tmp = (Uint8)inline_font_bits[i];
+ tmp = (Uint8)bits[i];
for (j = 0; j < 8; j++) {Uint8 mask = (0x01 << j);
pix_ptr[i * 8 + j] = colors[(tmp & mask) >> j];
@@ -68,7 +67,7 @@
int w, h;
if (font == NULL) {- prepare_inline_font();
+ // prepare_inline_font();
return;
}
@@ -128,6 +127,7 @@
incolor(fgcolor, 0);
previous_fgcolor = fgcolor;
}
+
if (bgcolor != -1) {SDL_SetRenderDrawColor(selected_renderer,
(Uint8)((bgcolor & 0x00FF0000) >> 16),
@@ -134,7 +134,13 @@
(Uint8)((bgcolor & 0x0000FF00) >> 8),
(Uint8)((bgcolor & 0x000000FF)), 0xFF);
bg_rect = d_rect;
- bg_rect.w = 6;
+ bg_rect.w = selected_font_w / CHARACTERS_PER_ROW - 1;
+ // Silly hack to get big font background aligned correctly.
+ if (bg_rect.h == 11) {+ bg_rect.y++;
+ bg_rect.w++;
+ }
+
SDL_RenderFillRect(dst, &bg_rect);
}
SDL_RenderCopy(dst, selected_font, &s_rect, &d_rect);
--- a/render.c
+++ b/render.c
@@ -8,17 +8,26 @@
#include "SDL2_inprint.h"
#include "SDL_log.h"
+#include "SDL_rect.h"
#include "SDL_render.h"
+#include "SDL_stdinc.h"
#include "command.h"
#include "fx_cube.h"
+#include "inline_font.h"
+#include "inline_font_large.h"
+#include "inline_font_small.h"
+
SDL_Window *win;
SDL_Renderer *rend;
SDL_Texture *maintexture;
-SDL_Color background_color = (SDL_Color){.r = 0x00, .g = 0x00, .b = 0x00, .a = 0x00};+SDL_Color background_color =
+ (SDL_Color){.r = 0x00, .g = 0x00, .b = 0x00, .a = 0x00};static uint32_t ticks_fps;
static int fps;
+static int large_font_enabled = 0;
+static int screen_offset_y = 0;
uint8_t fullscreen = 0;
@@ -26,7 +35,7 @@
// Initializes SDL and creates a renderer and required surfaces
int initialize_sdl(int init_fullscreen, int init_use_gpu) {- //ticks = SDL_GetTicks();
+ // ticks = SDL_GetTicks();
const int window_width = 640; // SDL window width
const int window_height = 480; // SDL window height
@@ -54,13 +63,14 @@
SDL_SetRenderTarget(rend, maintexture);
SDL_SetRenderDrawColor(rend, background_color.r, background_color.g,
- background_color.b, background_color.a);
+ background_color.b, background_color.a);
SDL_RenderClear(rend);
// Initialize a texture for the font and read the inline font bitmap
inrenderer(rend);
- prepare_inline_font();
+ struct inline_font *font = &inline_font_small;
+ prepare_inline_font(font->bits, font->width, font->height);
SDL_LogSetAllPriority(SDL_LOG_PRIORITY_INFO);
@@ -69,7 +79,25 @@
return 1;
}
+static void change_font(struct inline_font *font) {+ kill_inline_font();
+ prepare_inline_font(font->bits, font->width, font->height);
+}
+
+void set_large_mode(int enabled) {+ if (enabled) {+ large_font_enabled = 1;
+ screen_offset_y = 41;
+ change_font(&inline_font_large);
+ } else {+ large_font_enabled = 0;
+ screen_offset_y = 0;
+ change_font(&inline_font_small);
+ }
+}
+
void close_renderer() {+ kill_inline_font();
SDL_DestroyTexture(maintexture);
SDL_DestroyRenderer(rend);
SDL_DestroyWindow(win);
@@ -93,15 +121,16 @@
uint32_t bgcolor = (command->background.r << 16) |
(command->background.g << 8) | command->background.b;
- if (bgcolor == fgcolor) {- // When bgcolor and fgcolor are the same, do not render a background
- inprint(rend, (char *)&command->c, command->pos.x, command->pos.y + 3,
- fgcolor, -1);
- } else {- inprint(rend, (char *)&command->c, command->pos.x, command->pos.y + 3,
- fgcolor, bgcolor);
- }
+ /* Notes:
+ If large font is enabled, offset the screen elements by a fixed amount.
+ If background and foreground colors are the same, draw transparent
+ background. Due to the font bitmaps, a different pixel offset is needed for
+ both*/
+ inprint(rend, (char *)&command->c, command->pos.x,
+ command->pos.y + (large_font_enabled ? 2 : 3) - screen_offset_y,
+ fgcolor, (bgcolor == fgcolor) ? -1 : bgcolor);
+
dirty = 1;
return 1;
@@ -112,7 +141,11 @@
SDL_Rect render_rect;
render_rect.x = command->pos.x;
- render_rect.y = command->pos.y;
+ if (large_font_enabled == 1) {+ render_rect.y = command->pos.y - screen_offset_y;
+ } else {+ render_rect.y = command->pos.y;
+ }
render_rect.h = command->size.height;
render_rect.w = command->size.width;
@@ -125,9 +158,9 @@
background_color.a = 0xFF;
#ifdef __ANDROID__
- int bgcolor = (command->color.r << 16) |
- (command->color.g << 8) | command->color.b;
- SDL_AndroidSendMessage(0x8001, bgcolor);
+ int bgcolor =
+ (command->color.r << 16) | (command->color.g << 8) | command->color.b;
+ SDL_AndroidSendMessage(0x8001, bgcolor);
#endif
}
@@ -141,12 +174,25 @@
void draw_waveform(struct draw_oscilloscope_waveform_command *command) {static uint8_t wfm_cleared = 0;
+ static int prev_waveform_size = 0;
// If the waveform is not being displayed and it's already been cleared, skip
// rendering it
if (!(wfm_cleared && command->waveform_size == 0)) {- const SDL_Rect wf_rect = {0, 0, 320, 21};+ SDL_Rect wf_rect;
+ if (command->waveform_size > 0) {+ wf_rect.x = 320 - command->waveform_size;
+ wf_rect.y = 0;
+ wf_rect.w = command->waveform_size;
+ wf_rect.h = 21;
+ } else {+ wf_rect.x = 320 - prev_waveform_size;
+ wf_rect.y = 0;
+ wf_rect.w = prev_waveform_size;
+ wf_rect.h = 21;
+ }
+ prev_waveform_size = command->waveform_size;
SDL_SetRenderDrawColor(rend, background_color.r, background_color.g,
background_color.b, background_color.a);
@@ -161,9 +207,10 @@
for (int i = 0; i < command->waveform_size; i++) {// Limit value because the oscilloscope commands seem to glitch
// occasionally
- if (command->waveform[i] > 20)
+ if (command->waveform[i] > 20) {command->waveform[i] = 20;
- waveform_points[i].x = i;
+ }
+ waveform_points[i].x = i + wf_rect.x;
waveform_points[i].y = command->waveform[i];
}
@@ -229,11 +276,11 @@
void render_screen() { if (dirty) {dirty = 0;
- //ticks = SDL_GetTicks();
+ // ticks = SDL_GetTicks();
SDL_SetRenderTarget(rend, NULL);
-
+
SDL_SetRenderDrawColor(rend, background_color.r, background_color.g,
- background_color.b, background_color.a);
+ background_color.b, background_color.a);
SDL_RenderClear(rend);
SDL_RenderCopy(rend, maintexture, NULL, NULL);
@@ -251,6 +298,7 @@
}
void screensaver_init() {+ set_large_mode(1);
fx_cube_init(rend, (SDL_Color){255, 255, 255, 255});SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Screensaver initialized");
}
--- a/render.h
+++ b/render.h
@@ -9,10 +9,11 @@
int initialize_sdl(int init_fullscreen, int init_use_gpu);
void close_renderer();
-int process_queues(struct command_queues *queues);
void draw_waveform(struct draw_oscilloscope_waveform_command *command);
void draw_rectangle(struct draw_rectangle_command *command);
int draw_character(struct draw_character_command *command);
+void set_large_mode(int enabled);
+void view_changed(int view);
void render_screen();
void toggle_fullscreen();
--- a/serial.h
+++ b/serial.h
@@ -10,7 +10,7 @@
int init_serial_with_file_descriptor(int file_descriptor);
#else
// maximum amount of bytes to read from the serial in one read()
-#define serial_read_size 324
+#define serial_read_size 512
#endif
int init_serial(int verbose);
--
⑨