version 1.09 - with more safe useage of extra ram and safer overclok level

This commit is contained in:
Sylvain PILLOT 2023-02-03 22:17:53 +01:00
parent c331fff878
commit 4f86a8930b
1 changed files with 5 additions and 59 deletions

View File

@ -416,25 +416,6 @@ static void get_inputs_finish_fail( void )
}
#define DBGCRSH 1
int a=0;
void debug_crash( int value )
{
dprint( 1, 1+a*10, C_BLACK, "point = %d : REACHED", value );
a++;
dupdate();
getkey();
}
void debug_crash_msg( char *chain )
{
dprint( 1, 1+a*10, C_BLACK, "point = %s : REACHED", chain );
a++;
dupdate();
getkey();
}
int main(void)
{
__printf_enable_fp();
@ -446,55 +427,23 @@ int main(void)
usb_open(interfaces, GINT_CALL_NULL);
#endif
#if(DBGCRSH)
debug_crash( 1 );
#endif
gint_world_switch( GINT_CALL( is_save_existing ));
#if(DBGCRSH)
debug_crash( 2 );
if(saveexist) debug_crash_msg( "SAVE : OK FILE EXIST" );
else debug_crash_msg( "SAVE : FILE DO NOT EXIST" );
#endif
#if(DBGCRSH)
debug_crash( 3 );
#endif
if (!saveexist) // if we do not have saves
gint_world_switch( GINT_CALL( saveprogress ) ); // we create a progress file which is empty
#if(DBGCRSH)
debug_crash( 4 );
#endif
gint_world_switch( GINT_CALL( loadprogress )); // then we load it
#if(DBGCRSH)
debug_crash( 5 );
#endif
gint_world_switch( GINT_CALL( is_param_existing ));
#if(DBGCRSH)
debug_crash( 6 );
if(paraexist) debug_crash_msg( "PARA : OK FILE EXIST" );
else debug_crash_msg( "PARA : FILE DO NOT EXIST" );
#endif
if (!paraexist) // if we do not have saves
gint_world_switch( GINT_CALL( saveparameters ) ); // we create a parameters file which is empty
#if(DBGCRSH)
debug_crash( 7 );
#endif
gint_world_switch( GINT_CALL( loadparameters )); // then we load it
#if(DBGCRSH)
debug_crash( 8 );
#endif
DiffLevel=PlayerPara[0].DiffLevel;
@ -530,7 +479,7 @@ int main(void)
extended_ram.name = "extram";
extended_ram.is_default = true;
extended_ram.start = (void *)0x8c200000;
extended_ram.end = (void *)0x8c4dffff ;
extended_ram.end = (void *)0x8c4e0000 ;
kmalloc_init_arena(&extended_ram, true);
kmalloc_add_arena(&extended_ram );
@ -560,7 +509,7 @@ int main(void)
extended_ram.name = "extram";
extended_ram.is_default = true;
extended_ram.start = (void *)0x88200000;
extended_ram.end = (void *)0x884dffff ;
extended_ram.end = (void *)0x884e0000 ;
kmalloc_init_arena(&extended_ram, true);
kmalloc_add_arena(&extended_ram );
@ -570,9 +519,7 @@ int main(void)
else abort();
#if(DBGCRSH)
debug_crash( 2 );
#endif
srand( rtc_ticks() );
@ -580,7 +527,6 @@ int main(void)
prof_init();
drawStartTitle();
@ -646,7 +592,7 @@ int main(void)
gint_world_switch( GINT_CALL( saveparameters ) );
if ((gint[HWCALC] == HWCALC_FXCG50 || gint[HWCALC] == HWCALC_PRIZM) && isOCActivated == true) clock_set_speed( CLOCK_SPEED_F5 );
if ((gint[HWCALC] == HWCALC_FXCG50 || gint[HWCALC] == HWCALC_PRIZM) && isOCActivated == true) clock_set_speed( CLOCK_SPEED_F4 );
else if ((gint[HWCALC] == HWCALC_FXCG50 || gint[HWCALC] == HWCALC_PRIZM) && isOCActivated == false && EntryLevel != CLOCK_SPEED_UNKNOWN) clock_set_speed( EntryLevel );
else if ((gint[HWCALC] == HWCALC_FXCG50 || gint[HWCALC] == HWCALC_PRIZM) && isOCActivated == false && EntryLevel == CLOCK_SPEED_UNKNOWN) clock_set_speed( CLOCK_SPEED_DEFAULT );
}