32x: packed pixel mode (works over 68k)

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@773 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2009-09-12 21:54:46 +00:00
parent be2c420828
commit 974fdb5bfd
15 changed files with 330 additions and 91 deletions

View file

@ -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))
{

View file

@ -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;
}

View file

@ -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);

View file

@ -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

View file

@ -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;

View file

@ -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