diff --git a/changelog.txt b/changelog.txt index 4a84cad0..6bbe1f31 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,5 @@ ---version 2.0.4 yet to be released--- +19-feb-2009 - adelikat - win32 - memory watch - fixed recent file menu - no longer crashes when attempting to load a non existent recent file 07-feb-2009 - adelikat - win32 - Fix bug in screenshot numbering that caused numbering to not reset when changing ROMs 06-feb-2009 - adelikat - win32 - Hex editor - remembers window size 06-feb-2009 - adelikat - Win32 - sound config dialog - added sliders for individual sound channel volume control diff --git a/src/drivers/win/memwatch.cpp b/src/drivers/win/memwatch.cpp index a1633b09..97fc2084 100644 --- a/src/drivers/win/memwatch.cpp +++ b/src/drivers/win/memwatch.cpp @@ -31,6 +31,15 @@ using namespace std; +//Memory Watch named constants----------------------------------- +const int NUMWATCHES = 24; //Maximum Number of Watches +const int LABELLENGTH = 64; //Maximum Length of a Watch label +const int ADDRESSLENGTH = 16; //Maximum Length of a Ram Address + +//Prototypes +void RamChangeReset(int x); //Called when user hits reset button +void CollapseWindow(void); //Called when user collapses or expands window + //Memory Watch GUI Handles & Globals--------------------------- HWND hwndMemWatch=0; //Handle to Memwatch Window static HDC hdc; //Handle to to Device Context @@ -38,12 +47,7 @@ static HMENU memwmenu = 0; //Handle to Memwatch Menu static HMENU memwrecentmenu;//Handle to Recent Files Menu int MemWatch_wndx=0, MemWatch_wndy=0; //Window Position - bool MemWCollapsed = false; //Flag to determine if window is currently collapsed -//Memory Watch globals----------------------------------------- -const int NUMWATCHES = 24; //Maximum Number of Watches -const int LABELLENGTH = 64; //Maximum Length of a Watch label -const int ADDRESSLENGTH = 16; //Maximum Length of a Ram Address static char addresses[NUMWATCHES][ADDRESSLENGTH]; //Stores all address labels static char labels[NUMWATCHES][LABELLENGTH]; //Stores all label lengths @@ -72,9 +76,6 @@ int editnow[MAX_RAMMONITOR]; //current address value unsigned int editcount[MAX_RAMMONITOR]; //Current counter value char editchangem[MAX_RAMMONITOR][5]; //counter converted to string -//Prototypes -void RamChangeReset(int x); //Called when user hits reset button -void CollapseWindow(void); //Called when user collapses or expands window //------------------------------------------------- void UpdateMemw_RMenu(HMENU menu, char **strs, unsigned int mitem, unsigned int baseid) @@ -577,55 +578,57 @@ static void LoadMemWatch() fileChanged = false; } -// Loads a recent file given the recent files array number(0-4) +//Loads a recent file given the recent files array number(0-4) void OpenMemwatchRecentFile(int memwRFileNumber) { - int rnum=memwRFileNumber; - if (rnum > MEMW_MAX_NUMBER_OF_RECENT_FILES) return; //just in case + if (memwRFileNumber > MEMW_MAX_NUMBER_OF_RECENT_FILES) return; //just in case - char* x = memw_recent_files[rnum]; + char* x = memw_recent_files[memwRFileNumber]; if (x == NULL) return; //If no recent files exist just return. Useful for Load last file on startup (or if something goes screwy) char watchfcontents[2048]; - FILE *fp=FCEUD_UTF8fopen(x,"r"); - strcpy(memwLastFilename,x); - - if (rnum != 0) //Change order of recent files if not most recent - MemwAddRecentFile(x); - - int i,j; - for(i=0;i