add a pitch variable

32x is still broken
This commit is contained in:
notaz 2014-04-05 22:08:06 +03:00
parent 88f6038d05
commit 9cdfc191b6
11 changed files with 59 additions and 46 deletions

View file

@ -67,7 +67,7 @@ static void draw_cd_leds(void)
void pemu_finalize_frame(const char *fps, const char *notice)
{
if (currentConfig.renderer != RT_16BIT && !(PicoIn.AHW & PAHW_32X)) {
unsigned short *pd = (unsigned short *)g_screen_ptr + 8 * g_screen_width;
unsigned short *pd = (unsigned short *)g_screen_ptr + 8 * g_screen_ppitch;
unsigned char *ps = Pico.est.Draw2FB + 328*8 + 8;
unsigned short *pal = Pico.est.HighPal;
int i, x;
@ -94,7 +94,7 @@ static void apply_renderer(void)
case RT_16BIT:
PicoIn.opt &= ~POPT_ALT_RENDERER;
PicoDrawSetOutFormat(PDF_RGB555, 0);
PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);
PicoDrawSetOutBuf(g_screen_ptr, g_screen_ppitch * 2);
break;
case RT_8BIT_ACC:
PicoIn.opt &= ~POPT_ALT_RENDERER;
@ -108,7 +108,7 @@ static void apply_renderer(void)
}
if (PicoIn.AHW & PAHW_32X)
PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);
PicoDrawSetOutBuf(g_screen_ptr, g_screen_ppitch * 2);
}
void plat_video_toggle_renderer(int change, int is_menu)
@ -127,8 +127,8 @@ void plat_video_toggle_renderer(int change, int is_menu)
void plat_status_msg_clear(void)
{
unsigned short *d = (unsigned short *)g_screen_ptr + g_screen_width * g_screen_height;
int l = g_screen_width * 8;
unsigned short *d = (unsigned short *)g_screen_ptr + g_screen_ppitch * g_screen_height;
int l = g_screen_ppitch * 8;
memset32((int *)(d - l), 0, l * 2 / 4);
}
@ -143,7 +143,7 @@ void plat_status_msg_busy_next(const char *msg)
void plat_status_msg_busy_first(const char *msg)
{
// memset32(g_screen_ptr, 0, g_screen_width * g_screen_height * 2 / 4);
// memset32(g_screen_ptr, 0, g_screen_ppitch * g_screen_height * 2 / 4);
plat_status_msg_busy_next(msg);
}
@ -153,7 +153,7 @@ void plat_update_volume(int has_changed, int is_up)
void pemu_forced_frame(int no_scale, int do_emu)
{
PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);
PicoDrawSetOutBuf(g_screen_ptr, g_screen_ppitch * 2);
PicoDrawSetCallbacks(NULL, NULL);
Pico.m.dirtyPal = 1;
@ -174,7 +174,7 @@ void plat_debug_cat(char *str)
void emu_video_mode_change(int start_line, int line_count, int is_32cols)
{
// clear whole screen in all buffers
memset32(g_screen_ptr, 0, g_screen_width * g_screen_height * 2 / 4);
memset32(g_screen_ptr, 0, g_screen_ppitch * g_screen_height * 2 / 4);
}
void pemu_loop_prep(void)