From 9efc102f1c8f6e2ebc5412f1b2c45a0c77acad48 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 12 Sep 2009 21:54:46 +0000 Subject: [PATCH] 32x: packed pixel mode (works over 68k) git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@773 be3aeb3a-fb24-0410-a615-afba39da0efa --- common/emu.c | 52 +++++++++++++++++++++++++++++++++----------------- common/menu.c | 2 +- common/plat.h | 2 +- gp2x/Makefile | 2 ++ gp2x/emu.c | 8 ++++++-- linux/Makefile | 2 +- 6 files changed, 46 insertions(+), 22 deletions(-) diff --git a/common/emu.c b/common/emu.c index 6fc25b4..627c3be 100644 --- a/common/emu.c +++ b/common/emu.c @@ -409,6 +409,32 @@ static void shutdown_MCD(void) PicoAHW &= ~PAHW_MCD; } +static void system_announce(void) +{ + const char *sys_name, *tv_standard; + int fps; + + if (PicoAHW & PAHW_SMS) { + sys_name = "Master System"; + } else if (PicoAHW & PAHW_PICO) { + sys_name = "Pico"; + } else if (PicoAHW & PAHW_MCD) { + sys_name = "Mega CD"; + if ((Pico.m.hardware & 0xc0) == 0x80) + sys_name = "Sega CD"; + } else if (PicoAHW & PAHW_32X) { + sys_name = "32X"; + } else { + sys_name = "MegaDrive"; + if ((Pico.m.hardware & 0xc0) == 0x80) + sys_name = "Genesis"; + } + tv_standard = Pico.m.pal ? "PAL" : "NTSC"; + fps = Pico.m.pal ? 50 : 60; + + emu_status_msg("%s %s / %dFPS", tv_standard, sys_name, fps); +} + // note: this function might mangle rom_fname // XXX: portions of this code should move to pico/ int emu_reload_rom(char *rom_fname) @@ -612,21 +638,7 @@ int emu_reload_rom(char *rom_fname) } else { - const char *sys_name, *tv_standard; - int fps; - - if (PicoAHW & PAHW_SMS) { - sys_name = "Master System"; - } else { - sys_name = "MegaDrive"; - if ((Pico.m.hardware&0xc0) == 0x80) - sys_name = "Genesis"; - } - tv_standard = Pico.m.pal ? "PAL" : "NTSC"; - fps = Pico.m.pal ? 50 : 60; - - emu_status_msg("%s %s / %dFPS", tv_standard, sys_name, fps); - + system_announce(); PicoOpt &= ~POPT_DIS_VDP_FIFO; } @@ -1073,6 +1085,12 @@ static void emu_tray_close(void) emu_status_msg("CD tray closed."); } +void emu_32x_startup(void) +{ + plat_video_toggle_renderer(0, 1, 0); + system_announce(); +} + void emu_reset_game(void) { PicoReset(); @@ -1200,9 +1218,9 @@ static void run_events_ui(unsigned int which) PicoStateProgressCB = NULL; } } - if (which & PEV_SWITCH_RND) + if ((which & PEV_SWITCH_RND) && !(PicoAHW & PAHW_32X)) { - plat_video_toggle_renderer(1, 0); + plat_video_toggle_renderer(1, 0, 0); } if (which & (PEV_SSLOT_PREV|PEV_SSLOT_NEXT)) { diff --git a/common/menu.c b/common/menu.c index e651694..adfacef 100644 --- a/common/menu.c +++ b/common/menu.c @@ -1452,7 +1452,7 @@ static int menu_loop_adv_options(menu_id id, int keys) static int mh_opt_render(menu_id id, int keys) { - plat_video_toggle_renderer((keys & PBTN_RIGHT) ? 1 : 0, 1); + plat_video_toggle_renderer((keys & PBTN_RIGHT) ? 1 : 0, 0, 1); return 0; } diff --git a/common/plat.h b/common/plat.h index ca847c6..e1fc29b 100644 --- a/common/plat.h +++ b/common/plat.h @@ -36,7 +36,7 @@ void plat_video_menu_begin(void); void plat_video_menu_end(void); void plat_video_wait_vsync(void); -void plat_video_toggle_renderer(int is_next, int is_menu); +void plat_video_toggle_renderer(int is_next, int force_16bpp, int is_menu); void plat_validate_config(void); void plat_update_volume(int has_changed, int is_up); diff --git a/gp2x/Makefile b/gp2x/Makefile index 817237a..8ccea30 100644 --- a/gp2x/Makefile +++ b/gp2x/Makefile @@ -72,6 +72,8 @@ OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \ pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \ pico/cd/area.o pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o endif +# Pico - 32X +OBJS += pico/32x/32x.o pico/32x/memory.o pico/32x/draw.o # Pico - Pico OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o # Pico - carthw diff --git a/gp2x/emu.c b/gp2x/emu.c index 97b28b6..757bea6 100644 --- a/gp2x/emu.c +++ b/gp2x/emu.c @@ -498,10 +498,14 @@ static void vidResetMode(void) make_local_pal = (PicoAHW & PAHW_SMS) ? make_local_pal_sms : make_local_pal_md; } -void plat_video_toggle_renderer(int is_next, int is_menu) +void plat_video_toggle_renderer(int is_next, int force_16bpp, int is_menu) { + if (force_16bpp) { + PicoOpt &= ~POPT_ALT_RENDERER; + currentConfig.EmuOpt |= EOPT_16BPP; + } /* alt, 16bpp, 8bpp */ - if (PicoOpt & POPT_ALT_RENDERER) { + else if (PicoOpt & POPT_ALT_RENDERER) { PicoOpt &= ~POPT_ALT_RENDERER; if (is_next) currentConfig.EmuOpt |= EOPT_16BPP; diff --git a/linux/Makefile b/linux/Makefile index e6a94a2..32fa3c5 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -40,7 +40,7 @@ OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \ pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \ pico/cd/area.o pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o # Pico - 32X -OBJS += pico/32x/32x.o pico/32x/memory.o +OBJS += pico/32x/32x.o pico/32x/memory.o pico/32x/draw.o # Pico - Pico OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o # Pico - sound -- 2.39.5