fixed some config/menu options

This commit is contained in:
ekeeke31 2010-05-17 10:55:37 +00:00
parent 11e600e933
commit 6617086d87
6 changed files with 65 additions and 62 deletions

View File

@ -31,19 +31,19 @@
typedef struct typedef struct
{ {
char version[16]; char version[16];
int32 psg_preamp;
int32 fm_preamp;
uint8 hq_fm; uint8 hq_fm;
uint8 psgBoostNoise;
uint8 filter; uint8 filter;
int8 lp_range; uint8 psgBoostNoise;
uint8 dac_bits;
int16 psg_preamp;
int16 fm_preamp;
int16 lp_range;
int16 low_freq; int16 low_freq;
int16 high_freq; int16 high_freq;
float lg; int16 lg;
float mg; int16 mg;
float hg; int16 hg;
float rolloff; float rolloff;
uint8 dac_bits;
uint8 region_detect; uint8 region_detect;
uint8 force_dtack; uint8 force_dtack;
uint8 addr_error; uint8 addr_error;
@ -51,20 +51,27 @@ typedef struct
uint8 lock_on; uint8 lock_on;
uint8 hot_swap; uint8 hot_swap;
uint8 romtype; uint8 romtype;
uint8 invert_mouse;
uint8 gun_cursor[2];
uint8 overscan;
uint8 ntsc;
uint8 render;
uint8 tv_mode;
uint8 bilinear;
uint8 aspect;
int16 xshift; int16 xshift;
int16 yshift; int16 yshift;
int16 xscale; int16 xscale;
int16 yscale; int16 yscale;
uint8 tv_mode; #ifdef HW_RVL
uint8 aspect; uint32 trap;
uint8 overscan; float gamma;
uint8 render; #endif
uint8 ntsc;
uint8 bilinear;
uint8 gun_cursor[2];
uint8 invert_mouse;
uint16 pad_keymap[4][MAX_KEYS];
t_input_config input[MAX_INPUTS]; t_input_config input[MAX_INPUTS];
uint16 pad_keymap[4][MAX_KEYS];
#ifdef HW_RVL
uint32 wpad_keymap[4*3][MAX_KEYS];
#endif
uint8 autoload; uint8 autoload;
uint8 s_auto; uint8 s_auto;
uint8 s_default; uint8 s_default;
@ -76,9 +83,6 @@ typedef struct
float sfx_volume; float sfx_volume;
char sddir[MAXPATHLEN]; char sddir[MAXPATHLEN];
#ifdef HW_RVL #ifdef HW_RVL
float gamma;
uint32 trap;
uint32 wpad_keymap[4*3][MAX_KEYS];
char usbdir[MAXPATHLEN]; char usbdir[MAXPATHLEN];
#endif #endif
} t_config; } t_config;

View File

@ -251,8 +251,8 @@ int slot_load(int slot, int device)
if (fp) if (fp)
{ {
/* Read size */ /* Read size */
fseek(fp , 0 , SEEK_END); fseek(fp, 0, SEEK_END);
filesize = ftell (fp); filesize = ftell(fp);
fseek(fp, 0, SEEK_SET); fseek(fp, 0, SEEK_SET);
/* Read into buffer (2k blocks) */ /* Read into buffer (2k blocks) */

View File

@ -123,11 +123,11 @@ int UnZipBuffer (unsigned char *outbuffer, u64 discoffset, char *filename)
if (fatfile) if (fatfile)
{ {
fseek(fatfile, 0, SEEK_SET); fseek(fatfile, 0, SEEK_SET);
fread(readbuffer, FATCHUNK, 1, fatfile); fread(readbuffer, 2048, 1, fatfile);
} }
else else
{ {
dvd_read (&readbuffer, DVDCHUNK, discoffset); dvd_read (&readbuffer, 2048, discoffset);
} }
/*** Copy PKZip header to local, used as info ***/ /*** Copy PKZip header to local, used as info ***/
@ -191,12 +191,12 @@ int UnZipBuffer (unsigned char *outbuffer, u64 discoffset, char *filename)
if (fatfile) if (fatfile)
{ {
fread(readbuffer, FATCHUNK, 1, fatfile); fread(readbuffer, 2048, 1, fatfile);
} }
else else
{ {
discoffset += DVDCHUNK; discoffset += 2048;
dvd_read (&readbuffer, DVDCHUNK, discoffset); dvd_read (&readbuffer, 2048, discoffset);
} }
} }
while (res != Z_STREAM_END); while (res != Z_STREAM_END);

View File

@ -703,6 +703,9 @@ static int update_snd_items(void)
float fm_volume = (float)config.fm_preamp/100.0; float fm_volume = (float)config.fm_preamp/100.0;
float psg_volume = (float)config.psg_preamp/100.0; float psg_volume = (float)config.psg_preamp/100.0;
float rolloff = config.rolloff * 100.0; float rolloff = config.rolloff * 100.0;
float lg = (float)config.lg/100.0;
float mg = (float)config.mg/100.0;
float hg = config.hg * 100.0;
if (config.hq_fm) if (config.hq_fm)
{ {
@ -735,16 +738,7 @@ static int update_snd_items(void)
if (config.filter == 2) if (config.filter == 2)
{ {
sprintf (items[offset+4].text, "Filtering: 3-BAND EQ"); sprintf (items[offset+4].text, "Filtering: 3-BAND EQ");
sprintf (items[offset+5].text, "Low Gain: %1.2f", config.lg); sprintf (items[offset+5].text, "Low Gain: %1.2f", lg);
sprintf (items[offset+6].text, "Middle Gain: %1.2f", config.mg);
sprintf (items[offset+7].text, "High Gain: %1.2f", config.hg);
sprintf (items[offset+8].text, "Low Freq: %d", config.low_freq);
sprintf (items[offset+9].text, "High Freq: %d", config.high_freq);
strcpy (items[offset+5].comment, "Adjust EQ Low Band Gain");
strcpy (items[offset+6].comment, "Adjust EQ Mid Band Gain");
strcpy (items[offset+7].comment, "Adjust EQ High Band Gain");
strcpy (items[offset+8].comment, "Adjust EQ Lowest Frequency");
strcpy (items[offset+9].comment, "Adjust EQ Highest Frequency");
m->max_items = offset + 10; m->max_items = offset + 10;
} }
else if (config.filter == 1) else if (config.filter == 1)
@ -760,8 +754,8 @@ static int update_snd_items(void)
m->max_items = offset + 5; m->max_items = offset + 5;
} }
sprintf (items[offset+6].text, "Middle Gain: %1.2f", config.mg); sprintf (items[offset+6].text, "Middle Gain: %1.2f", mg);
sprintf (items[offset+7].text, "High Gain: %1.2f", config.hg); sprintf (items[offset+7].text, "High Gain: %1.2f", hg);
sprintf (items[offset+8].text, "Low Freq: %d", config.low_freq); sprintf (items[offset+8].text, "Low Freq: %d", config.low_freq);
sprintf (items[offset+9].text, "High Freq: %d", config.high_freq); sprintf (items[offset+9].text, "High Freq: %d", config.high_freq);
strcpy (items[offset+5].comment, "Adjust EQ Low Band Gain"); strcpy (items[offset+5].comment, "Adjust EQ Low Band Gain");
@ -782,6 +776,9 @@ static void soundmenu ()
float fm_volume = (float)config.fm_preamp/100.0; float fm_volume = (float)config.fm_preamp/100.0;
float psg_volume = (float)config.psg_preamp/100.0; float psg_volume = (float)config.psg_preamp/100.0;
float rolloff = config.rolloff * 100.0; float rolloff = config.rolloff * 100.0;
float lg = (float)config.lg/100.0;
float mg = (float)config.mg/100.0;
float hg = config.hg * 100.0;
int offset = update_snd_items(); int offset = update_snd_items();
GUI_InitMenu(m); GUI_InitMenu(m);
GUI_SlideMenuTitle(m,strlen("Audio ")); GUI_SlideMenuTitle(m,strlen("Audio "));
@ -906,7 +903,7 @@ static void soundmenu ()
if (config.filter == 2) if (config.filter == 2)
{ {
sprintf (items[offset+4].text, "Filtering: 3-BAND EQ"); sprintf (items[offset+4].text, "Filtering: 3-BAND EQ");
sprintf (items[offset+5].text, "Low Gain: %1.2f", config.lg); sprintf (items[offset+5].text, "Low Gain: %1.2f", lg);
strcpy (items[offset+5].comment, "Adjust EQ Low Band Gain"); strcpy (items[offset+5].comment, "Adjust EQ Low Band Gain");
m->max_items = offset + 10; m->max_items = offset + 10;
audio_set_equalizer(); audio_set_equalizer();
@ -939,21 +936,24 @@ static void soundmenu ()
} }
else else
{ {
GUI_OptionBox(m,0,"Low Gain",(void *)&config.lg,0.01,0.0,2.0,0); GUI_OptionBox(m,0,"Low Gain",(void *)&lg,0.01,0.0,2.0,0);
sprintf (items[offset+5].text, "Low Gain: %1.2f", config.lg); sprintf (items[offset+5].text, "Low Gain: %1.2f", lg);
config.lg = (int)(lg * 100.0);
audio_set_equalizer(); audio_set_equalizer();
} }
break; break;
case 7: case 7:
GUI_OptionBox(m,0,"Middle Gain",(void *)&config.mg,0.01,0.0,2.0,0); GUI_OptionBox(m,0,"Middle Gain",(void *)&mg,0.01,0.0,2.0,0);
sprintf (items[offset+6].text, "Middle Gain: %1.2f", config.mg); sprintf (items[offset+6].text, "Middle Gain: %1.2f", mg);
config.mg = (int)(mg * 100.0);
audio_set_equalizer(); audio_set_equalizer();
break; break;
case 8: case 8:
GUI_OptionBox(m,0,"High Gain",(void *)&config.hg,0.01,0.0,2.0,0); GUI_OptionBox(m,0,"High Gain",(void *)&hg,0.01,0.0,2.0,0);
sprintf (items[offset+7].text, "High Gain: %1.2f", config.hg); sprintf (items[offset+7].text, "High Gain: %1.2f", hg);
config.hg = (int)(hg * 100.0);
audio_set_equalizer(); audio_set_equalizer();
break; break;
@ -997,7 +997,7 @@ static void systemmenu ()
else if (config.region_detect == 2) else if (config.region_detect == 2)
sprintf (items[0].text, "Console Region: EUR"); sprintf (items[0].text, "Console Region: EUR");
else if (config.region_detect == 3) else if (config.region_detect == 3)
sprintf (items[0].text, "Console Region: JAP"); sprintf (items[0].text, "Console Region: JPN");
sprintf (items[1].text, "System Lockups: %s", config.force_dtack ? "OFF" : "ON"); sprintf (items[1].text, "System Lockups: %s", config.force_dtack ? "OFF" : "ON");
sprintf (items[2].text, "68k Address Error: %s", config.addr_error ? "ON" : "OFF"); sprintf (items[2].text, "68k Address Error: %s", config.addr_error ? "ON" : "OFF");
@ -1008,7 +1008,7 @@ static void systemmenu ()
else if (config.lock_on == TYPE_AR) else if (config.lock_on == TYPE_AR)
sprintf (items[4].text, "Lock-On: ACTION REPLAY"); sprintf (items[4].text, "Lock-On: ACTION REPLAY");
else if (config.lock_on == TYPE_SK) else if (config.lock_on == TYPE_SK)
sprintf (items[4].text, "Lock-On: SONIC & KNUCKLES"); sprintf (items[4].text, "Lock-On: SONIC&KNUCKLES");
else else
sprintf (items[4].text, "Lock-On: OFF"); sprintf (items[4].text, "Lock-On: OFF");
@ -1118,12 +1118,11 @@ static void systemmenu ()
else if (config.lock_on == TYPE_AR) else if (config.lock_on == TYPE_AR)
sprintf (items[4].text, "Lock-On: ACTION REPLAY"); sprintf (items[4].text, "Lock-On: ACTION REPLAY");
else if (config.lock_on == TYPE_SK) else if (config.lock_on == TYPE_SK)
sprintf (items[4].text, "Lock-On: SONIC & KNUCKLES"); sprintf (items[4].text, "Lock-On: SONIC&KNUCKLES");
else else
sprintf (items[4].text, "Lock-On: OFF"); sprintf (items[4].text, "Lock-On: OFF");
if (cart.romsize) if (cart.romsize)
{ {
system_reset(); /* clear any patches first */
system_init(); system_init();
system_reset(); system_reset();
if (config.s_auto & 1) if (config.s_auto & 1)
@ -2660,14 +2659,14 @@ static void showrominfo (void)
sprintf (items[11], "ROM end: $%06X", rominfo.romend); sprintf (items[11], "ROM end: $%06X", rominfo.romend);
if (sram.custom) if (sram.custom)
sprintf (items[12], "EEPROM(%dK): $%06X", ((eeprom.type.size_mask+1)* 8) /1024, (unsigned int)eeprom.type.sda_out_bit); sprintf (items[12], "EEPROM(%dK): $%06X", ((eeprom.type.size_mask+1)* 8) /1024, eeprom.type.sda_in_adr);
else if (sram.detected) else if (sram.detected)
sprintf (items[12], "SRAM Start: $%06X", sram.start); sprintf (items[12], "SRAM Start: $%06X", sram.start);
else else
sprintf (items[12], "No Backup Memory specified"); sprintf (items[12], "No Backup Memory specified");
if (sram.custom) if (sram.custom)
sprintf (items[13], "EEPROM(%dK): $%06X", ((eeprom.type.size_mask+1)* 8) /1024, (unsigned int)eeprom.type.scl_bit); sprintf (items[13], "EEPROM(%dK): $%06X", ((eeprom.type.size_mask+1)* 8) /1024, eeprom.type.sda_out_adr);
else if (sram.detected) else if (sram.detected)
sprintf (items[13], "SRAM End: $%06X", sram.end); sprintf (items[13], "SRAM End: $%06X", sram.end);
else if (sram.on) else if (sram.on)
@ -2676,15 +2675,15 @@ static void showrominfo (void)
sprintf (items[13], "SRAM disabled by default"); sprintf (items[13], "SRAM disabled by default");
if (region_code == REGION_USA) if (region_code == REGION_USA)
sprintf (items[14], "Region: %s (USA)", rominfo.country); sprintf (items[14], "Region Code: %s (USA)", rominfo.country);
else if (region_code == REGION_EUROPE) else if (region_code == REGION_EUROPE)
sprintf (items[14], "Region: %s (EUR)", rominfo.country); sprintf (items[14], "Region Code: %s (EUR)", rominfo.country);
else if (region_code == REGION_JAPAN_NTSC) else if (region_code == REGION_JAPAN_NTSC)
sprintf (items[14], "Region: %s (JAP)", rominfo.country); sprintf (items[14], "Region Code: %s (JPN)", rominfo.country);
else if (region_code == REGION_JAPAN_PAL) else if (region_code == REGION_JAPAN_PAL)
sprintf (items[14], "Region: %s (JAP 50Hz)", rominfo.country); sprintf (items[14], "Region Code: %s (JPN-PAL)", rominfo.country);
GUI_TextWindow(&menu_main, "ROM Header Infos", items, 15, 15); GUI_TextWindow(&menu_main, "ROM Header Info", items, 15, 15);
} }
/*************************************************************************** /***************************************************************************

View File

@ -33,9 +33,9 @@
#define SK_UPMEM "/genplus/sk2chip.bin" #define SK_UPMEM "/genplus/sk2chip.bin"
#ifdef HW_RVL #ifdef HW_RVL
#define VERSION "version 1.3.xW" #define VERSION "version 1.4.0W"
#else #else
#define VERSION "version 1.3.xG" #define VERSION "version 1.4.0G"
#endif #endif
#define osd_input_Update() gx_input_UpdateEmu() #define osd_input_Update() gx_input_UpdateEmu()

View File

@ -42,9 +42,9 @@ static EQSTATE eq;
void audio_set_equalizer(void) void audio_set_equalizer(void)
{ {
init_3band_state(&eq,config.low_freq,config.high_freq,snd.sample_rate); init_3band_state(&eq,config.low_freq,config.high_freq,snd.sample_rate);
eq.lg = (double)(config.lg); eq.lg = (double)(config.lg) / 100.0;
eq.mg = (double)(config.mg); eq.mg = (double)(config.mg) / 100.0;
eq.hg = (double)(config.hg); eq.hg = (double)(config.hg) / 100.0;
} }
/**************************************************************** /****************************************************************