#include <pico/pico_int.h>\r
#include <pico/patch.h>\r
\r
+#if defined(__GNUC__) && __GNUC__ >= 7\r
+#pragma GCC diagnostic ignored "-Wformat-truncation"\r
+#endif\r
+\r
#ifndef _WIN32\r
#define PATH_SEP "/"\r
#define PATH_SEP_C '/'\r
\r
int g_screen_width = 320;\r
int g_screen_height = 240;\r
+int g_screen_ppitch = 320; // pitch in pixels\r
\r
const char *PicoConfigFile = "config2.cfg";\r
currentConfig_t currentConfig, defaultConfig;\r
} \\r
}\r
\r
-mk_text_out(emu_text_out8, unsigned char, 0xf0, g_screen_ptr, 1, g_screen_width)\r
-mk_text_out(emu_text_out16, unsigned short, 0xffff, g_screen_ptr, 1, g_screen_width)\r
+mk_text_out(emu_text_out8, unsigned char, 0xf0, g_screen_ptr, 1, g_screen_ppitch)\r
+mk_text_out(emu_text_out16, unsigned short, 0xffff, g_screen_ptr, 1, g_screen_ppitch)\r
mk_text_out(emu_text_out8_rot, unsigned char, 0xf0,\r
- (char *)g_screen_ptr + (g_screen_width - 1) * g_screen_height, -g_screen_height, 1)\r
+ (char *)g_screen_ptr + (g_screen_ppitch - 1) * g_screen_height, -g_screen_height, 1)\r
mk_text_out(emu_text_out16_rot, unsigned short, 0xffff,\r
- (short *)g_screen_ptr + (g_screen_width - 1) * g_screen_height, -g_screen_height, 1)\r
+ (short *)g_screen_ptr + (g_screen_ppitch - 1) * g_screen_height, -g_screen_height, 1)\r
\r
#undef mk_text_out\r
\r
for (h = 0; h < 8; h++) {\r
unsigned short *p;\r
p = (unsigned short *)g_screen_ptr\r
- + x + g_screen_width * (y + h);\r
+ + x + g_screen_ppitch * (y + h);\r
for (i = len; i > 0; i--, p++)\r
*p = (*p >> 2) & 0x39e7;\r
}\r
void emu_cmn_forced_frame(int no_scale, int do_emu)\r
{\r
int po_old = PicoIn.opt;\r
+ int y;\r
\r
- memset32(g_screen_ptr, 0, g_screen_width * g_screen_height * 2 / 4);\r
+ for (y = 0; y < g_screen_height; y++)\r
+ memset32((short *)g_screen_ptr + g_screen_ppitch * y, 0,\r
+ g_screen_width * 2 / 4);\r
\r
PicoIn.opt &= ~POPT_ALT_RENDERER;\r
PicoIn.opt |= POPT_ACC_SPRITES;\r