X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Flinux%2Femu.c;h=5d4432fa05e6eb404d7750ebb1b790c6585d239d;hb=ee3c39efd2cf51cd654b6240f6fb595673f10f45;hp=91115ad6e56058c71ed5f80833a45a87ff97f3aa;hpb=341af486f5620570dd21519a811f79a1c51bd5c3;p=picodrive.git diff --git a/platform/linux/emu.c b/platform/linux/emu.c index 91115ad..5d4432f 100644 --- a/platform/linux/emu.c +++ b/platform/linux/emu.c @@ -29,10 +29,8 @@ void pemu_prep_defconfig(void) void pemu_validate_config(void) { - extern int PicoOpt; -// PicoOpt &= ~POPT_EXT_FM; -#ifndef __arm__ - PicoOpt &= ~POPT_EN_DRC; +#if !defined(__arm__) && !defined(__i386__) && !defined(__x86_64__) + PicoIn.opt &= ~POPT_EN_DRC; #endif } @@ -68,10 +66,10 @@ static void draw_cd_leds(void) void pemu_finalize_frame(const char *fps, const char *notice) { - if (currentConfig.renderer != RT_16BIT && !(PicoAHW & PAHW_32X)) { - unsigned short *pd = (unsigned short *)g_screen_ptr + 8 * g_screen_width; - unsigned char *ps = PicoDraw2FB + 328*8 + 8; - unsigned short *pal = HighPal; + if (currentConfig.renderer != RT_16BIT && !(PicoIn.AHW & PAHW_32X)) { + 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; if (Pico.m.dirtyPal) PicoDrawUpdateHighPal(); @@ -86,7 +84,7 @@ void pemu_finalize_frame(const char *fps, const char *notice) if (currentConfig.EmuOpt & EOPT_SHOW_FPS) emu_osd_text16(g_screen_width - 60, g_screen_height - 8, fps); } - if ((PicoAHW & PAHW_MCD) && (currentConfig.EmuOpt & EOPT_EN_CD_LEDS)) + if ((PicoIn.AHW & PAHW_MCD) && (currentConfig.EmuOpt & EOPT_EN_CD_LEDS)) draw_cd_leds(); } @@ -94,23 +92,23 @@ static void apply_renderer(void) { switch (currentConfig.renderer) { case RT_16BIT: - PicoOpt &= ~POPT_ALT_RENDERER; + 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: - PicoOpt &= ~POPT_ALT_RENDERER; + PicoIn.opt &= ~POPT_ALT_RENDERER; PicoDrawSetOutFormat(PDF_8BIT, 0); - PicoDrawSetOutBuf(PicoDraw2FB + 8, 328); + PicoDrawSetOutBuf(Pico.est.Draw2FB + 8, 328); break; case RT_8BIT_FAST: - PicoOpt |= POPT_ALT_RENDERER; + PicoIn.opt |= POPT_ALT_RENDERER; PicoDrawSetOutFormat(PDF_NONE, 0); break; } - if (PicoAHW & PAHW_32X) - PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2); + if (PicoIn.AHW & PAHW_32X) + PicoDrawSetOutBuf(g_screen_ptr, g_screen_ppitch * 2); } void plat_video_toggle_renderer(int change, int is_menu) @@ -129,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); } @@ -145,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); } @@ -155,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; @@ -176,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) @@ -203,3 +201,7 @@ void plat_wait_till_us(unsigned int us_to) } } +void *plat_mem_get_for_drc(size_t size) +{ + return NULL; +}