[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);
#endif
/* try to restore settings from config file */
if (!config_load()) GUI_WaitPrompt("Info","Default Settings restored");
/* hot swap requires at least a first initialization */
config.hot_swap &= 1;
/* try to restore user config */
int loaded = config_load();
/* restore inputs */
input_init();
#ifndef HW_RVL
/* support for progressive mode (480p) if component cable has been detected */
if (VIDEO_HaveComponentCable())
/* detect progressive mode enable/disable requests */
PAD_ScanPads();
if (PAD_ButtonsHeld(0) & PAD_BUTTON_B)
{
/* switch into configured video mode */
vmode = config.v_prog ? &TVNtsc480Prog : &TVNtsc480IntDf;
/* swap progressive mode enable flag and play some sound to inform user */
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_Flush();
VIDEO_WaitVSync();
VIDEO_WaitVSync();
}
/* stop any sound */
ASND_Pause(1);
#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(&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)
{
ASND_Pause(0);

View File

@ -1384,12 +1384,6 @@ void gx_video_Stop(void)
#ifdef HW_RVL
VIDEO_SetTrapFilter(1);
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
/* adjust TV width */

View File

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