Merge upstream changes: Merge FILEIO changes

FILEIO has been updated to resolve relative paths inside FILEIO::Fopen(),
which has been already done in System3-sdl2.

FILEIO::Fgets() now uses a length param.

Callsites for these functions are also updated to reduce the diff from
upstream.
This commit is contained in:
kichikuou
2020-05-22 12:04:36 +09:00
parent 131707f9d8
commit e8d254328a
11 changed files with 73 additions and 71 deletions
+6 -8
View File
@@ -944,12 +944,11 @@ void NACT_Sys2::cmd_l()
if(1 <= index && index <= 26) {
// ASLEEP_A.DAT - ASLEEP_Z.DAT
char path[_MAX_PATH];
strcpy_s(path, _MAX_PATH, "ASLEEP_A.DAT");
path[7] = 'A' + index - 1;
char file_name[_MAX_PATH];
sprintf_s(file_name, _MAX_PATH, "ASLEEP_%c.DAT", 'A' + index - 1);
FILEIO* fio = new FILEIO();
if(fio->Fopen(path, FILEIO_READ_BINARY)) {
if(fio->Fopen(file_name, FILEIO_READ_BINARY)) {
fio->Fseek(112, FILEIO_SEEK_SET);
int next_page = fio->Fgetw() - 1;
@@ -1120,12 +1119,11 @@ void NACT_Sys2::cmd_q()
if(1 <= index && index <= 26) {
// ASLEEP_A.DAT - ASLEEP_Z.DAT
char path[_MAX_PATH];
strcpy_s(path, _MAX_PATH, "ASLEEP_A.DAT");
path[7] = 'A' + index - 1;
char file_name[_MAX_PATH];
sprintf_s(file_name, _MAX_PATH, "ASLEEP_%c.DAT", 'A' + index - 1);
FILEIO* fio = new FILEIO();
if(fio->Fopen(path, FILEIO_WRITE_BINARY)) {
if(fio->Fopen(file_name, FILEIO_WRITE_BINARY)) {
uint8 buffer[9510];
int p = 0;