From 9a3433c52a6b091a629ca15f85a729e098bf9d07 Mon Sep 17 00:00:00 2001 From: lephe Date: Thu, 22 Dec 2016 23:08:44 +0100 Subject: [PATCH] Fixed left-side vram overflow with text, made install automatically along fxSDK. --- Makefile | 5 ++++- TODO | 6 ++---- demo/gintdemo.c | 4 ++++ demo/resources/clock_7305.bmp | Bin 12410 -> 12410 bytes demo/test_tales.c | 2 +- demo/test_timer.c | 23 ++++++++++------------- src/tales/tales_internals.c | 2 +- 7 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index fc23b70..f12c055 100755 --- a/Makefile +++ b/Makefile @@ -50,8 +50,11 @@ obj-std-spec = # Configuration files config = gcc.cfg +# Target folder +folder := $(shell fxsdk --folder) ifndef folder -folder = /usr/share/fxsdk +$(error "Could not get the fxSDK storage folder. Did you install fxSDK \ +properly?") endif diff --git a/TODO b/TODO index 25baea0..d1a6f87 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,6 @@ Bugs to fix: -- Left-vram overflow when rendering text -- A few key hits ignored after leaving the application (could not reproduce) -- Lost keyboard control at startup (could not reproduce) +- A few key hits ignored after leaving the application (could not reproduce) +- Lost keyboard control at startup (could not reproduce) Simple improvements: - bopti: Monochrome bitmaps blending modes @@ -12,7 +11,6 @@ Simple improvements: - time: Compute CLOCKS_PER_SEC - core: Add VBR handlers debugging information (if possible) - core: Implement all callbacks and a complete user API -- project: Enhance Makefile install_lib rules Modules to implement: - Serial communication diff --git a/demo/gintdemo.c b/demo/gintdemo.c index 114aa13..de90854 100644 --- a/demo/gintdemo.c +++ b/demo/gintdemo.c @@ -403,20 +403,24 @@ void main_menu(int *category, int *app) switch(getkey()) { case KEY_F1: + if(!tab) break; tab = 0; index = 0; break; case KEY_F2: + if(tab == 1) break; tab = 1; index = 0; scroll = 0; break; case KEY_F3: + if(tab == 2) break; tab = 2; index = 0; scroll = 0; break; case KEY_F4: + if(tab == 3) break; tab = 3; index = 0; scroll = 0; diff --git a/demo/resources/clock_7305.bmp b/demo/resources/clock_7305.bmp index 83690f6283ad746528fb9735070a9b1aec14816a..6e7170bf6e1417538a13a9ad7bb475e3f45bfc02 100644 GIT binary patch delta 58 zcmeyB@GD`%3&zb2>Q+pXCAoMe&u3zrIAJD;xp_X*bn%T7m>7W^iOm8sX>1!Ourf}5 M&&;;jQKg<60Fz%7F8}}l delta 57 zcmeyB@GD`%3&zO?9IGc6unSEV;1!x|&uTOI0vFrlrD`4!F)pFa^I0#7ZQda5z_Hmt K*^77Lgk1oBZWQGJ diff --git a/demo/test_tales.c b/demo/test_tales.c index 644fc23..1a64352 100644 --- a/demo/test_tales.c +++ b/demo/test_tales.c @@ -113,7 +113,7 @@ void test_tales(void) for(int j = 0; j < 16; j++) str[j] = 32 + (i << 4) + j; str[16] = 0; - gtext(2, 2 + i * height, str); + gtext(-10, 2 + i * height, str); } gimage(0, 56, &res_opt_tales); diff --git a/demo/test_timer.c b/demo/test_timer.c index 7178be4..2f634d3 100644 --- a/demo/test_timer.c +++ b/demo/test_timer.c @@ -35,8 +35,8 @@ static void timing_timer(void) static void timing_start(void) { - timer_start(TIMER_USER, 16, Clock_Hz, timing_timer, 0); - rtc_cb_edit(cb_id, RTCFreq_16Hz, timing_rtc); + timer_start(TIMER_USER, 64, Clock_Hz, timing_timer, 0); + rtc_cb_edit(cb_id, RTCFreq_64Hz, timing_rtc); elapsed_timer = 0; elapsed_rtc = 0; @@ -177,20 +177,20 @@ static void draw(int tab) dimage(64, 0, &res_clock_7305); getFreq(buffer, conf.RTCCLK_f); - small_text(84, 14, buffer, 1); + small_text(82, 13, buffer, 1); sprintf(buffer, "*%d", conf.FLL); - small_text(84, 25, buffer, 1); + small_text(82, 23, buffer, 1); sprintf(buffer, "*%d", conf.PLL); - small_text(84, 36, buffer, 1); + small_text(82, 33, buffer, 1); sprintf(buffer, "/%d", conf.Bphi_div1); - small_text(89, 43, buffer, 0); + small_text(87, 40, buffer, 0); sprintf(buffer, "/%d", conf.Iphi_div1); - small_text(89, 50, buffer, 0); + small_text(87, 47, buffer, 0); sprintf(buffer, "/%d", conf.Pphi_div1); - small_text(89, 57, buffer, 0); + small_text(87, 54, buffer, 0); } } else @@ -216,7 +216,7 @@ static void draw(int tab) if(timer <= rtc) ratio = (10000 * timer) / rtc; else ratio = (10000 * rtc) / timer; - print(12, 5, "%d.%02d %%", ratio / 100, ratio % 100); + print(12, 5, "%d.%02d%%", ratio / 100, ratio % 100); } else locate(12, 5, "..."); } @@ -238,14 +238,11 @@ void test_timer(void) { int tab = 0; - clock_measure(); - clock_measure_end(); - conf = clock_config(); elapsed_timer = -1; elapsed_rtc = -1; - cb_id = rtc_cb_add(RTCFreq_16Hz, timing_start, 0); + cb_id = rtc_cb_add(RTCFreq_64Hz, timing_start, 0); text_configure(NULL, Color_Black); diff --git a/src/tales/tales_internals.c b/src/tales/tales_internals.c index dbef3dd..838291e 100644 --- a/src/tales/tales_internals.c +++ b/src/tales/tales_internals.c @@ -253,7 +253,7 @@ void render(int x, int y, const char *str, void (*op)(OPERATE_ARGS)) // When operators are full, updating the video ram and // preparing the operators for another row. - (*op)(operators, height, x, y); + if(x >= 0) (*op)(operators, height, x, y); x += 32; if(x > 96) break;