X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=platform%2Fgp2x%2Femu.c;h=f17e53ad6c7d502fd5e5c733af6c9cecb732d570;hb=bbc8ceb9c0fbe92d803b41efa4cc073899aad664;hp=f27b2850deaaf7fe4c5bfc39e18b2ecb2aa77050;hpb=d34a42f93fdb8e0dc66875a08571cae2135b14cf;p=picodrive.git diff --git a/platform/gp2x/emu.c b/platform/gp2x/emu.c index f27b285..f17e53a 100644 --- a/platform/gp2x/emu.c +++ b/platform/gp2x/emu.c @@ -6,8 +6,6 @@ #include #include #include -#include -#include #include #include "plat_gp2x.h" @@ -39,18 +37,12 @@ extern int crashed_940; static short __attribute__((aligned(4))) sndBuffer[2*44100/50]; static struct timeval noticeMsgTime = { 0, 0 }; // when started showing -static int osd_fps_x; -static int gp2x_old_gamma = 100; static char noticeMsg[40]; -unsigned char *PicoDraw2FB = NULL; // temporary buffer for alt renderer -int reset_timing = 0; - -#define PICO_PEN_ADJUST_X 4 -#define PICO_PEN_ADJUST_Y 2 -static int pico_pen_x = 320/2, pico_pen_y = 240/2; - -static void emu_msg_tray_open(void); +static unsigned char PicoDraw2FB_[(8+320) * (8+240+8)]; +unsigned char *PicoDraw2FB = PicoDraw2FB_; +static int osd_fps_x; +extern void *gp2x_screens[4]; void plat_status_msg(const char *format, ...) { @@ -63,7 +55,7 @@ void plat_status_msg(const char *format, ...) gettimeofday(¬iceMsgTime, 0); } -int emu_getMainDir(char *dst, int len) +int plat_get_root_dir(char *dst, int len) { extern char **g_argv; int j; @@ -78,27 +70,6 @@ int emu_getMainDir(char *dst, int len) return j + 1; } -void emu_Init(void) -{ - // make temp buffer for alt renderer - PicoDraw2FB = malloc((8+320)*(8+240+8)); - if (!PicoDraw2FB) - { - printf("PicoDraw2FB == 0\n"); - } - - // make dirs for saves, cfgs, etc. - mkdir("mds", 0777); - mkdir("srm", 0777); - mkdir("brm", 0777); - mkdir("cfg", 0777); - - PicoInit(); - PicoMessage = plat_status_msg_busy_next; - PicoMCDopenTray = emu_msg_tray_open; - PicoMCDcloseTray = menu_loop_tray; -} - static void scaling_update(void) { @@ -116,32 +87,12 @@ static void scaling_update(void) } -void emu_Deinit(void) -{ - // save SRAM - if((currentConfig.EmuOpt & 1) && SRam.changed) { - emu_SaveLoadGame(0, 1); - SRam.changed = 0; - } - - if (!(currentConfig.EmuOpt & EOPT_NO_AUTOSVCFG)) - emu_writelrom(); - - free(PicoDraw2FB); - - PicoExit(); - - // restore gamma - if (gp2x_old_gamma != 100) - set_lcd_gamma(100, 0); -} - -void emu_prepareDefaultConfig(void) +void pemu_prep_defconfig(void) { gp2x_soc_t soc; memset(&defaultConfig, 0, sizeof(defaultConfig)); - defaultConfig.EmuOpt = 0x9d | EOPT_RAM_TIMINGS | 0x600; // | <- confirm_save, cd_leds + defaultConfig.EmuOpt = 0x9d | EOPT_RAM_TIMINGS|EOPT_CONFIRM_SAVE|EOPT_EN_CD_LEDS; defaultConfig.s_PicoOpt = 0x0f | POPT_EN_MCD_PCM|POPT_EN_MCD_CDDA|POPT_EN_SVP_DRC|POPT_ACC_SPRITES; defaultConfig.s_PsndRate = 44100; defaultConfig.s_PicoRegion = 0; // auto @@ -157,77 +108,129 @@ void emu_prepareDefaultConfig(void) soc = soc_detect(); if (soc == SOCID_MMSP2) defaultConfig.s_PicoOpt |= POPT_EXT_FM; + else if (soc == SOCID_POLLUX) + defaultConfig.EmuOpt |= EOPT_WIZ_TEAR_FIX|EOPT_SHOW_RTC; } -static void osd_text(int x, int y, const char *text) +static void (*osd_text)(int x, int y, const char *text); + +static void osd_text8(int x, int y, const char *text) { int len = strlen(text)*8; int *p, i, h, offs; - if ((PicoOpt&0x10)||!(currentConfig.EmuOpt&0x80)) { - len = (len+3) >> 2; - for (h = 0; h < 8; h++) { - offs = (x + g_screen_width * (y+h)) & ~3; - p = (int *) ((char *)g_screen_ptr + offs); - for (i = len; i; i--, p++) - *p = 0xe0e0e0e0; - } - emu_textOut8(x, y, text); - } else { - len = (len+1) >> 1; - for (h = 0; h < 8; h++) { - offs = (x + g_screen_width * (y+h)) & ~1; - p = (int *) ((short *)g_screen_ptr + offs); - for (i = len; i; i--, p++) - *p = (*p >> 2) & 0x39e7; - } - emu_textOut16(x, y, text); + len = (len+3) >> 2; + for (h = 0; h < 8; h++) { + offs = (x + g_screen_width * (y+h)) & ~3; + p = (int *) ((char *)g_screen_ptr + offs); + for (i = len; i; i--, p++) + *p = 0xe0e0e0e0; + } + emu_text_out8(x, y, text); +} + +static void osd_text16(int x, int y, const char *text) +{ + int len = strlen(text)*8; + int *p, i, h, offs; + + len = (len+1) >> 1; + for (h = 0; h < 8; h++) { + offs = (x + g_screen_width * (y+h)) & ~1; + p = (int *) ((short *)g_screen_ptr + offs); + for (i = len; i; i--, p++) + *p = (*p >> 2) & 0x39e7; + } + emu_text_out16(x, y, text); +} + +static void osd_text8_rot(int x, int y, const char *text) +{ + int len = strlen(text) * 8; + char *p = (char *)g_screen_ptr + 240*(320-x) + y; + + while (len--) { + memset(p, 0xe0, 8); + p -= 240; } + + emu_text_out8_rot(x, y, text); +} + +static void osd_text16_rot(int x, int y, const char *text) +{ + int len = strlen(text) * 8; + short *p = (short *)g_screen_ptr + 240*(320-x) + y; + + while (len--) { + memset(p, 0, 8*2); + p -= 240; + } + + emu_text_out16_rot(x, y, text); } static void draw_cd_leds(void) { - int old_reg; - old_reg = Pico_mcd->s68k_regs[0]; + int led_reg, pitch, scr_offs, led_offs; + led_reg = Pico_mcd->s68k_regs[0]; + + if (currentConfig.EmuOpt & EOPT_WIZ_TEAR_FIX) { + pitch = 240; + led_offs = -pitch * 6; + scr_offs = pitch * (320 - 4); + } else { + pitch = 320; + led_offs = 4; + scr_offs = pitch * 2 + 4; + } if ((PicoOpt & POPT_ALT_RENDERER) || !(currentConfig.EmuOpt & EOPT_16BPP)) { + #define p(x) px[(x) >> 2] // 8-bit modes - unsigned int col_g = (old_reg & 2) ? 0xc0c0c0c0 : 0xe0e0e0e0; - unsigned int col_r = (old_reg & 1) ? 0xd0d0d0d0 : 0xe0e0e0e0; - *(unsigned int *)((char *)g_screen_ptr + 320*2+ 4) = - *(unsigned int *)((char *)g_screen_ptr + 320*3+ 4) = - *(unsigned int *)((char *)g_screen_ptr + 320*4+ 4) = col_g; - *(unsigned int *)((char *)g_screen_ptr + 320*2+12) = - *(unsigned int *)((char *)g_screen_ptr + 320*3+12) = - *(unsigned int *)((char *)g_screen_ptr + 320*4+12) = col_r; + unsigned int *px = (unsigned int *)((char *)g_screen_ptr + scr_offs); + unsigned int col_g = (led_reg & 2) ? 0xc0c0c0c0 : 0xe0e0e0e0; + unsigned int col_r = (led_reg & 1) ? 0xd0d0d0d0 : 0xe0e0e0e0; + p(pitch*0) = p(pitch*1) = p(pitch*2) = col_g; + p(pitch*0 + led_offs) = p(pitch*1 + led_offs) = p(pitch*2 + led_offs) = col_r; + #undef p } else { + #define p(x) px[(x)*2 >> 2] = px[((x)*2 >> 2) + 1] // 16-bit modes - unsigned int *p = (unsigned int *)((short *)g_screen_ptr + 320*2+4); - unsigned int col_g = (old_reg & 2) ? 0x06000600 : 0; - unsigned int col_r = (old_reg & 1) ? 0xc000c000 : 0; - *p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r; p += 320/2 - 12/2; - *p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r; p += 320/2 - 12/2; - *p++ = col_g; *p++ = col_g; p+=2; *p++ = col_r; *p++ = col_r; + unsigned int *px = (unsigned int *)((short *)g_screen_ptr + scr_offs); + unsigned int col_g = (led_reg & 2) ? 0x06000600 : 0; + unsigned int col_r = (led_reg & 1) ? 0xc000c000 : 0; + p(pitch*0) = p(pitch*1) = p(pitch*2) = col_g; + p(pitch*0 + led_offs) = p(pitch*1 + led_offs) = p(pitch*2 + led_offs) = col_r; + #undef p } } static void draw_pico_ptr(void) { unsigned short *p = (unsigned short *)g_screen_ptr; + int x, y, pitch = 320; // only if pen enabled and for 16bit modes - if (pico_inp_mode == 0 || (PicoOpt&0x10) || !(currentConfig.EmuOpt&0x80)) return; + if (pico_inp_mode == 0 || (PicoOpt & POPT_ALT_RENDERER) || !(currentConfig.EmuOpt & EOPT_16BPP)) + return; - if (!(Pico.video.reg[12]&1) && !(PicoOpt&POPT_DIS_32C_BORDER)) - p += 32; + x = pico_pen_x + PICO_PEN_ADJUST_X; + y = pico_pen_y + PICO_PEN_ADJUST_Y; + if (!(Pico.video.reg[12]&1) && !(PicoOpt & POPT_DIS_32C_BORDER)) + x += 32; - p += 320 * (pico_pen_y + PICO_PEN_ADJUST_Y); - p += pico_pen_x + PICO_PEN_ADJUST_X; - p[0] ^= 0xffff; - p[319] ^= 0xffff; - p[320] ^= 0xffff; - p[321] ^= 0xffff; - p[640] ^= 0xffff; + if (EOPT_WIZ_TEAR_FIX) { + pitch = 240; + p += (319 - x) * pitch + y; + } else + p += x + y * pitch; + + p[0] ^= 0xffff; + p[pitch-1] ^= 0xffff; + p[pitch] ^= 0xffff; + p[pitch+1] ^= 0xffff; + p[pitch*2] ^= 0xffff; } static int EmuScanBegin16(unsigned int num) @@ -246,8 +249,45 @@ static int EmuScanBegin8(unsigned int num) return 0; } +/* rot thing for Wiz */ +static unsigned char __attribute__((aligned(4))) rot_buff[320*4*2]; + +static int EmuScanBegin16_rot(unsigned int num) +{ + DrawLineDest = rot_buff + (num & 3) * 320 * 2; + return 0; +} + +static int EmuScanEnd16_rot(unsigned int num) +{ + if ((num & 3) != 3) + return 0; + if (!(Pico.video.reg[1] & 8)) + num += 8; + rotated_blit16(g_screen_ptr, rot_buff, num + 1, + !(Pico.video.reg[12] & 1) && !(PicoOpt & POPT_EN_SOFTSCALE)); + return 0; +} + +static int EmuScanBegin8_rot(unsigned int num) +{ + DrawLineDest = rot_buff + (num & 3) * 320; + return 0; +} + +static int EmuScanEnd8_rot(unsigned int num) +{ + if ((num & 3) != 3) + return 0; + if (!(Pico.video.reg[1] & 8)) + num += 8; + rotated_blit8(g_screen_ptr, rot_buff, num + 1, + !(Pico.video.reg[12] & 1)); + return 0; +} + int localPal[0x100]; -static void (*vidCpyM2)(void *dest, void *src) = NULL; +static void (*vidcpyM2)(void *dest, void *src, int m32col, int with_32c_border) = NULL; static void blit(const char *fps, const char *notice) { @@ -266,7 +306,8 @@ static void blit(const char *fps, const char *notice) if (PicoRead16Hook == PicoSVPRead16) memset32((int *)(PicoDraw2FB+328*8+328*223), 0xe0e0e0e0, 328); // do actual copy - vidCpyM2((unsigned char *)g_screen_ptr+320*8, PicoDraw2FB+328*8); + vidcpyM2(g_screen_ptr, PicoDraw2FB+328*8, + !(Pico.video.reg[12] & 1), !(PicoOpt & POPT_DIS_32C_BORDER)); } else if (!(emu_opt & EOPT_16BPP)) { @@ -317,23 +358,32 @@ static void blit(const char *fps, const char *notice) draw_pico_ptr(); gp2x_video_flip(); - - if (!(PicoOpt & POPT_ALT_RENDERER)) { - if (!(Pico.video.reg[1]&8)) { - if (currentConfig.EmuOpt & EOPT_16BPP) - DrawLineDest = (unsigned short *) g_screen_ptr + 320*8; - else - DrawLineDest = (unsigned char *) g_screen_ptr + 320*8; - } else { - DrawLineDest = g_screen_ptr; - } - } } // clears whole screen or just the notice area (in all buffers) static void clearArea(int full) { - if ((PicoOpt&0x10)||!(currentConfig.EmuOpt&0x80)) { + int is_8bit = (PicoOpt & POPT_ALT_RENDERER) || !(currentConfig.EmuOpt & EOPT_16BPP); + if (!full && (currentConfig.EmuOpt & EOPT_WIZ_TEAR_FIX)) { + /* ugh.. */ + int i, u, *p; + if (is_8bit) { + for (i = 0; i < 4; i++) { + p = (int *)gp2x_screens[i] + (240-8) / 4; + for (u = 320; u > 0; u--, p += 240/4) + p[0] = p[1] = 0xe0e0e0e0; + } + } else { + for (i = 0; i < 4; i++) { + p = (int *)gp2x_screens[i] + (240-8)*2 / 4; + for (u = 320; u > 0; u--, p += 240*2/4) + p[0] = p[1] = p[2] = p[3] = 0; + } + } + return; + } + + if (is_8bit) { // 8-bit renderers if (full) gp2x_memset_all_buffers(0, 0xe0, 320*240); else gp2x_memset_all_buffers(320*232, 0xe0, 320*8); @@ -362,17 +412,46 @@ void plat_status_msg_busy_first(const char *msg) static void vidResetMode(void) { + PicoScanEnd = NULL; + if (PicoOpt & POPT_ALT_RENDERER) { - gp2x_video_changemode(8); - } else if (currentConfig.EmuOpt & EOPT_16BPP) { - gp2x_video_changemode(16); + if (currentConfig.EmuOpt & EOPT_WIZ_TEAR_FIX) { + gp2x_video_changemode(-8); + vidcpyM2 = vidcpy_m2_rot; + osd_text = osd_text8_rot; + } else { + gp2x_video_changemode(8); + vidcpyM2 = vidcpy_m2; + osd_text = osd_text8; + } + } + else if (currentConfig.EmuOpt & EOPT_16BPP) { PicoDrawSetColorFormat(1); - PicoScanBegin = EmuScanBegin16; - } else { - gp2x_video_changemode(8); + if (currentConfig.EmuOpt & EOPT_WIZ_TEAR_FIX) { + gp2x_video_changemode(-16); + PicoScanBegin = EmuScanBegin16_rot; + PicoScanEnd = EmuScanEnd16_rot; + osd_text = osd_text16_rot; + } else { + gp2x_video_changemode(16); + PicoScanBegin = EmuScanBegin16; + osd_text = osd_text16; + } + } + else { PicoDrawSetColorFormat(2); - PicoScanBegin = EmuScanBegin8; + if (currentConfig.EmuOpt & EOPT_WIZ_TEAR_FIX) { + gp2x_video_changemode(-8); + PicoScanBegin = EmuScanBegin8_rot; + PicoScanEnd = EmuScanEnd8_rot; + osd_text = osd_text8_rot; + } else { + gp2x_video_changemode(8); + PicoScanBegin = EmuScanBegin8; + osd_text = osd_text8; + } } + if ((PicoOpt & POPT_ALT_RENDERER) || !(currentConfig.EmuOpt & EOPT_16BPP)) { // setup pal for 8-bit modes localPal[0xc0] = 0x0000c000; // MCD LEDs @@ -384,21 +463,33 @@ static void vidResetMode(void) gp2x_video_flip(); } Pico.m.dirtyPal = 1; + // reset scaling if (currentConfig.scaling == EOPT_SCALE_HW_HV && !(Pico.video.reg[1]&8)) gp2x_video_RGB_setscaling(8, (PicoOpt&0x100)&&!(Pico.video.reg[12]&1) ? 256 : 320, 224); else gp2x_video_RGB_setscaling(0, (PicoOpt&0x100)&&!(Pico.video.reg[12]&1) ? 256 : 320, 240); } -void plat_video_toggle_renderer(void) +void plat_video_toggle_renderer(int is_next, int is_menu) { + /* alt, 16bpp, 8bpp */ if (PicoOpt & POPT_ALT_RENDERER) { PicoOpt &= ~POPT_ALT_RENDERER; - currentConfig.EmuOpt |= EOPT_16BPP; - } else if (!(currentConfig.EmuOpt & EOPT_16BPP)) - PicoOpt |= POPT_ALT_RENDERER; - else + if (is_next) + currentConfig.EmuOpt |= EOPT_16BPP; + } else if (!(currentConfig.EmuOpt & EOPT_16BPP)) { + if (is_next) + PicoOpt |= POPT_ALT_RENDERER; + else + currentConfig.EmuOpt |= EOPT_16BPP; + } else { currentConfig.EmuOpt &= ~EOPT_16BPP; + if (!is_next) + PicoOpt |= POPT_ALT_RENDERER; + } + + if (is_menu) + return; vidResetMode(); @@ -411,20 +502,12 @@ void plat_video_toggle_renderer(void) } } -static void emu_msg_tray_open(void) -{ - plat_status_msg("CD tray opened"); -} - +#if 0 // TODO static void RunEventsPico(unsigned int events) { int ret, px, py, lim_x; static int pdown_frames = 0; - emu_RunEventsPico(events); - - if (pico_inp_mode == 0) return; - // for F200 ret = gp2x_touchpad_read(&px, &py); if (ret >= 0) @@ -449,24 +532,8 @@ static void RunEventsPico(unsigned int events) //if (ret == 0) // PicoPicohw.pen_pos[0] = PicoPicohw.pen_pos[1] = 0x8000; } - - if (PicoPad[0] & 1) pico_pen_y--; - if (PicoPad[0] & 2) pico_pen_y++; - if (PicoPad[0] & 4) pico_pen_x--; - if (PicoPad[0] & 8) pico_pen_x++; - PicoPad[0] &= ~0x0f; // release UDLR - - lim_x = (Pico.video.reg[12]&1) ? 319 : 255; - if (pico_pen_y < 8) pico_pen_y = 8; - if (pico_pen_y > 224-PICO_PEN_ADJUST_Y) pico_pen_y = 224-PICO_PEN_ADJUST_Y; - if (pico_pen_x < 0) pico_pen_x = 0; - if (pico_pen_x > lim_x-PICO_PEN_ADJUST_X) pico_pen_x = lim_x-PICO_PEN_ADJUST_X; - - PicoPicohw.pen_pos[0] = pico_pen_x; - if (!(Pico.video.reg[12]&1)) PicoPicohw.pen_pos[0] += pico_pen_x/4; - PicoPicohw.pen_pos[0] += 0x3c; - PicoPicohw.pen_pos[1] = pico_inp_mode == 1 ? (0x2f8 + pico_pen_y) : (0x1fc + pico_pen_y); } +#endif void plat_update_volume(int has_changed, int is_up) { @@ -519,7 +586,7 @@ static void updateSound(int len) sndout_oss_write(PsndOut, len<<1); } -void emu_startSound(void) +void pemu_sound_start(void) { static int PsndRate_old = 0, PicoOpt_old = 0, pal_old = 0; int target_fps = Pico.m.pal ? 50 : 60; @@ -549,12 +616,11 @@ void emu_startSound(void) } } -void emu_endSound(void) +void pemu_sound_stop(void) { } -/* wait until we can write more sound */ -void emu_waitSound(void) +void pemu_sound_wait(void) { // don't need to do anything, writes will block by themselves } @@ -568,38 +634,27 @@ static void SkipFrame(int do_audio) } -void emu_forcedFrame(int opts) +void pemu_forced_frame(int opts) { int po_old = PicoOpt; int eo_old = currentConfig.EmuOpt; - PicoOpt &= ~0x10; - PicoOpt |= opts|POPT_ACC_SPRITES; // acc_sprites - currentConfig.EmuOpt |= 0x80; + PicoOpt &= ~POPT_ALT_RENDERER; + PicoOpt |= opts|POPT_ACC_SPRITES; + currentConfig.EmuOpt |= EOPT_16BPP; - //vidResetMode(); PicoDrawSetColorFormat(1); PicoScanBegin = EmuScanBegin16; + PicoScanEnd = NULL; Pico.m.dirtyPal = 1; PicoFrameDrawOnly(); -/* - if (!(Pico.video.reg[12]&1)) { - vidCpyM2 = vidCpyM2_32col; - clearArea(1); - } else vidCpyM2 = vidCpyM2_40col; - - vidCpyM2((unsigned char *)g_screen_ptr+320*8, PicoDraw2FB+328*8); - vidConvCpyRGB32(localPal, Pico.cram, 0x40); - gp2x_video_setpalette(localPal, 0x40); -*/ PicoOpt = po_old; currentConfig.EmuOpt = eo_old; } -void emu_platformDebugCat(char *str) +void plat_debug_cat(char *str) { - // nothing } static void simpleWait(int thissec, int lim_time) @@ -668,9 +723,10 @@ static void tga_dump(void) #endif -void emu_Loop(void) +void pemu_loop(void) { - static int gp2x_old_clock = -1, EmuOpt_old = 0; + static int gp2x_old_clock = -1, EmuOpt_old = 0, pal_old = 0; + static int gp2x_old_gamma = 100; char fpsbuff[24]; // fps count c string struct timeval tval; // timing int pframes_done, pframes_shown, pthissec; // "period" frames, used for sync @@ -702,7 +758,7 @@ void emu_Loop(void) printf("updated gamma to %i, A_SN's curve: %i\n", currentConfig.gamma, !!(currentConfig.EmuOpt&0x1000)); } - if ((EmuOpt_old ^ currentConfig.EmuOpt) & EOPT_PSYNC) { + if (((EmuOpt_old ^ currentConfig.EmuOpt) & EOPT_PSYNC) || Pico.m.pal != pal_old) { if (currentConfig.EmuOpt & EOPT_PSYNC) set_lcd_custom_rate(Pico.m.pal); else @@ -713,6 +769,7 @@ void emu_Loop(void) gp2x_make_fb_bufferable(currentConfig.EmuOpt & EOPT_MMUHACK); EmuOpt_old = currentConfig.EmuOpt; + pal_old = Pico.m.pal; fpsbuff[0] = 0; // make sure we are in correct mode @@ -726,13 +783,13 @@ void emu_Loop(void) target_frametime = 1000000/target_fps; reset_timing = 1; - emu_startSound(); + pemu_sound_start(); // prepare CD buffer if (PicoAHW & PAHW_MCD) PicoCDBufferInit(); // calc vsync offset to sync timing code with vsync - if (currentConfig.EmuOpt&0x2000) { + if (currentConfig.EmuOpt & EOPT_PSYNC) { gettimeofday(&tval, 0); gp2x_video_wait_vsync(); gettimeofday(&tval, 0); @@ -780,16 +837,9 @@ void emu_Loop(void) { int scalex = 320; osd_fps_x = OSD_FPS_X; - if (modes & 4) { - vidCpyM2 = vidCpyM2_40col; - } else { - if (PicoOpt & 0x100) { - vidCpyM2 = vidCpyM2_32col_nobord; - scalex = 256; - osd_fps_x = OSD_FPS_X - 64; - } else { - vidCpyM2 = vidCpyM2_32col; - } + if (!(modes & 4) && (PicoOpt & POPT_DIS_32C_BORDER)) { + scalex = 256; + osd_fps_x = OSD_FPS_X - 64; } /* want vertical scaling and game is not in 240 line mode */ if (currentConfig.scaling == EOPT_SCALE_HW_HV && !(modes&8)) @@ -906,28 +956,20 @@ void emu_Loop(void) frames_done++; frames_shown++; } - emu_changeFastForward(0); + emu_set_fastforward(0); if (PicoAHW & PAHW_MCD) PicoCDBufferFree(); // save SRAM - if ((currentConfig.EmuOpt & EOPT_USE_SRAM) && SRam.changed) { + if ((currentConfig.EmuOpt & EOPT_EN_SRAM) && SRam.changed) { plat_status_msg_busy_first("Writing SRAM/BRAM..."); - emu_SaveLoadGame(0, 1); + emu_save_load_game(0, 1); SRam.changed = 0; } - // if in 8bit mode, generate 16bit image for menu background - if ((PicoOpt & POPT_ALT_RENDERER) || !(currentConfig.EmuOpt & EOPT_16BPP)) - emu_forcedFrame(POPT_EN_SOFTSCALE); -} - - -void emu_ResetGame(void) -{ - PicoReset(); - reset_timing = 1; + // do menu background to be sure it's right + pemu_forced_frame(POPT_EN_SOFTSCALE); } const char *plat_get_credits(void)