add a simple (non-exhaustive) bopti test on fx-9860G

This commit is contained in:
Lephe 2020-07-23 10:21:50 +02:00
parent 0c66751015
commit cfdc6e8e95
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
5 changed files with 90 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -5,10 +5,10 @@
#include <gintctl/gint.h>
#include <gintctl/util.h>
#ifdef FXCG50
/* gintctl_gint_bopti(): Test image rendering */
void gintctl_gint_bopti(void)
{
#ifdef FXCG50
extern bopti_image_t img_swift;
extern bopti_image_t img_swords;
extern bopti_image_t img_potion_17x22, img_potion_18x22;
@ -62,5 +62,93 @@ void gintctl_gint_bopti(void)
key = getkey().key;
}
#endif
}
#endif
#ifdef FX9860G
static void img(int x, int y, bopti_image_t *img, int sub, int flags)
{
int ix = 0;
int w = img->width;
if(sub) x += 2, ix += 2, w -= 4;
dsubimage(x, y, img, ix, 0, w, img->height, flags);
}
#define img(x, y, i) img(x, y, & img_bopti_##i, sub, flags)
void gintctl_gint_bopti(void)
{
extern bopti_image_t img_opt_gint_bopti;
extern bopti_image_t img_bopti_1col;
extern bopti_image_t img_bopti_2col;
extern bopti_image_t img_bopti_3col;
int key = 0;
int cols=0, flags=DIMAGE_NONE, sub=0, back=0;
while(key != KEY_EXIT)
{
dclear(back ? C_BLACK : C_WHITE);
if(cols == 0)
{
img( -6, 4, 1col);
img( 20, 4, 1col);
img( 42, 4, 1col);
img( 64, 4, 1col);
img( 90, 4, 1col);
img(122, 4, 1col);
dsubimage(0, 10, &img_bopti_1col, 6, 0, 6, 4, flags);
dsubimage(5, 16, &img_bopti_1col, 6, 0, 6, 4, flags);
dsubimage(4, 22, &img_bopti_1col, 5, 0, 7, 4, flags);
dsubimage(3, 28, &img_bopti_1col, 4, 0, 8, 4, flags);
dsubimage(2, 34, &img_bopti_1col, 3, 0, 9, 4, flags);
dsubimage(1, 40, &img_bopti_1col, 2, 0,10, 4, flags);
dsubimage(0, 40, &img_bopti_1col, 1, 0,11, 4, flags);
dsubimage(0, 46, &img_bopti_1col, 0, 0,12, 4, flags);
img(33, 12, 1col);
}
else if(cols == 1)
{
img(-10, 4, 2col);
img( 28, 4, 2col);
img( 96, 4, 2col);
img( 46, 12, 2col);
}
else if(cols == 2)
{
img(-30, 4, 3col);
img( 90, 4, 3col);
img( -4, 12, 3col);
img( 64, 12, 3col);
}
else if(cols == 3)
{
img( 0, 4, 1col);
img( 20, 4, 1col);
img( 42, 4, 1col);
img( 64, 4, 1col);
img(116, 4, 1col);
}
dsubimage(0, 56, &img_opt_gint_bopti, 0,0,128,8, DIMAGE_NONE);
dsubimage(0, 56, &img_opt_gint_bopti, 0, 9*cols, 21, 8,
DIMAGE_NONE);
if(flags & DIMAGE_NOCLIP)
{
dsubimage(86, 56, &img_opt_gint_bopti, 86, 9, 21, 8,
DIMAGE_NONE);
}
dupdate();
key = getkey().key;
if(key == KEY_F1) cols = (cols + 1) % 4;
if(key == KEY_F4) sub = !sub;
if(key == KEY_F5) flags ^= DIMAGE_NOCLIP;
if(key == KEY_F6) back = !back;
}
}
#endif