Added basic default extensions to a few save dialogs that were missing them. Addresses bug 2996917.

This commit is contained in:
ugetab 2010-05-05 05:55:00 +00:00
parent cbfd453bcd
commit 40eff5685b
3 changed files with 13 additions and 3 deletions

View File

@ -246,6 +246,7 @@ void SaveCDLogFileAs(){
ofn.lpstrTitle="Save Code Data Log File As...";
ofn.lpstrFilter=filter;
strcpy(nameo,GetRomName());
strcat(nameo,".cdl");
ofn.lpstrFile=nameo;
ofn.nMaxFile=256;
ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY;
@ -333,6 +334,12 @@ void SaveStrippedRom(){ //this is based off of iNesSave()
ofn.lpstrFilter=NESfilter;
}
strcpy(sromfilename,GetRomName());
if (GameInfo->type==GIT_NSF) {
strcat(sromfilename,"_cdl.nsf");
}
else {
strcat(sromfilename,"_cdl.nes");
}
ofn.lpstrFile=sromfilename;
ofn.nMaxFile=256;
ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY;

View File

@ -295,6 +295,7 @@ void SaveRomAs()
ofn.lpstrTitle="Save Nes ROM as...";
ofn.lpstrFilter=filter;
strcpy(nameo,GetRomName());
strcat(nameo,"_save.nes");
ofn.lpstrFile=nameo;
ofn.nMaxFile=256;
ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY;
@ -632,7 +633,7 @@ int DeleteCheatCallB(char *name, uint32 a, uint8 v, int compare,int s,int type,
// ################################## Start of SP CODE ###########################
void dumpToFile(const char* buffer, unsigned int size)
void dumpToFile(const char* buffer, unsigned int size, char *nameappend)
{
char name[513] = {0};
@ -643,6 +644,7 @@ void dumpToFile(const char* buffer, unsigned int size)
ofn.lpstrTitle="Save to file ...";
ofn.lpstrFilter="All files (*.*)\0*.*\0";
strcpy(name,GetRomName());
strcat(name,nameappend);
ofn.lpstrFile=name;
ofn.nMaxFile=256;
ofn.Flags=OFN_EXPLORER|OFN_HIDEREADONLY;
@ -1484,7 +1486,7 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
unsigned int i;
for (i=0;i<sizeof(bar);i++) bar[i] = GetMem(i);
dumpToFile(bar, sizeof(bar));
dumpToFile(bar, sizeof(bar),"_ram.bin");
return 0;
}
case MENU_MV_FILE_DUMP_PPU:
@ -1499,7 +1501,7 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
else if(i < 0x3F00) bar[i] = vnapage[(i>>10)&0x3][i&0x3FF];
else bar[i] = PALRAM[i&0x1F];
}
dumpToFile(bar, sizeof(bar));
dumpToFile(bar, sizeof(bar),"_ppu.bin");
return 0;
}
// ################################## End of SP CODE ###########################

View File

@ -592,6 +592,7 @@ void ShowLogDirDialog(void){
ofn.lpstrTitle="Log Trace As...";
ofn.lpstrFilter=filter;
strcpy(nameo,GetRomName());
strcat(nameo,"_log.txt");
ofn.lpstrFile=nameo;
ofn.nMaxFile=256;
ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY;