Rework string variables

- 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.
This commit is contained in:
kichikuou
2020-06-20 22:29:22 +09:00
parent a23ce19433
commit 86470e543a
5 changed files with 177 additions and 50 deletions
+7 -3
View File
@@ -60,9 +60,13 @@ extern int v_getArrayBufferCnt(int page);
extern boolean v_getArrayBufferStatus(int page);
extern void v_initStringVars(int ,int );
extern boolean v_initVars();
extern char *v_strcpy(int no, const char *str);
extern char *v_strcat(int no, const char *str);
extern void v_strcpy(int no, const char *str);
extern void v_strncpy(int dstno, int dstpos, int srcno, int srcpos, int len);
extern void v_strcat(int no, const char *str);
extern size_t v_strlen(int no);
extern char *v_str(int no);
extern int v_strstr(int no, int start, const char *str);
extern void v_strFromVars(int no, const int *vars);
extern int v_strToVars(int no, int *vars);
extern const char *v_str(int no);
#endif /* !__VARIABLE__ */