From 0ab4d38fa6197f853b9111104948df09996aa5dc Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 13 Dec 2007 20:54:57 +0000 Subject: [PATCH] mmuhack.o path fix, new sound vol level git-svn-id: file:///home/notaz/opt/svn/fceu@313 be3aeb3a-fb24-0410-a615-afba39da0efa --- drivers/gp2x/input.c | 4 ++-- drivers/gp2x/squidgehack.c | 6 +++--- out_gp2x/readme.txt | 3 ++- sound.c | 4 +++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/gp2x/input.c b/drivers/gp2x/input.c index e1046bd..f554f35 100644 --- a/drivers/gp2x/input.c +++ b/drivers/gp2x/input.c @@ -207,7 +207,7 @@ static void FCEUD_UpdateInput(void) else if (down(VOL_UP)) { /* wait for at least 10 updates, because user may be just trying to enter menu */ - if (volpushed_frames++ > 10) { + if (volpushed_frames++ > 10 && (volpushed_frames&1)) { soundvol++; if (soundvol > 100) soundvol=100; //FCEUI_SetSoundVolume(soundvol); @@ -216,7 +216,7 @@ static void FCEUD_UpdateInput(void) } else if (down(VOL_DOWN)) { - if (volpushed_frames++ > 10) { + if (volpushed_frames++ > 10 && (volpushed_frames&1)) { soundvol-=1; if (soundvol < 0) soundvol=0; //FCEUI_SetSoundVolume(soundvol); diff --git a/drivers/gp2x/squidgehack.c b/drivers/gp2x/squidgehack.c index 67f21b0..28f997f 100644 --- a/drivers/gp2x/squidgehack.c +++ b/drivers/gp2x/squidgehack.c @@ -22,9 +22,9 @@ int mmuhack(void) strcpy(kocmd, "/sbin/insmod "); strncpy(kocmd+13, g_argv[0], 1023-13); kocmd[1023] = 0; - for (i = strlen(kocmd); i > 0; i--) - if (kocmd[i] == '/') { kocmd[i] = 0; break; } - strcat(kocmd, "/mmuhack.o"); + for (i = strlen(kocmd); i > 13; i--) + if (kocmd[i] == '/') { i++; break; } + strcpy(kocmd+i, "mmuhack.o"); printf("Installing NK's kernel module for Squidge MMU Hack (%s)...\n", kocmd); system(kocmd); diff --git a/out_gp2x/readme.txt b/out_gp2x/readme.txt index 201f7f0..c97aae6 100644 --- a/out_gp2x/readme.txt +++ b/out_gp2x/readme.txt @@ -189,11 +189,12 @@ extension instead of .ips. ver 0.4 (by notaz) - ret 311 + ret 313 - Improved open bus emulation, fixes missing ground in some SMB3 levels. - Improved auto frameskip behavior in cases when emu is not fast enough to maintain 50/60 fps. - Fixed a bug which prevented some key combo configurations from working. + - Some other minor changes. rev 171 - Added optional "Accurate renderer", which is the original FCE Ultra 0.98.x renderer + PPU emulation code. It's much slower, but it can diff --git a/sound.c b/sound.c index f6e6a34..f95b050 100644 --- a/sound.c +++ b/sound.c @@ -877,6 +877,8 @@ static int32 flt_acc=0, flt_acc2=0; static void FilterSound(uint32 *in, int16 *outMono, int count) { // static int min=0, max=0; + int sh=2; + if (soundvol < 5) sh += 5 - soundvol; for(;count;count--,in++,outMono++) { @@ -888,7 +890,7 @@ static void FilterSound(uint32 *in, int16 *outMono, int count) flt_acc2+= (int32) (((int64)((diff-flt_acc2)*lowp))>>16); *in=0; - *outMono = flt_acc2*7 >> 2; // * 1.75 + *outMono = flt_acc2*7 >> sh; // * 7 >> 2 = * 1.75 // if (acc2 < min) { printf("min: %i %04x\n", acc2, acc2); min = acc2; } // if (acc2 > max) { printf("max: %i %04x\n", acc2, acc2); max = acc2; } } -- 2.39.2