From 97ad1c07e7bb3d811b33cddc02b84bbd4e107092 Mon Sep 17 00:00:00 2001 From: Alan Steremberg Date: Wed, 28 Jul 2021 19:29:32 -0400 Subject: [PATCH] Fixed tape writing SharpMZ - goes to correct directory now (#433) --- support/sharpmz/sharpmz.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/support/sharpmz/sharpmz.cpp b/support/sharpmz/sharpmz.cpp index ed4aca9..9b6b615 100644 --- a/support/sharpmz/sharpmz.cpp +++ b/support/sharpmz/sharpmz.cpp @@ -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);