[gamecube] better implementation of progressive mode user switch ?

This commit is contained in:
ekeeke31 2012-04-10 19:03:32 +00:00
parent bbdea720d3
commit befc2b8f0a
4 changed files with 30 additions and 35 deletions

View File

@ -212,25 +212,41 @@ void config_default(void)
sprintf (config.lastdir[3][TYPE_DVD], "dvd:%s/roms/", DEFAULT_PATH); sprintf (config.lastdir[3][TYPE_DVD], "dvd:%s/roms/", DEFAULT_PATH);
#endif #endif
/* try to restore settings from config file */ /* try to restore user config */
if (!config_load()) GUI_WaitPrompt("Info","Default Settings restored"); int loaded = config_load();
/* hot swap requires at least a first initialization */
config.hot_swap &= 1;
/* restore inputs */ /* restore inputs */
input_init(); input_init();
#ifndef HW_RVL #ifndef HW_RVL
/* support for progressive mode (480p) if component cable has been detected */ /* detect progressive mode enable/disable requests */
if (VIDEO_HaveComponentCable()) PAD_ScanPads();
if (PAD_ButtonsHeld(0) & PAD_BUTTON_B)
{ {
/* switch into configured video mode */ /* swap progressive mode enable flag and play some sound to inform user */
vmode = config.v_prog ? &TVNtsc480Prog : &TVNtsc480IntDf; config.v_prog ^= 1;
ASND_Pause(0);
int voice = ASND_GetFirstUnusedVoice();
ASND_SetVoice(voice,VOICE_MONO_16BIT,44100,0,(u8 *)intro_pcm,intro_pcm_size,200,200,NULL);
}
/* switch into 480p if component cable has been detected and progressive mode is enabled */
if (VIDEO_HaveComponentCable() && config.v_prog)
{
vmode = &TVNtsc480Prog;
VIDEO_Configure (vmode); VIDEO_Configure (vmode);
VIDEO_Flush(); VIDEO_Flush();
VIDEO_WaitVSync(); VIDEO_WaitVSync();
VIDEO_WaitVSync(); VIDEO_WaitVSync();
} }
/* stop any sound */
ASND_Pause(1);
#endif #endif
/* inform user if default config is used */
if (!loaded)
{
GUI_WaitPrompt("Warning","Default Settings restored");
}
} }

View File

@ -120,24 +120,6 @@ void legal ()
gxTextureClose(&button); gxTextureClose(&button);
gxTextureClose(&logo); gxTextureClose(&logo);
#ifndef HW_RVL
/* detect video mode switch user request */
if (PAD_ButtonsHeld(0) & PAD_BUTTON_B)
{
/* switch user progressive mode configuration */
config.v_prog ^= 1;
/* play sound to inform user then enter main menu */
ASND_Pause(0);
int voice = ASND_GetFirstUnusedVoice();
ASND_SetVoice(voice,VOICE_MONO_16BIT,44100,0,(u8 *)intro_pcm,intro_pcm_size,200,200,NULL);
sleep (2);
ASND_Pause(1);
return;
}
#endif
if (count > 0) if (count > 0)
{ {
ASND_Pause(0); ASND_Pause(0);

View File

@ -1384,12 +1384,6 @@ void gx_video_Stop(void)
#ifdef HW_RVL #ifdef HW_RVL
VIDEO_SetTrapFilter(1); VIDEO_SetTrapFilter(1);
VIDEO_SetGamma(VI_GM_1_0); VIDEO_SetGamma(VI_GM_1_0);
#else
if (VIDEO_HaveComponentCable())
{
/* switch video mode only if component cable has been detected */
vmode = config.v_prog ? &TVNtsc480Prog : &TVNtsc480IntDf;
}
#endif #endif
/* adjust TV width */ /* adjust TV width */

View File

@ -104,7 +104,10 @@ static void init_machine(void)
/* allocate cartridge ROM here (10 MB) */ /* allocate cartridge ROM here (10 MB) */
cart.rom = memalign(32, MAXROMSIZE); cart.rom = memalign(32, MAXROMSIZE);
/* mark all BIOS as unloaded */ /* system is not initialized */
config.hot_swap &= 0x01;
/* BIOS are unloaded */
config.bios &= 0x03; config.bios &= 0x03;
/* Genesis BOOT ROM support (2KB max) */ /* Genesis BOOT ROM support (2KB max) */
@ -544,8 +547,8 @@ int main (int argc, char *argv[])
gx_audio_Init(); gx_audio_Init();
/* initialize genesis plus core */ /* initialize genesis plus core */
config_default();
history_default(); history_default();
config_default();
init_machine(); init_machine();
/* auto-load last ROM file */ /* auto-load last ROM file */