X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fcommon%2Femu.c;h=0a9f0890a5a2390ed88b6a1daadbeb65dbf539cb;hb=9cdfc191b60cb8881552d01f84e21bdcbb48758d;hp=b4db4c676a2c25cb9b66747267f1ca23a22263ba;hpb=88f6038d0572233e6d076ca4319166f2c4381bbb;p=picodrive.git diff --git a/platform/common/emu.c b/platform/common/emu.c index b4db4c6..0a9f089 100644 --- a/platform/common/emu.c +++ b/platform/common/emu.c @@ -42,6 +42,7 @@ void *g_screen_ptr; int g_screen_width = 320; int g_screen_height = 240; +int g_screen_ppitch = 320; // pitch in pixels const char *PicoConfigFile = "config2.cfg"; currentConfig_t currentConfig, defaultConfig; @@ -730,12 +731,12 @@ void name(int x, int y, const char *text) \ } \ } -mk_text_out(emu_text_out8, unsigned char, 0xf0, g_screen_ptr, 1, g_screen_width) -mk_text_out(emu_text_out16, unsigned short, 0xffff, g_screen_ptr, 1, g_screen_width) +mk_text_out(emu_text_out8, unsigned char, 0xf0, g_screen_ptr, 1, g_screen_ppitch) +mk_text_out(emu_text_out16, unsigned short, 0xffff, g_screen_ptr, 1, g_screen_ppitch) mk_text_out(emu_text_out8_rot, unsigned char, 0xf0, - (char *)g_screen_ptr + (g_screen_width - 1) * g_screen_height, -g_screen_height, 1) + (char *)g_screen_ptr + (g_screen_ppitch - 1) * g_screen_height, -g_screen_height, 1) mk_text_out(emu_text_out16_rot, unsigned short, 0xffff, - (short *)g_screen_ptr + (g_screen_width - 1) * g_screen_height, -g_screen_height, 1) + (short *)g_screen_ptr + (g_screen_ppitch - 1) * g_screen_height, -g_screen_height, 1) #undef mk_text_out @@ -751,7 +752,7 @@ void emu_osd_text16(int x, int y, const char *text) for (h = 0; h < 8; h++) { unsigned short *p; p = (unsigned short *)g_screen_ptr - + x + g_screen_width * (y + h); + + x + g_screen_ppitch * (y + h); for (i = len; i > 0; i--, p++) *p = (*p >> 2) & 0x39e7; } @@ -1204,8 +1205,11 @@ static void mkdir_path(char *path_with_reserve, int pos, const char *name) void emu_cmn_forced_frame(int no_scale, int do_emu) { int po_old = PicoIn.opt; + int y; - memset32(g_screen_ptr, 0, g_screen_width * g_screen_height * 2 / 4); + for (y = 0; y < g_screen_height; y++) + memset32((short *)g_screen_ptr + g_screen_ppitch * y, 0, + g_screen_width * 2 / 4); PicoIn.opt &= ~POPT_ALT_RENDERER; PicoIn.opt |= POPT_ACC_SPRITES;