diff --git a/menu/main.cpp b/menu/main.cpp index 510099b..f608fab 100644 --- a/menu/main.cpp +++ b/menu/main.cpp @@ -22,10 +22,7 @@ #define FIXED_POINT_SHIFT 16 static struct MENU_OPTIONS mMenuOptions; -static int mEmuScreenHeight; -static int mEmuScreenWidth; static char mRomName[SAL_MAX_PATH]={""}; -static u32 mLastRate=0; static s8 mFpsDisplay[16]={""}; static s8 mVolumeDisplay[16]={""}; @@ -33,10 +30,7 @@ static s8 mQuickStateDisplay[16]={""}; static u32 mFps=0; static u32 mLastTimer=0; static u32 mEnterMenu=0; -static u32 mLoadRequested=0; -static u32 mSaveRequested=0; static u32 mQuickStateTimer=0; -static u32 mVolumeTimer=0; static u32 mVolumeDisplayTimer=0; static u32 mFramesCleared=0; static u32 mInMenu=0; @@ -215,7 +209,7 @@ bool8_32 S9xDeinitUpdate (int Width, int Height, bool8_32) { mFps++; newTimer=sal_TimerRead(); - if(newTimer-mLastTimer>Memory.ROMFramesPerSecond) + if(newTimer - mLastTimer > (u32)Memory.ROMFramesPerSecond) { mLastTimer=newTimer; sprintf(mFpsDisplay,"%2d/%2d", mFps, Memory.ROMFramesPerSecond); @@ -441,7 +435,6 @@ static u32 LastHz = 0; static int Run(int sound) { - int i; bool PAL = !!(Memory.FillRAM[0x2133] & 4); sal_VideoEnterGame(mMenuOptions.fullScreen, PAL, Memory.ROMFramesPerSecond); @@ -460,7 +453,9 @@ int Run(int sound) Settings.SixteenBitSound=true; #endif - if (LastAudioRate != mMenuOptions.soundRate || LastStereo != mMenuOptions.stereo || LastHz != Memory.ROMFramesPerSecond) + if (LastAudioRate != mMenuOptions.soundRate || + LastStereo != mMenuOptions.stereo || + LastHz != (u32)Memory.ROMFramesPerSecond) { if (LastAudioRate != 0) { @@ -516,11 +511,6 @@ static inline int RunNoSound(void) static int SnesRomLoad() { - char filename[SAL_MAX_PATH+1]; - int check; - char text[256]; - FILE *stream=NULL; - MenuMessageBox("Loading ROM...",mRomName,"",MENU_MESSAGE_BOX_MODE_MSG); if (!Memory.LoadROM (mRomName)) { @@ -697,8 +687,6 @@ extern "C" int mainEntry(int argc, char* argv[]) { - int ref = 0; - s32 event=EVENT_NONE; sal_Init(); diff --git a/menu/menu.cpp b/menu/menu.cpp index 046ae35..49a4939 100644 --- a/menu/menu.cpp +++ b/menu/menu.cpp @@ -16,9 +16,6 @@ static u16 mMenuBackground[SAL_SCREEN_WIDTH * SAL_SCREEN_HEIGHT]; -static s32 mMenutileXscroll=0; -static s32 mMenutileYscroll=0; -static s32 mTileCounter=0; static s32 mQuickSavePresent=0; static u32 mPreviewingState=0; @@ -231,8 +228,6 @@ void freeRomLists() void DefaultRomListItems() { - s32 i; - strcpy(mRomList[ROM_SELECTOR_SAVE_DEFAULT_DIR].displayName,"Save default directory"); strcpy(mRomList[ROM_SELECTOR_MAIN_MENU].displayName,"Main menu"); mRomList[ROM_SELECTOR_DEFAULT_FOCUS].displayName[0]=0; @@ -264,7 +259,6 @@ int FileScan() { s32 itemCount=0, fileCount=0, dirCount=0; s32 x,a,b,startIndex=ROM_SELECTOR_DEFAULT_FOCUS+1; - s8 text[50]; s8 filename[SAL_MAX_PATH]; s8 path[SAL_MAX_PATH]; s8 ext[SAL_MAX_PATH]; @@ -439,7 +433,6 @@ s32 FileSelect() s32 menuExit=0; s32 scanstart=0,scanend=0; u32 keys=0; - s32 size=0, check=SAL_OK; previousRom[0] = '\0'; @@ -735,7 +728,6 @@ static s32 SaveStateSelect(s32 mode) s8 text[128]; s32 action=11; u32 keys=0; - u16 *pixTo,*pixFrom; if(mRomName[0]==0) { @@ -1234,7 +1226,6 @@ void MenuReloadOptions() void MenuInit(const char *systemDir, struct MENU_OPTIONS *menuOptions) { - s8 filename[SAL_MAX_PATH]; u16 *pix; s32 x; @@ -1260,7 +1251,6 @@ s32 SettingsMenu(void) { s32 menuExit=0,menuCount=SETTINGS_MENU_COUNT,menufocus=0,menuSmooth=0; s32 action=0; - s32 subaction=0; u32 keys=0; SettingsMenuUpdateTextAll(); diff --git a/pocketsnes/snes9x/soundux.cpp b/pocketsnes/snes9x/soundux.cpp index 87935f0..8e3cf90 100644 --- a/pocketsnes/snes9x/soundux.cpp +++ b/pocketsnes/snes9x/soundux.cpp @@ -845,7 +845,6 @@ void DecodeBlock (Channel *ch) uint8 interim_byte = 0; compressed++; - signed short *raw = ch->block = ch->decoded; // Seperate out the header parts used for decoding @@ -1647,11 +1646,12 @@ static inline void MixMono (int sample_count) } else { - for (;V > 0; V--) + for (;V > 0; V--) { if ((noise_gen <<= 1) & 0x80000000L) noise_gen ^= 0x0040001L; - ch->sample = (noise_gen << 17) >> 17; - ch->interpolate = 0; + } + ch->sample = (noise_gen << 17) >> 17; + ch->interpolate = 0; } V = (ch->sample * ch-> left_vol_level) / 128; } diff --git a/sal/linux/sal.c b/sal/linux/sal.c index 70c01c4..d8da685 100644 --- a/sal/linux/sal.c +++ b/sal/linux/sal.c @@ -17,13 +17,9 @@ SDL_Surface *mScreen = NULL; #ifdef GCW_JOYSTICK SDL_Joystick *mJoy = NULL; #endif -static u32 mSoundThreadFlag=0; -static u32 mSoundLastCpuSpeed=0; static u32 mPaletteBuffer[PALETTE_BUFFER_LENGTH]; static u32 *mPaletteCurr=(u32*)&mPaletteBuffer[0]; -static u32 *mPaletteLast=(u32*)&mPaletteBuffer[0]; static u32 *mPaletteEnd=(u32*)&mPaletteBuffer[PALETTE_BUFFER_LENGTH]; -static u32 mInputFirst=0; s32 mCpuSpeedLookup[1]={0}; @@ -114,6 +110,8 @@ static u32 sal_Input(int held) case SDLK_HOME: extraKeys |= SAL_INPUT_MENU; break; + default: + continue; } break; #ifdef GCW_JOYSTICK diff --git a/sal/unzip.c b/sal/unzip.c index 904ae41..77f1f39 100644 --- a/sal/unzip.c +++ b/sal/unzip.c @@ -203,12 +203,11 @@ local int unzlocal_getShort (pzlib_filefunc_def,filestream,pX) voidpf filestream; uLong *pX; { - uLong x ; - int i; + int i = 0; int err; err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; + uLong x = (uLong)i; if (err==UNZ_OK) err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); @@ -231,12 +230,11 @@ local int unzlocal_getLong (pzlib_filefunc_def,filestream,pX) voidpf filestream; uLong *pX; { - uLong x ; - int i; + int i = 0; int err; err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; + uLong x = (uLong)i; if (err==UNZ_OK) err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); @@ -1534,7 +1532,6 @@ extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf) char *szComment; uLong uSizeBuf; { - int err=UNZ_OK; unz_s* s; uLong uReadThis ; if (file==NULL) diff --git a/sal/zip.c b/sal/zip.c index acb57dd..c7ef322 100644 --- a/sal/zip.c +++ b/sal/zip.c @@ -372,12 +372,11 @@ local int ziplocal_getShort (pzlib_filefunc_def,filestream,pX) voidpf filestream; uLong *pX; { - uLong x ; - int i; + int i = 0; int err; err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; + uLong x = (uLong)i; if (err==ZIP_OK) err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); @@ -400,12 +399,11 @@ local int ziplocal_getLong (pzlib_filefunc_def,filestream,pX) voidpf filestream; uLong *pX; { - uLong x ; - int i; + int i = 0; int err; err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; + uLong x = (uLong)i; if (err==ZIP_OK) err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i);