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.
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.
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.