Browse Source

add bopti tests on fxcg50

master
Lephe 3 months ago
parent
commit
67a44abedb
8 changed files with 44 additions and 10 deletions
  1. 3
    5
      Makefile
  2. BIN
      assets-cg/img/swift.png
  3. BIN
      assets-cg/img/swords.png
  4. 3
    0
      include/gintctl/gint.h
  5. 33
    0
      src/gint/bopti.c
  6. 2
    2
      src/gint/timer.c
  7. 1
    1
      src/gintctl.c
  8. 2
    2
      src/perf/libprof.c

+ 3
- 5
Makefile 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 View File


BIN
assets-cg/img/swords.png View File


+ 3
- 0
include/gintctl/gint.h 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
- 0
src/gint/bopti.c 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
}

+ 2
- 2
src/gint/timer.c 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 " : "",

+ 1
- 1
src/gintctl.c 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 },

+ 2
- 2
src/perf/libprof.c 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);
}

Loading…
Cancel
Save