Skip to content

Commit

Permalink
added input display
Browse files Browse the repository at this point in the history
  • Loading branch information
glankk committed Jul 29, 2016
1 parent 929419d commit 35dbc8b
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion gz.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ enum equipment_entry
EQUIPMENT_MAX,
};

struct equipment_info
static struct equipment_info
{
const char *name;
uint8_t *address;
Expand Down Expand Up @@ -338,6 +338,45 @@ ENTRY void _start(void *text_ptr)
menu_draw(&g_menu_main);
#endif

#if 1
SetTextRGBA(g_text_ptr, 0xC8, 0xC8, 0xC8, 0xFF);
SetTextXY(g_text_ptr, 2, 28);
SetTextString(g_text_ptr, "%4i %4i", input_ptr->x, input_ptr->y);
static struct
{
uint16_t mask;
const char *name;
uint32_t color;
}
buttons[] =
{
{0x8000, "A", 0x0000FF},
{0x4000, "B", 0x00FF00},
{0x1000, "S", 0xFF0000},
{0x0020, "L", 0xC8C8C8},
{0x0010, "R", 0xC8C8C8},
{0x2000, "Z", 0xC8C8C8},
{0x0008, "u", 0xFFFF00},
{0x0004, "d", 0xFFFF00},
{0x0002, "l", 0xFFFF00},
{0x0001, "r", 0xFFFF00},
{0x0800, "u", 0xC8C8C8},
{0x0400, "d", 0xC8C8C8},
{0x0200, "l", 0xC8C8C8},
{0x0100, "r", 0xC8C8C8},
};
for (int i = 0; i < sizeof(buttons) / sizeof(*buttons); ++i) {
if (!(input_ptr->pad & buttons[i].mask))
continue;
SetTextRGBA(g_text_ptr, (buttons[i].color >> 16) & 0xFF,
(buttons[i].color >> 8) & 0xFF,
(buttons[i].color >> 0) & 0xFF,
0xFF);
SetTextXY(g_text_ptr, 12 + i, 28);
SetTextString(g_text_ptr, "%s", buttons[i].name);
}
#endif

#if 0
if (input_ptr->du)
console_scroll(0, -1);
Expand Down

0 comments on commit 35dbc8b

Please sign in to comment.