Commit Graph
22 Commits
Author SHA1 Message Date
kichikuou d2ac3889b5 QE/LE: Handle for paths with subdirectories correctly
This resolves issues where saving to and loading from paths with
subdirectories (e.g., "Save\file.asd") would fail.

The original problems were:
 1. Writing failure: A path mismatch between directory creation in
    commandQE and file writing in fc_open.
 2. Loading failure: fc_search could not handle paths containing
    directory separators, preventing saved files in subdirectories from
    being found.

This commit addresses these issues with the following changes:
 - fc_open now automatically creates parent directories when writing a
   file.
 - fc_search is updated to support two modes:
     - It performs a case-insensitive search for simple filenames
       (preserving original behavior).
     - It performs a case-sensitive existence check for full paths.

Fixes #74.
2026-01-09 08:31:40 +09:00
kichikuou f1536a801a QE/LE: Handle backslashes in filenames
Rance 5D uses filename `Save\\Rance5dSystem.asd`. This caused issues:

- On Windows, saving would fail if the `Save` directory did not exist.
- On other platforms, files were created with literal backslashes in
  their names.

This change addresses these problems by:

- In commandQE, normalizing backslashes to forward slashes in the path
  and ensuring that the target directory exists by calling mkdir_p().
- In commandLE, first attempting to load files with normalized forward
  slashes. If that fails, it retries with the original path (containing
  backslashes) for compatibility with older saves.
2025-11-06 11:05:23 +09:00
kichikuou 343f3bb7c5 Fix fileCheckExist
This fixes https://github.com/kichikuou/xsystem35-sdl2/issues/55.
2024-06-10 08:59:58 +09:00
kichikuou 2b6267aeb9 Create save directory if it doesn't exist 2024-04-10 14:37:21 +09:00
kichikuou f0bd336da1 Implement MsgSkip module
The format of savefile (msgskip.asd) is compatible with AliceSoft's
MsgSkip.dll; a 4-byte size field followed by a bitmap indexed by message
ID.
2020-12-22 16:35:37 +09:00
kichikuou 5456ac4219 Remove unused ERROR constant 2020-08-02 13:46:44 +09:00
kichikuou 9053583517 Do UTF-8 conversion for filenames in cmd*.c 2020-07-25 17:09:08 +09:00
kichikuou 9f244c3dee Fix filecheck.c issues
- Use _wfopen on Windows, to avoid garbled filenames.
- The -savekanji option is removed. Now character encoding of file paths
  is assumed to be UTF-8 on non-windows.
- On all platforms, data files are also searched for in current
  directory.
2020-07-25 13:17:03 +09:00
kichikuou bdfe0e8077 Remove sjis2lang and lang2sjis macros
There's no plan to use any other "native" character encodings than
UTF-8.
2020-07-23 13:53:08 +09:00
kichikuou 1a3b779ace Use const strings for file names 2020-07-12 13:41:57 +09:00
kichikuou 8958b41ad2 Windows MSYS2 build support
- Add feature detection and fallback implementation for some functions
- Use binary mode for fopen()
- CMake: Add workaround for MSYS link error
2019-10-14 17:32:17 +09:00
kichikuou 4602b1ebfc Fix compiler warnings 2019-09-15 18:42:16 +09:00
kichikuou 4bc3512a20 emscripten: do not backup old savedata 2019-02-02 17:04:43 +09:00
kichikuou eb51b35732 emscripten: search data files from current directory too 2019-02-02 12:50:39 +09:00
kichikuou 349b448416 Let fc_search return fullpath 2019-02-02 12:34:15 +09:00
kichikuou 593888d760 Remove filename table 2019-02-02 12:28:14 +09:00
kichikuou 845434e3db Move some functions from savedata.c to filecheck.c 2019-02-02 11:24:30 +09:00
kichikuou 3e3e78d814 Finish EUC -> UTF8 switch 2017-02-11 19:55:46 +09:00
kichikuou e2fdaebb74 Rename eucsjis to utfsjis 2017-02-11 19:43:01 +09:00
kichikuou ff68f6fa70 Replace sjis2euc, euc2sjis to sjis2utf, utf2sjis 2017-02-11 19:28:46 +09:00
kichikuou f1b0b399fa Convert EUC to utf-8 2017-02-11 19:03:05 +09:00
kichikuou e607c9c2ee Import xsystem35-1.7.3-pre5 2014-04-26 18:40:24 +09:00