\r
int g_menuscreen_w;\r
int g_menuscreen_h;\r
+int g_menuscreen_pp;\r
\r
int g_autostateld_opt;\r
\r
static int g_border_style;\r
static int border_left, border_right, border_top, border_bottom;\r
\r
+void menuscreen_memset_lines(unsigned short *dst, int c, int l)\r
+{\r
+ for (; l > 0; l--, dst += g_menuscreen_pp)\r
+ memset(dst, c, g_menuscreen_w * 2);\r
+}\r
+\r
// draws text to current bbp16 screen\r
static void text_out16_(int x, int y, const char *text, int color)\r
{\r
int i, lh, tr, tg, tb, len;\r
- unsigned short *dest = (unsigned short *)g_menuscreen_ptr + x + y * g_menuscreen_w;\r
+ unsigned short *dest = (unsigned short *)g_menuscreen_ptr + x + y * g_menuscreen_pp;\r
tr = (color & 0xf800) >> 8;\r
tg = (color & 0x07e0) >> 3;\r
tb = (color & 0x001f) << 3;\r
unsigned short *dst = dest;\r
int u, l;\r
\r
- for (l = 0; l < lh; l++, dst += g_menuscreen_w - me_mfont_w)\r
+ for (l = 0; l < lh; l++, dst += g_menuscreen_pp - me_mfont_w)\r
{\r
for (u = me_mfont_w / 2; u > 0; u--, src++)\r
{\r
break;\r
\r
src = fontdata6x8[c];\r
- dst = (unsigned short *)g_menuscreen_ptr + x + y * g_menuscreen_w;\r
+ dst = (unsigned short *)g_menuscreen_ptr + x + y * g_menuscreen_pp;\r
\r
while (h--)\r
{\r
dst += multiplier;\r
}\r
\r
- dst += g_menuscreen_w - me_sfont_w;\r
+ dst += g_menuscreen_pp - me_sfont_w;\r
}\r
src++;\r
}\r
if (menu_sel_color < 0) return; // no selection hilight\r
\r
if (y > 0) y--;\r
- dest = (unsigned short *)g_menuscreen_ptr + x + y * g_menuscreen_w + me_mfont_w * 2 - 2;\r
+ dest = (unsigned short *)g_menuscreen_ptr + x + y * g_menuscreen_pp + me_mfont_w * 2 - 2;\r
for (h = me_mfont_h + 1; h > 0; h--)\r
{\r
dst = dest;\r
for (i = w - (me_mfont_w * 2 - 2); i > 0; i--)\r
*dst++ = menu_sel_color;\r
- dest += g_menuscreen_w;\r
+ dest += g_menuscreen_pp;\r
}\r
}\r
\r
ymax = g_menuscreen_h - 1;\r
\r
for (x = xmin; x <= xmax; x++)\r
- screen[y * g_menuscreen_w + x] = 0xa514;\r
+ screen[y * g_menuscreen_pp + x] = 0xa514;\r
for (y++; y < ymax; y++)\r
{\r
- ls = y * g_menuscreen_w;\r
+ ls = y * g_menuscreen_pp;\r
screen[ls + xmin] = 0xffff;\r
for (x = xmin + 1; x < xmax; x++)\r
{\r
}\r
screen[ls + xmax] = 0xffff;\r
}\r
- ls = y * g_menuscreen_w;\r
+ ls = y * g_menuscreen_pp;\r
for (x = xmin; x <= xmax; x++)\r
screen[ls + x] = 0xffff;\r
}\r
\r
static void menu_draw_begin(int need_bg, int no_borders)\r
{\r
+ int y;\r
+\r
plat_video_menu_begin();\r
\r
menu_reset_borders();\r
\r
if (need_bg) {\r
if (g_border_style && no_borders) {\r
- menu_darken_bg(g_menuscreen_ptr, g_menubg_ptr,\r
- g_menuscreen_w * g_menuscreen_h, 1);\r
+ for (y = 0; y < g_menuscreen_h; y++)\r
+ menu_darken_bg((short *)g_menuscreen_ptr + g_menuscreen_pp * y,\r
+ g_menubg_ptr + g_menuscreen_w * y, g_menuscreen_w, 1);\r
}\r
else {\r
- memcpy(g_menuscreen_ptr, g_menubg_ptr,\r
- g_menuscreen_w * g_menuscreen_h * 2);\r
+ for (y = 0; y < g_menuscreen_h; y++)\r
+ memcpy((short *)g_menuscreen_ptr + g_menuscreen_pp * y,\r
+ g_menubg_ptr + g_menuscreen_w * y, g_menuscreen_w * 2);\r
}\r
}\r
}\r
// if (!rom_loaded)\r
// menu_darken_bg(gp2x_screen, 320*240, 0);\r
\r
- darken_ptr = (short *)g_menuscreen_ptr + g_menuscreen_w * max_cnt/2 * me_sfont_h;\r
- menu_darken_bg(darken_ptr, darken_ptr, g_menuscreen_w * me_sfont_h * 8 / 10, 0);\r
+ darken_ptr = (short *)g_menuscreen_ptr + g_menuscreen_pp * max_cnt/2 * me_sfont_h;\r
+ menu_darken_bg(darken_ptr, darken_ptr, g_menuscreen_pp * me_sfont_h * 8 / 10, 0);\r
\r
x = 5 + me_mfont_w + 1;\r
if (start - 2 >= 0)\r
\r
if (show_help) {\r
darken_ptr = (short *)g_menuscreen_ptr\r
- + g_menuscreen_w * (g_menuscreen_h - me_sfont_h * 5 / 2);\r
+ + g_menuscreen_pp * (g_menuscreen_h - me_sfont_h * 5 / 2);\r
menu_darken_bg(darken_ptr, darken_ptr,\r
- g_menuscreen_w * (me_sfont_h * 5 / 2), 1);\r
+ g_menuscreen_pp * (me_sfont_h * 5 / 2), 1);\r
\r
snprintf(buff, sizeof(buff), "%s - select, %s - back",\r
in_get_key_name(-1, -PBTN_MOK), in_get_key_name(-1, -PBTN_MBACK));\r