add bopti tests on fxcg50

This commit is contained in:
Lephe 2019-08-04 14:07:56 +02:00
parent c82e0464ca
commit 67a44abedb
8 changed files with 44 additions and 10 deletions

View File

@ -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/%

BIN
assets-cg/img/swift.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

BIN
assets-cg/img/swords.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -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 */

33
src/gint/bopti.c Normal file
View File

@ -0,0 +1,33 @@
#include <gint/display.h>
#include <gint/keyboard.h>
#include <gintctl/gint.h>
/* 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
}

View File

@ -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 " : "",

View File

@ -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 },

View File

@ -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);
}