The length limit of string variables was removed a long time ago, but it
was recorded in save files.
Now the first argument of MZ0 is completely ignored (as in System3.9).
The maxlen field in the save file is set to a constant so that older
versions of xsystem35 can load it.
Surprisingly, 0 is a valid index of the string variables (used only in
Ouji-sama Lv1 as far as I know).
The original System 3.x saves str[0] in save files, but we continue to
save from str[1] for save data compatibility.
- nact.h and xsystem35.h no longer include scenario.h
- Removed `sys_*` aliases in nact.h
- sys_getString() and sys_getConstString() are moved to
scenario.c as sl_getString() and sl_getConstString()
- DEBUG_COMMAND macros are now defined in scenario.h
This replaces v_str* functions with new svar_* functions.
The new svar_* functions use 1-based string variable index, so that
callers don't have to decrement string numbers from SCO.
This adds "Unicode mode", in which scenarios can be written in any
language. xsys35c 1.2.0 and later can produce Unicode scenarios.
- nact->encoding represents the current scenario encoding. The initial
value is SJIS, and ZU command changes it to UTF8.
- Use conversion macros that switch the behavior by the scenario
encoding. For example, toUTF8() calls sjis2utf() if the scenario
encoding is SJIS, and calls strdup() if it is UTF8.
- Fix various string processing functions to work with UTF8.
The second argument of DC command specifies the maximum index of the new
array. That means, `DC _,n,_:` allocates an array of size n+1 (a[0] to
a[n]).
This patch makes sure various D commands work with a[n], and a[n] is
correctly saved and loaded.
Now loadSysVar() does not shrink array variables using the data count in
the save file, so that files saved by old xsystem35 binary can be safely
loaded. This also matches the behavior of System3.9.
- strVar is now allocated as a vector of indefinite length buffers
rather than a single contiguous buffer.
- Strings can be any length, but truncated to (strvar_len * 2) bytes
when saved to a file, for backward compatibility.
- Now string commands treat 1-byte characters in the same way as System
3.9. This potentially fixes bugs in English translated games.