#endif\r
}\r
\r
+#define is_16bit_mode() \\r
+ (currentConfig.renderer == RT_16BIT || (PicoIn.AHW & PAHW_32X))\r
+\r
+static int get_renderer(void)\r
+{\r
+ if (PicoIn.AHW & PAHW_32X)\r
+ return currentConfig.renderer32x;\r
+ else\r
+ return currentConfig.renderer;\r
+}\r
+\r
+static void change_renderer(int diff)\r
+{\r
+ int *r;\r
+ if (PicoIn.AHW & PAHW_32X)\r
+ r = ¤tConfig.renderer32x;\r
+ else\r
+ r = ¤tConfig.renderer;\r
+ *r += diff;\r
+\r
+ if (*r >= RT_COUNT)\r
+ *r = 0;\r
+ else if (*r < 0)\r
+ *r = RT_COUNT - 1;\r
+}\r
+\r
static void draw_cd_leds(void)\r
{\r
int led_reg, pitch, scr_offs, led_offs;\r
\r
void pemu_finalize_frame(const char *fps, const char *notice)\r
{\r
- if (currentConfig.renderer != RT_16BIT && !(PicoIn.AHW & PAHW_32X)) {\r
+ if (!is_16bit_mode()) {\r
+ // convert the 8 bit CLUT output to 16 bit RGB\r
unsigned short *pd = (unsigned short *)g_screen_ptr +\r
out_y * g_screen_ppitch + out_x;\r
- unsigned char *ps = Pico.est.Draw2FB + 328*out_y + 8; //+ out_x;\r
+ unsigned char *ps = Pico.est.Draw2FB + 328*out_y + 8;\r
unsigned short *pal = Pico.est.HighPal;\r
int i, x;\r
\r
\r
void plat_video_set_buffer(void *buf)\r
{\r
- if (currentConfig.renderer == RT_16BIT || (PicoIn.AHW & PAHW_32X))\r
+ if (is_16bit_mode())\r
PicoDrawSetOutBuf(g_screen_ptr, g_screen_ppitch * 2);\r
}\r
\r
static void apply_renderer(void)\r
{\r
- switch (currentConfig.renderer) {\r
+ switch (get_renderer()) {\r
case RT_16BIT:\r
PicoIn.opt &= ~POPT_ALT_RENDERER;\r
PicoIn.opt &= ~POPT_DIS_32C_BORDER;\r
\r
void plat_video_toggle_renderer(int change, int is_menu)\r
{\r
- currentConfig.renderer += change;\r
- if (currentConfig.renderer >= RT_COUNT)\r
- currentConfig.renderer = 0;\r
- else if (currentConfig.renderer < 0)\r
- currentConfig.renderer = RT_COUNT - 1;\r
+ change_renderer(change);\r
\r
- if (!is_menu)\r
+ if (!is_menu) {\r
apply_renderer();\r
\r
- emu_status_msg(renderer_names[currentConfig.renderer]);\r
+ if (PicoIn.AHW & PAHW_32X)\r
+ emu_status_msg(renderer_names32x[get_renderer()]);\r
+ else\r
+ emu_status_msg(renderer_names[get_renderer()]);\r
+ }\r
}\r
\r
void plat_status_msg_clear(void)\r
void emu_video_mode_change(int start_line, int line_count, int is_32cols)\r
{\r
// clear whole screen in all buffers\r
- if (currentConfig.renderer != RT_16BIT && !(PicoIn.AHW & PAHW_32X))\r
+ if (!is_16bit_mode())\r
memset32(Pico.est.Draw2FB, 0xe0e0e0e0, (320+8) * (8+240+8) / 4);\r
plat_video_clear_buffers();\r
\r