diff --git a/Makefile b/Makefile index 991c2ba..ee52a24 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ dflags = -MMD -MT $@ -MF $(@:.o=.d) -MP cpflags := -R .bss -R .gint_bss g1af := -i "$(ICON_FX)" -n "$(NAME)" --internal="$(INTERNAL)" -g3af := -n basic:"$(NAME)" -i uns:"$(ICON_CG_UNS)" -i sel:"$(ICON_CG_SEL)" +g3af := -n basic:"" -i uns:"$(ICON_CG_UNS)" -i sel:"$(ICON_CG_SEL)" # # File listings @@ -91,13 +91,11 @@ build-cg/%.o: %.c # Images build-fx/assets/img/%.o: assets-fx/img/% @ mkdir -p $(dir $@) - fxconv -i $< -o $@ name:img_$(basename $*) + fxconv -i $< -o $@ --fx name:img_$(basename $*) build-cg/assets/img/%.o: assets-cg/img/% - @ echo -ne "\e[31;1mWARNING: image conversion for fxcg50 is not " - @ echo -ne "supported yet\e[0m" @ mkdir -p $(dir $@) - fxconv -i $< -o $@ name:img_$(basename $*) + fxconv -i $< -o $@ --cg name:img_$(basename $*) # Fonts build-fx/assets/fonts/%.o: assets-fx/fonts/% diff --git a/assets-cg/img/swift.png b/assets-cg/img/swift.png new file mode 100644 index 0000000..106b360 Binary files /dev/null and b/assets-cg/img/swift.png differ diff --git a/assets-cg/img/swords.png b/assets-cg/img/swords.png new file mode 100644 index 0000000..03493f9 Binary files /dev/null and b/assets-cg/img/swords.png differ diff --git a/include/gintctl/gint.h b/include/gintctl/gint.h index 3821bed..827a0b5 100644 --- a/include/gintctl/gint.h +++ b/include/gintctl/gint.h @@ -11,6 +11,9 @@ void gintctl_gint_hardware(void); /* gintctl_gint_timer(): Show the timer status in real-time */ void gintctl_gint_timer(void); +/* gintctl_gint_bopti(): Test image rendering */ +void gintctl_gint_bopti(void); + #ifdef FX9860G /* gintctl_gint_gray(): Gray engine tuning */ diff --git a/src/gint/bopti.c b/src/gint/bopti.c new file mode 100644 index 0000000..1fc77b0 --- /dev/null +++ b/src/gint/bopti.c @@ -0,0 +1,33 @@ +#include +#include +#include + +/* gintctl_gint_bopti(): Test image rendering */ +void gintctl_gint_bopti(void) +{ +#ifdef FXCG50 + extern image_t img_swift; + extern image_t img_swords; + + int x = 396 - img_swords.width - 16; + int y = 16; + + int key = 0; + + while(key != KEY_EXIT) + { + dclear(C_WHITE); + bopti_render_noclip(0, 0, &img_swift, 0, 0, 396, 224); + bopti_render_clip(x, y, &img_swords, 0, 0, img_swords.width, + img_swords.height); + dupdate(); + + key = getkey().key; + + if(key == KEY_UP) y--; + if(key == KEY_DOWN) y++; + if(key == KEY_LEFT) x--; + if(key == KEY_RIGHT) x++; + } +#endif +} diff --git a/src/gint/timer.c b/src/gint/timer.c index 0dd3458..0af9d4d 100644 --- a/src/gint/timer.c +++ b/src/gint/timer.c @@ -19,8 +19,8 @@ void timer_print(int x, int y, char const *name, uint32_t TCOR, uint32_t TCNT, print(x, y+2*dy, "TCNT"); #endif - print(_(x+6, x+45), y+dy, "%08x", TCOR); - print(_(x+60, x+45), _(y+dy, y+2*dy), "%08x", TCNT); + print(_(x+6, x+45), y+dy, "%08X", TCOR); + print(_(x+60, x+45), _(y+dy, y+2*dy), "%08X", TCNT); print(_(x+36, x), _(y, y+3*dy), "%s%s%s", UNIE ? "UNIE " : "", diff --git a/src/gintctl.c b/src/gintctl.c index 93ee6b7..8e9f9bb 100644 --- a/src/gintctl.c +++ b/src/gintctl.c @@ -39,7 +39,7 @@ struct menu menu_gint = { { "Keyboard", NULL }, { "Timers", gintctl_gint_timer }, { "Real-time clock", NULL }, - { "Image rendering", NULL }, + { "Image rendering", gintctl_gint_bopti }, { "Text rendering", NULL }, #ifdef FX9860G { "Gray engine", gintctl_gint_gray }, diff --git a/src/perf/libprof.c b/src/perf/libprof.c index 3ac7833..da69413 100644 --- a/src/perf/libprof.c +++ b/src/perf/libprof.c @@ -63,14 +63,14 @@ void gintctl_perf_libprof(void) row_title("libprof basics"); row_print(1, 1, "This program shows the execution time " "measured"); - row_print(2, 1, "by libprof for a 100 ms sleep, with 256us " + row_print(2, 1, "by libprof for a 100 ms sleep, with 1 us " "added"); row_print(3, 1, "each time."); row_print(5, 1, "Press F1 to start the test."); if(test) { - row_print(7, 1, "Sleep: %.3j us", sleep_delay); + row_print(7, 1, "Sleep: %.3j ms", sleep_delay); row_print(8, 1, "Empty: %d us", empty); row_print(9, 1, "Tests: %d", test); }