Fixed tape writing SharpMZ - goes to correct directory now (#433)

This commit is contained in:
Alan Steremberg
2021-07-28 19:29:32 -04:00
committed by GitHub
parent 5e7ce73360
commit 97ad1c07e7

View File

@@ -65,9 +65,15 @@ static unsigned char debugEnabled = 0;
int sharpmz_file_write(fileTYPE *file, const char *fileName)
{
int ret;
char directoryPath[1024];
char fullPath[1024];
sprintf(fullPath, "%s/%s/%s", getRootDir(), SHARPMZ_CORE_NAME, fileName);
strcpy(directoryPath,SHARPMZ_CORE_NAME);
findPrefixDir(directoryPath, sizeof(directoryPath));
sprintf(fullPath, "%s/%s", directoryPath, fileName);
const int mode = O_RDWR | O_CREAT | O_TRUNC | O_SYNC; // No longer required as FileOpenEx has changed. | S_IRWXU | S_IRWXG | S_IRWXO;
ret = FileOpenEx(file, fullPath, mode);