From 524562e8bc8943843acdd946fa2ee30d45ffe1df Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Wed, 9 Nov 2022 21:21:07 +0100 Subject: [PATCH] pe: casioplot: make the final argument of draw_string() optional (note: it is currently ignored even when specified) --- README.md | 6 ++++++ ports/sh/modcasioplot.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7656a5753..5d5eef107 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,12 @@ UI: * Try and provide a font smaller than 5x7 for more compact shell on mono - A decent keymap that can input all relevant characters into the shell +Test cases: +- [ ] Chute tridimensionnelle +- [ ] Bad Apple +- [ ] Island of the Dead Kings +- [ ] Synchro-Donjon + Future wishes: - Build for fx-9860G II (requires manual filesystem support) - Lephe's secret ideas (complete previous list to unlock) diff --git a/ports/sh/modcasioplot.c b/ports/sh/modcasioplot.c index df7b1887b..31546d9cb 100644 --- a/ports/sh/modcasioplot.c +++ b/ports/sh/modcasioplot.c @@ -96,7 +96,9 @@ static mp_obj_t draw_string(size_t n, mp_obj_t const *args) /* TODO: casioplot: draw_string(): Don't ignore the size parameter */ /* It is normally "small", "medium" or "large" */ - (void)args[4]; + if(n == 5) { + (void)args[4]; + } font_t const *old_font = dfont(NULL); dtext_opt(x, y, color, C_NONE, DTEXT_LEFT, DTEXT_TOP, text, text_len); @@ -109,7 +111,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(show_screen_obj, show_screen); MP_DEFINE_CONST_FUN_OBJ_0(clear_screen_obj, clear_screen); MP_DEFINE_CONST_FUN_OBJ_3(set_pixel_obj, set_pixel); MP_DEFINE_CONST_FUN_OBJ_2(get_pixel_obj, get_pixel); -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(draw_string_obj, 5, 5, draw_string); +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(draw_string_obj, 4, 5, draw_string); STATIC const mp_rom_map_elem_t casioplot_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_casioplot) },