From 67dfdf5fa6bdd5f923d7d181aaaa79b784792782 Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 25 Mar 2008 22:37:37 +0000 Subject: [PATCH] renderer bugfix, minor adjustments git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@395 be3aeb3a-fb24-0410-a615-afba39da0efa --- common/config.c | 10 +++++++++- common/emu.c | 2 ++ gp2x/emu.c | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/common/config.c b/common/config.c index c117fb9..a1808ee 100644 --- a/common/config.c +++ b/common/config.c @@ -21,7 +21,7 @@ extern const int cdopt_entry_count; static menu_entry *cfg_opts[] = { opt_entries, opt2_entries, cdopt_entries }; static const int *cfg_opt_counts[] = { &opt_entry_count, &opt2_entry_count, &cdopt_entry_count }; -#define NL "\n" +#define NL "\r\n" static char *mystrip(char *str) @@ -322,6 +322,9 @@ write: keys_write(fn, "bind_joy2", currentConfig.JoyBinds[2], defaultConfig.JoyBinds[2], joyKeyNames, 1); keys_write(fn, "bind_joy3", currentConfig.JoyBinds[3], defaultConfig.JoyBinds[3], joyKeyNames, 1); + if (section == NULL) + fprintf(fn, "Sound Volume = %i" NL, currentConfig.volume); + fprintf(fn, NL); if (fo != NULL) @@ -626,6 +629,11 @@ static void parse(const char *var, const char *val) if (strcasecmp(var, "LastUsedROM") == 0) return; /* handled elsewhere */ + if (strcasecmp(var, "Sound Volume") == 0) { + currentConfig.volume = atoi(val); + return; + } + // key binds if (strncasecmp(var, "bind ", 5) == 0) { keys_parse(var + 5, val, currentConfig.KeyBinds, keyNames); diff --git a/common/emu.c b/common/emu.c index 02640bb..ab17a1f 100644 --- a/common/emu.c +++ b/common/emu.c @@ -511,8 +511,10 @@ int emu_ReadConfig(int game, int no_defaults) ret = -1; if (config_havesect(cfg, sect)) { + int vol = currentConfig.volume; emu_setDefaultConfig(); ret = config_readsect(cfg, sect); + currentConfig.volume = vol; // make vol global (bah) } if (ret != 0) diff --git a/gp2x/emu.c b/gp2x/emu.c index 0375a7f..f251188 100644 --- a/gp2x/emu.c +++ b/gp2x/emu.c @@ -272,7 +272,7 @@ static void blit(const char *fps, const char *notice) vidConvCpyRGB32(localPal, Pico.cram, 0x40); vidConvCpyRGB32sh(localPal+0x40, Pico.cram, 0x40); vidConvCpyRGB32hi(localPal+0x80, Pico.cram, 0x40); - blockcpy(localPal+0xc0, localPal+0x40, 0x40*4); + memcpy32(localPal+0xc0, localPal+0x40, 0x40); localPal[0xc0] = 0x0000c000; localPal[0xd0] = 0x00c00000; localPal[0xe0] = 0x00000000; // reserved pixels for OSD -- 2.39.5