Added "detect now" tool for detecting the backup media of the cartridge.
This commit is contained in:
parent
3659a3fb67
commit
e7087a90fe
|
@ -170,6 +170,7 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
|
|||
ON_COMMAND(ID_OPTIONS_EMULATOR_REALTIMECLOCK, OnOptionsEmulatorRealtimeclock)
|
||||
ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_REALTIMECLOCK, OnUpdateOptionsEmulatorRealtimeclock)
|
||||
ON_COMMAND(ID_OPTIONS_EMULATOR_REWINDINTERVAL, OnOptionsEmulatorRewindinterval)
|
||||
|
||||
ON_COMMAND(ID_OPTIONS_EMULATOR_SAVETYPE_AUTOMATIC, OnOptionsEmulatorSavetypeAutomatic)
|
||||
ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SAVETYPE_AUTOMATIC, OnUpdateOptionsEmulatorSavetypeAutomatic)
|
||||
ON_COMMAND(ID_OPTIONS_EMULATOR_SAVETYPE_EEPROM, OnOptionsEmulatorSavetypeEeprom)
|
||||
|
@ -186,6 +187,8 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
|
|||
ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SAVETYPE_FLASH512K, OnUpdateOptionsEmulatorSavetypeFlash512k)
|
||||
ON_COMMAND(ID_OPTIONS_EMULATOR_SAVETYPE_FLASH1M, OnOptionsEmulatorSavetypeFlash1m)
|
||||
ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SAVETYPE_FLASH1M, OnUpdateOptionsEmulatorSavetypeFlash1m)
|
||||
ON_COMMAND(ID_OPTIONS_EMULATOR_SAVETYPE_DETECTNOW, OnOptionsEmulatorSavetypeDetectNow)
|
||||
|
||||
ON_COMMAND(ID_OPTIONS_EMULATOR_PNGFORMAT, OnOptionsEmulatorPngformat)
|
||||
ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_PNGFORMAT, OnUpdateOptionsEmulatorPngformat)
|
||||
ON_COMMAND(ID_OPTIONS_EMULATOR_BMPFORMAT, OnOptionsEmulatorBmpformat)
|
||||
|
|
|
@ -188,6 +188,7 @@ protected:
|
|||
afx_msg void OnUpdateOptionsEmulatorSavetypeFlash512k(CCmdUI* pCmdUI);
|
||||
afx_msg void OnOptionsEmulatorSavetypeFlash1m();
|
||||
afx_msg void OnUpdateOptionsEmulatorSavetypeFlash1m(CCmdUI* pCmdUI);
|
||||
afx_msg void OnOptionsEmulatorSavetypeDetectNow();
|
||||
afx_msg void OnOptionsEmulatorPngformat();
|
||||
afx_msg void OnUpdateOptionsEmulatorPngformat(CCmdUI* pCmdUI);
|
||||
afx_msg void OnOptionsEmulatorBmpformat();
|
||||
|
|
|
@ -784,6 +784,36 @@ void MainWnd::OnUpdateOptionsEmulatorSavetypeFlash1m(CCmdUI* pCmdUI)
|
|||
pCmdUI->SetCheck(flashSize == 0x20000);
|
||||
}
|
||||
|
||||
void MainWnd::OnOptionsEmulatorSavetypeDetectNow()
|
||||
{
|
||||
const int address_max = theApp.romSize - 10;
|
||||
char temp[11]; temp[10] = '\0';
|
||||
CString answer( _T( "This cartridge has probably no backup media." ) );
|
||||
|
||||
for( int address = 0; address < address_max; address += 4 ) {
|
||||
memcpy( temp, &rom[address], 10 );
|
||||
|
||||
if( 0 == strncmp( temp, "EEPROM_V", 8 ) ) {
|
||||
answer = _T( "This cartridge uses EEPROM." );
|
||||
break;
|
||||
}
|
||||
if( 0 == strncmp( temp, "SRAM_V", 6 ) ) {
|
||||
answer = _T( "This cartridge uses SRAM." );
|
||||
break;
|
||||
}
|
||||
if( ( 0 == strncmp( temp, "FLASH_V", 7 ) ) || ( 0 == strncmp( temp, "FLASH512_V", 10 ) ) ) {
|
||||
answer = _T( "This cartridge uses FLASH (64 KiB)." );
|
||||
break;
|
||||
}
|
||||
if( 0 == strncmp( temp, "FLASH1M_V", 9 ) ) {
|
||||
answer = _T( "This cartridge uses FLASH (128 KiB)." );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MessageBox( answer );
|
||||
}
|
||||
|
||||
void MainWnd::OnOptionsEmulatorPngformat()
|
||||
{
|
||||
theApp.captureFormat = 0;
|
||||
|
|
|
@ -1885,6 +1885,8 @@ BEGIN
|
|||
MENUITEM SEPARATOR
|
||||
MENUITEM "Flash 64 KB", ID_OPTIONS_EMULATOR_SAVETYPE_FLASH512K
|
||||
MENUITEM "Flash 128 KB", ID_OPTIONS_EMULATOR_SAVETYPE_FLASH1M
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Detect now...", 40372
|
||||
END
|
||||
POPUP "Screenshot &Format"
|
||||
BEGIN
|
||||
|
|
|
@ -870,13 +870,14 @@
|
|||
#define ID_FILE_OPEN_GBA 40366
|
||||
#define ID_OPTIONS_VIDEO_LAYERS_RESET 40367
|
||||
#define ID_LOADGAME_DONOTCHANGECHEATLIST 40371
|
||||
#define ID_OPTIONS_EMULATOR_SAVETYPE_DETECTNOW 40372
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 165
|
||||
#define _APS_NEXT_COMMAND_VALUE 40372
|
||||
#define _APS_NEXT_COMMAND_VALUE 40373
|
||||
#define _APS_NEXT_CONTROL_VALUE 1297
|
||||
#define _APS_NEXT_SYMED_VALUE 103
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue