[ scummvm-Patches-818230 ] Simple 8.3 Scumm Save Filename Truncation.
SourceForge.net
noreply at sourceforge.net
Sun Oct 5 20:51:29 CEST 2003
Patches item #818230, was opened at 2003-10-05 18:51
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=818230&group_id=37116
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: John Willis (djwillis)
Assigned to: Nobody/Anonymous (nobody)
Summary: Simple 8.3 Scumm Save Filename Truncation.
Initial Comment:
This is a quick patch that alters
ScummEngine::makeSavegameName
in /scumm/saveload.cpp
to support 8.3 filenames if SHORT_SAVENAMES is
defined.
Currently the only CVS platform that requires 8.3 save
files is the GP32 and this patch is intended for that.
However any other ports that require 8.3 filenames
(RiscOS maybe) should be able to use this code. I have
not done patches for any of the other game engines as
there save files are (to the best of my knowledge) 8.3
compliant.
If required for other engines in the future the same
define could be used to ensure consistent support at
compile time.
I checked the patch against 0.5.1 release code and
03/10/03 CVS (and changed slightly) for reference.
The #Define SHORT_SAVENAMES will also need to be
added to the backends/gp32/build.rules however there
are other issues with the current GP32 CVS code that
prevent compiling currently anyway.
<code snippet>
void ScummEngine::makeSavegameName(char *out, int
slot, bool compatible) {
#ifdef SHORT_SAVENAMES //DJWillis - Hack to ensure
filenames are not over 8:3 for the GP32's SMC
filesystem, could also be used by other ports.
_game_name[8] = '\0'; // Truncate char with NULL
value to break it at 8.
#else
sprintf(out, "%s.%c%.2d", _game_name,
compatible ? 'c' : 's', slot);
#endif
}
</code snippet>
This is a quick patch that alters
ScummEngine::makeSavegameName
in /scumm/saveload.cpp
to support 8.3 filenames if SHORT_SAVENAMES is
defined.
Currently the only CVS platform that requires 8.3 save
files is the GP32 and this patch is intended for that.
However any other ports that require 8.3 filenames
(RiscOS maybe) should be able to use this code. I have
not done patches for any of the other game engines as
there save files are (to the best of my knowledge) 8.3
compliant.
If required for other engines in the future the same
define could be used to ensure consistent support at
compile time.
I checked the patch against 0.5.1 release code and
03/10/03 CVS (and changed slightly) for reference.
The #Define SHORT_SAVENAMES will also need to be
added to the backends/gp32/build.rules however there
are other issues with the current GP32 CVS code that
prevent compiling currently anyway.
<code snippet>
void ScummEngine::makeSavegameName(char *out, int
slot, bool compatible) {
#ifdef SHORT_SAVENAMES //DJWillis - Hack to ensure
filenames are not over 8:3 for the GP32's SMC
filesystem, could also be used by other ports.
_game_name[8] = '\0'; // Truncate char with NULL
value to break it at 8.
#else
sprintf(out, "%s.%c%.2d", _game_name,
compatible ? 'c' : 's', slot);
#endif
}
</code snippet>
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=818230&group_id=37116
More information about the Scummvm-tracker
mailing list