new 32x renderers, auto fskip change, massive refactoring
[libpicofe.git] / pandora / emu.c
index f7c2a2e..2bd8be8 100644 (file)
@@ -23,6 +23,8 @@
 static short __attribute__((aligned(4))) sndBuffer[2*44100/50];\r
 static unsigned char temp_frame[g_screen_width * g_screen_height * 2];\r
 unsigned char *PicoDraw2FB = temp_frame;\r
+const char **renderer_names = NULL;\r
+const char **renderer_names32x = NULL;\r
 char cpu_clk_name[] = "unused";\r
 \r
 \r
@@ -43,7 +45,7 @@ static void osd_text(int x, int y, const char *text)
 {\r
        int len = strlen(text)*8;\r
 \r
-       if ((PicoOpt&0x10)||!(currentConfig.EmuOpt&0x80)) {\r
+       if (0) {\r
                int *p, i, h;\r
                x &= ~3; // align x\r
                len = (len+3) >> 2;\r
@@ -71,7 +73,7 @@ static void draw_cd_leds(void)
 //     if (!((Pico_mcd->s68k_regs[0] ^ old_reg) & 3)) return; // no change // mmu hack problems?\r
        old_reg = Pico_mcd->s68k_regs[0];\r
 \r
-       if ((PicoOpt&0x10)||!(currentConfig.EmuOpt&0x80)) {\r
+       if (0) {\r
                // 8-bit modes\r
                unsigned int col_g = (old_reg & 2) ? 0xc0c0c0c0 : 0xe0e0e0e0;\r
                unsigned int col_r = (old_reg & 1) ? 0xd0d0d0d0 : 0xe0e0e0e0;\r
@@ -183,10 +185,10 @@ void pemu_finalize_frame(const char *fps, const char *notice)
                draw_cd_leds();\r
 }\r
 \r
-void plat_video_toggle_renderer(int is_next, int force_16bpp, int is_menu)\r
+void plat_video_toggle_renderer(int change, int is_menu)\r
 {\r
        // this will auto-select SMS/32X renderers\r
-       PicoDrawSetColorFormat(1);\r
+       PicoDrawSetOutFormat(PDF_RGB555, 1);\r
 }\r
 \r
 void plat_video_menu_enter(int is_rom_loaded)\r
@@ -251,17 +253,14 @@ void plat_update_volume(int has_changed, int is_up)
 void pemu_forced_frame(int opts)\r
 {\r
        int po_old = PicoOpt;\r
-       int eo_old = currentConfig.EmuOpt;\r
 \r
        PicoOpt &= ~0x10;\r
        PicoOpt |= opts|POPT_ACC_SPRITES; // acc_sprites\r
-       currentConfig.EmuOpt |= 0x80;\r
 \r
        Pico.m.dirtyPal = 1;\r
        PicoFrameDrawOnly();\r
 \r
        PicoOpt = po_old;\r
-       currentConfig.EmuOpt = eo_old;\r
 }\r
 \r
 static void updateSound(int len)\r
@@ -339,16 +338,16 @@ void emu_video_mode_change(int start_line, int line_count, int is_32cols)
                memset32(fbdev_buffers[i], 0, g_screen_width * g_screen_height * 2 / 4);\r
 \r
 #ifdef USE_320_SCREEN\r
-       PicoDrawSetColorFormat(1);\r
+       PicoDrawSetOutFormat(PDF_RGB555, 1);\r
        PicoScanBegin = EmuScanBegin16;\r
 #else\r
        if (PicoAHW & PAHW_32X) {\r
                DrawLineDest = (unsigned short *)temp_frame;\r
-               PicoDrawSetColorFormat(1);\r
+               PicoDrawSetOutFormat(PDF_RGB555, 1);\r
                PicoScanBegin = NULL;\r
                PicoScanEnd = EmuScanEnd16_32x;\r
        } else {\r
-               PicoDrawSetColorFormat(-1);\r
+               PicoDrawSetOutFormat(PDF_NONE, 0);\r
                PicoScanBegin = NULL;\r
                PicoScanEnd = EmuScanEnd16;\r
        }\r
@@ -374,7 +373,7 @@ void pemu_loop_end(void)
        PicoOpt |= POPT_EN_SOFTSCALE|POPT_ACC_SPRITES;\r
        currentConfig.EmuOpt |= EOPT_16BPP;\r
 \r
-       PicoDrawSetColorFormat(1);\r
+       PicoDrawSetOutFormat(PDF_RGB555, 1);\r
        Pico.m.dirtyPal = 1;\r
        PicoFrame();\r
 \r