MCPcopy Create free account
hub / github.com/TASEmulators/fceux / GetSavePath

Function GetSavePath

src/drivers/win/replay.cpp:100–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100static char* GetSavePath(HWND hwndDlg)
101{
102 char* fn=0;
103 char szDrive[MAX_PATH]={0};
104 char szDirectory[MAX_PATH]={0};
105 char szFilename[MAX_PATH]={0};
106 char szExt[MAX_PATH]={0};
107 LONG lIndex = SendDlgItemMessage(hwndDlg, IDC_COMBO_RECORDFROM, CB_GETCURSEL, 0, 0);
108 LONG lStringLength = SendDlgItemMessage(hwndDlg, IDC_COMBO_RECORDFROM, CB_GETLBTEXTLEN, (WPARAM)lIndex, 0);
109
110 fn = (char*)malloc(lStringLength+1); //CB_GETLBTEXTLEN doesn't include NULL terminator.
111 SendDlgItemMessage(hwndDlg, IDC_COMBO_RECORDFROM, CB_GETLBTEXT, (WPARAM)lIndex, (LPARAM)fn);
112
113 _splitpath(fn, szDrive, szDirectory, szFilename, szExt);
114 if(szDrive[0]=='\0' && szDirectory[0]=='\0')
115 {
116 char* newfn=strdup(FCEU_MakePath(FCEUMKF_STATE, fn).c_str()); // need to make a full path
117 free(fn);
118 fn=newfn;
119 }
120
121 return fn;
122}
123
124void UpdateReplayCommentsSubs(const char * fname) {
125

Callers 1

RecordDialogProcFunction · 0.85

Calls 1

FCEU_MakePathFunction · 0.85

Tested by

no test coverage detected