Commit Graph
14 Commits
Author SHA1 Message Date
kichikuou 7ef9719cc7 Use little_endian.h in libsys4 2024-05-19 10:59:50 +09:00
kichikuou c3e4cd5e9f Fix compilation error with clang 2024-04-15 15:27:29 +09:00
kichikuou 58366e199e File.Read/Write: Use the same format as AliceSoft's implementation
This improves interoperability of save files in Rance6, GALZOO, etc.
The old JSON format can still be loaded for backwards compatibility.
2024-04-14 09:23:23 +09:00
kichikuou 03f23c4339 Fix date/time getter functions
Values returned by SACT2.System_GetDate etc. should correspond to the
Windows SYSTEMTIME structure, not struct tm.

This also fixes a bug where get_time() returns a value greater than 60
for `sec`.
2022-05-08 14:20:45 +09:00
Nunuhara Cabbage 38df5ea1c1 Use display_sjis0/display_utf0 in messages
Ensure correct encoding for error/warning/log messages.
2022-04-06 19:33:33 -07:00
Nunuhara Cabbage ba0b97e163 Use UTF-8 file functions
Use functions which expect UTF-8 encoded file names (and convert them to
UTF-16 on Windows).

This should fix various issues on Windows when reading/writing files
with Japanese characters in their names.
2022-03-28 16:50:45 -07:00
kichikuou e047ae1c85 Do not call destructors on uninitialized structs in json_to_vm_value()
For structs / arrays, json_to_vm_value() calls json_load_page() on
freshly allocated pages for which no constructor has been called.
json_load_page() should not call destructors for such uninitialized
pages.

json_load_page() is also called by BanMisc.LoadStruct and File.Read,
with an initialized struct. In that case destructors should be called.

This fixes crash in Widenyo after system.GroupLoad.
2022-03-25 12:06:00 +09:00
kichikuou fc41239175 Remove include/file.h
It was an outdated duplicate of system4/file.h.
2022-03-21 21:23:20 +09:00
Nunuhara Cabbage d69bc33449 Don't create stubs for unimplemented HLL functions
hll_call() prints the same message as the old stub functions if no
implementation is provided. This makes the --audit option more accurate.
2020-08-26 17:30:22 -07:00
Nunuhara Cabbage 3ee8fff8ae Implement File.Delete 2020-08-25 19:39:49 -07:00
Nunuhara Cabbage 815dc7da92 Return correct year in File.GetTime
localtime returns year relative to 1900.
2020-08-25 17:47:59 -07:00
Nunuhara Cabbage 58da6dc167 Refactor system4.h
Move xsystem4-specific declarations to xsystem4.h.
2020-07-12 09:17:52 -07:00
Nunuhara Cabbage 6a4d11f3de Use libffi for library calls
Use libffi to portably call arbitrary functions at runtime, rather than
forcing library functions to use a standard prototype.
2020-01-07 22:48:29 -08:00
Nunuhara Cabbage 5d6f148e1b Reorganize project file structure
- Create separate directories for source and header files.
- Build code shared between xsystem4 and aindump as a static library.
- Create header dirs gfx/ system4/ and vm/
- Make CG.c/h usable without a running VM
2019-12-31 17:50:40 -08:00