diff --git a/Source/nragev20/GBCart.cpp b/Source/nragev20/GBCart.cpp index 92bf259dc..3ca6a26e4 100644 --- a/Source/nragev20/GBCart.cpp +++ b/Source/nragev20/GBCart.cpp @@ -346,6 +346,12 @@ bool LoadCart(LPGBCART Cart, LPCTSTR RomFileName, LPCTSTR RamFileName, LPCTSTR T case 0x06: Cart->iNumRomBanks = 128; break; + case 0x07: + Cart->iNumRomBanks = 256; + break; + case 0x08: + Cart->iNumRomBanks = 512; + break; case 0x52: Cart->iNumRomBanks = 72; break; @@ -889,7 +895,7 @@ bool WriteCartMBC3(LPGBCART Cart, WORD dwAddress, BYTE *Data) { if (Cart->bHasRam) { - Cart->iCurrentRamBankNo = Data[0] & 0x03; + Cart->iCurrentRamBankNo = Data[0] & 0x07; DebugWriteA("Set RAM Bank: %02X\n", Cart->iCurrentRamBankNo); if (Cart->bHasTimer && (Data[0] >= 0x08 && Data[0] <= 0x0c)) { diff --git a/Source/nragev20/Interface.cpp b/Source/nragev20/Interface.cpp index a29a3407b..82b2175bf 100644 --- a/Source/nragev20/Interface.cpp +++ b/Source/nragev20/Interface.cpp @@ -3524,7 +3524,7 @@ bool GetButtonText( const BUTTON& btnButton, LPTSTR Buffer ) DWORD ScanKeyboard( LPDEVICE lpDevice, LPDWORD lpdwCounter, LPBUTTON pButton ) { HRESULT hr; - BYTE cKeys[256]; + BYTE cKeys[256] = {0}; hr = lpDevice->didHandle->GetDeviceState( sizeof( cKeys ), (LPVOID)&cKeys ); if ( FAILED(hr) ) @@ -3534,9 +3534,8 @@ DWORD ScanKeyboard( LPDEVICE lpDevice, LPDWORD lpdwCounter, LPBUTTON pButton ) } int iGotKey = FALSE; - int i = 0; - for( i = 0; i < ARRAYSIZE( cKeys ); ++i ) + for( int i = 1; i < ARRAYSIZE( cKeys ); ++i ) { if (( cKeys[i] & 0x80 ) ) { diff --git a/Source/nragev20/PakIO.cpp b/Source/nragev20/PakIO.cpp index 26d20ebd5..f3e4c3037 100644 --- a/Source/nragev20/PakIO.cpp +++ b/Source/nragev20/PakIO.cpp @@ -1329,19 +1329,19 @@ bool InsertNoteFile( LPBYTE aMemPak, LPCTSTR pszFileName ) int len = lstrlenA( szLine ); i = 16; - while(( szLine[i] != '}' ) && (i < len)) + while((i < len) && ( szLine[i] != '}' )) i++; szLine[i] = '\0'; i += ReverseNotesA( &szLine[16], &pBlock[12] ); - while(( szLine[i] != '{' ) && (i < len)) + while((i < len) && ( szLine[i] != '{' )) i++; if(i < len) { int start = i+1; - while(( szLine[i] != '}' ) && (i < len)) + while((i < len) && ( szLine[i] != '}' )) i++; if(i < len) { @@ -1350,7 +1350,7 @@ bool InsertNoteFile( LPBYTE aMemPak, LPCTSTR pszFileName ) } } - while(( szLine[i] != '}' ) && (i < len)) + while((i < len) && ( szLine[i] != '}' )) i++; szLine[i] = '\0'; diff --git a/Source/nragev20/Version.h.in b/Source/nragev20/Version.h.in index 32e41fe65..8b732797c 100644 --- a/Source/nragev20/Version.h.in +++ b/Source/nragev20/Version.h.in @@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define VERSION_REVISION 1 #define VERSION_BUILD 9999 #define VERSION_PREFIX "Dev-" +#define VERSION_BUILD_YEAR 2025 #define GIT_REVISION "" #define GIT_REVISION_SHORT "" diff --git a/Source/nragev20/XInputController.cpp b/Source/nragev20/XInputController.cpp index b14418a74..4b66a5ab5 100644 --- a/Source/nragev20/XInputController.cpp +++ b/Source/nragev20/XInputController.cpp @@ -105,10 +105,10 @@ BOOL IsXInputDevice( const GUID* pGuidProductFromDirectInput ) // If it does, then get the VID/PID from var.bstrVal DWORD dwPid = 0, dwVid = 0; WCHAR* strVid = wcsstr( var.bstrVal, L"VID_" ); - if (strVid && wscanf(strVid, L"VID_%4X", &dwVid) != 1) + if (strVid && swscanf(strVid, L"VID_%4X", &dwVid) != 1) dwVid = 0; WCHAR* strPid = wcsstr( var.bstrVal, L"PID_" ); - if (strPid && wscanf(strPid, L"PID_%4X", &dwPid) != 1) + if (strPid && swscanf(strPid, L"PID_%4X", &dwPid) != 1) dwPid = 0; // Compare the VID/PID to the DInput device @@ -388,8 +388,7 @@ TCHAR * GetN64ButtonNameFromButtonCode( int Button ) { using namespace N64_BUTTONS; - TCHAR *btnName; - btnName = new TCHAR[10]; + static TCHAR btnName[10]; switch( Button ) { @@ -444,10 +443,9 @@ TCHAR * GetN64ButtonArrayFromXAnalog( LPXCONTROLLER gController, int XThStickOrX using namespace N64_BUTTONS; if( !gController || !gController->bConfigured ) - return NULL; + return _T(""); - TCHAR *name; - name = new TCHAR[15]; + static TCHAR name[15]; switch( XThStickOrXDpad ) { diff --git a/Source/nragev20/XInputController.h b/Source/nragev20/XInputController.h index 3a537663b..b3e4ea628 100644 --- a/Source/nragev20/XInputController.h +++ b/Source/nragev20/XInputController.h @@ -61,7 +61,7 @@ number, ie. first XInput controller is first N64 player, etc. #include // Defines -#define N64_ANALOG_MAX 127 +#define N64_ANALOG_MAX 88 #define XC_ANALOG_MAX 32767 #define BUTTON_ANALOG_VALUE 60