added Close ROM menu command and made Lua scripts stop when opening or closing a ROM
This commit is contained in:
parent
b14a3a592b
commit
54f771536e
|
@ -48,10 +48,16 @@ struct HudStruct
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HudStruct()
|
HudStruct()
|
||||||
: fps(0)
|
{
|
||||||
, fps3d(0)
|
resetTransient();
|
||||||
, clicked(false)
|
}
|
||||||
{}
|
|
||||||
|
void resetTransient()
|
||||||
|
{
|
||||||
|
fps = 0;
|
||||||
|
fps3d = 0;
|
||||||
|
clicked = false;
|
||||||
|
}
|
||||||
|
|
||||||
HudCoordinates SavestateSlots;
|
HudCoordinates SavestateSlots;
|
||||||
HudCoordinates FpsDisplay;
|
HudCoordinates FpsDisplay;
|
||||||
|
|
|
@ -2693,6 +2693,8 @@ static BOOL OpenCore(const char* filename)
|
||||||
if(!ObtainFile(filename, LogicalName, PhysicalName, "rom", s_nonRomExtensions, ARRAY_SIZE(s_nonRomExtensions)))
|
if(!ObtainFile(filename, LogicalName, PhysicalName, "rom", s_nonRomExtensions, ARRAY_SIZE(s_nonRomExtensions)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
StopAllLuaScripts();
|
||||||
|
|
||||||
if(LoadROM(filename, LogicalName))
|
if(LoadROM(filename, LogicalName))
|
||||||
{
|
{
|
||||||
romloaded = TRUE;
|
romloaded = TRUE;
|
||||||
|
@ -2791,6 +2793,17 @@ LRESULT OpenFile()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CloseRom()
|
||||||
|
{
|
||||||
|
StopAllLuaScripts();
|
||||||
|
// cheatsSearchClose();
|
||||||
|
NDS_FreeROM();
|
||||||
|
romloaded = false;
|
||||||
|
execute = false;
|
||||||
|
Hud.resetTransient();
|
||||||
|
NDS_Reset();
|
||||||
|
}
|
||||||
|
|
||||||
//TODO - async key state? for real?
|
//TODO - async key state? for real?
|
||||||
int GetModifiers(int key)
|
int GetModifiers(int key)
|
||||||
{
|
{
|
||||||
|
@ -3014,6 +3027,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
DesEnableMenuItem(mainMenu, IDM_FILE_RECORDAVI, romloaded);
|
DesEnableMenuItem(mainMenu, IDM_FILE_RECORDAVI, romloaded);
|
||||||
DesEnableMenuItem(mainMenu, IDM_FILE_RECORDWAV, romloaded);
|
DesEnableMenuItem(mainMenu, IDM_FILE_RECORDWAV, romloaded);
|
||||||
DesEnableMenuItem(mainMenu, IDM_RESET, romloaded);
|
DesEnableMenuItem(mainMenu, IDM_RESET, romloaded);
|
||||||
|
DesEnableMenuItem(mainMenu, IDM_CLOSEROM, romloaded);
|
||||||
DesEnableMenuItem(mainMenu, IDM_SHUT_UP, romloaded);
|
DesEnableMenuItem(mainMenu, IDM_SHUT_UP, romloaded);
|
||||||
DesEnableMenuItem(mainMenu, IDM_CHEATS_LIST, romloaded);
|
DesEnableMenuItem(mainMenu, IDM_CHEATS_LIST, romloaded);
|
||||||
DesEnableMenuItem(mainMenu, IDM_CHEATS_SEARCH, romloaded);
|
DesEnableMenuItem(mainMenu, IDM_CHEATS_SEARCH, romloaded);
|
||||||
|
@ -3525,6 +3539,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
return 0;
|
return 0;
|
||||||
case IDM_OPEN:
|
case IDM_OPEN:
|
||||||
return OpenFile();
|
return OpenFile();
|
||||||
|
case IDM_CLOSEROM:
|
||||||
|
return CloseRom(),0;
|
||||||
case IDM_PRINTSCREEN:
|
case IDM_PRINTSCREEN:
|
||||||
HK_PrintScreen(0);
|
HK_PrintScreen(0);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -120,6 +120,7 @@
|
||||||
#define IDC_PNG 325
|
#define IDC_PNG 325
|
||||||
#define IDC_BMP 326
|
#define IDC_BMP 326
|
||||||
#define IDC_FORMATSTATIC 327
|
#define IDC_FORMATSTATIC 327
|
||||||
|
#define IDM_CLOSEROM 328
|
||||||
#define IDM_PATHSETTINGS 350
|
#define IDM_PATHSETTINGS 350
|
||||||
#define IDC_ROMPATHEDIT 351
|
#define IDC_ROMPATHEDIT 351
|
||||||
#define IDC_BROWSEROMS 352
|
#define IDC_BROWSEROMS 352
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue