From 7b3b667c0812351b4757ab752b43aad6000c4f4c Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 15 Nov 2008 02:57:13 +0000 Subject: [PATCH] Win32 - Hex Editor - uses ROm name for Dump Rom/PPU to file --- changelog.txt | 1 + src/drivers/win/main.cpp | 2 ++ src/drivers/win/memview.cpp | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index ff2f4edd..370f9dbe 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,5 @@ ---version 2.0.4 yet to be released--- +14-nov-2008 - adelikat - win32 Hex Editor - Dump Rom & Dump PPU to file Dialog - uses ROM to build default filename 14-nov-2008 - adelikat - Win32 Memwatch - Save as dialog - uses ROM name to build default memwatch filename if there is no last used memwatch filename 14-nov-2008 - adelikat - Win32 Text Hooker fixes - Init error checking reinstated, save .tht file no longer crashes, Dialog updates as ROM plays, Remembers window position, fix bug where canceling save as produces an error message, Save As produces default filename based on loaded ROM 14-nov-2008 - adelikat - fixed but when aspect correction and special scaling 3x are set, video was getting resized incorrectly diff --git a/src/drivers/win/main.cpp b/src/drivers/win/main.cpp index 0d19dbac..8deac140 100644 --- a/src/drivers/win/main.cpp +++ b/src/drivers/win/main.cpp @@ -895,6 +895,8 @@ char *GetRomName() splitpath(LoadedRomFName,drv,dir,name,ext); //Extract components of the ROM path Rom = name; //Pull out the Name only } + else + Rom = ""; char*mystring = (char*)malloc(2048*sizeof(char)); strcpy(mystring, Rom.c_str()); //Convert string to char* diff --git a/src/drivers/win/memview.cpp b/src/drivers/win/memview.cpp index 565a5fb6..46a4450a 100644 --- a/src/drivers/win/memview.cpp +++ b/src/drivers/win/memview.cpp @@ -33,6 +33,7 @@ #include "memviewsp.h" #include "cheat.h" #include +#include "main.h" //#include "string.h" #define MODE_NES_MEMORY 0 @@ -541,7 +542,7 @@ int DeleteCheatCallB(char *name, uint32 a, uint8 v, int compare,int s,int type, void dumpToFile(const char* buffer, unsigned int size) { - char name[257] = {0}; + char name[513] = {0}; OPENFILENAME ofn; memset(&ofn, 0, sizeof(ofn)); @@ -549,6 +550,7 @@ void dumpToFile(const char* buffer, unsigned int size) ofn.hInstance=fceu_hInstance; ofn.lpstrTitle="Save to file ..."; ofn.lpstrFilter="All files (*.*)\0*.*\0"; + strcpy(name,GetRomName()); ofn.lpstrFile=name; ofn.nMaxFile=256; ofn.Flags=OFN_EXPLORER|OFN_HIDEREADONLY;