mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-13 01:38:19 +03:00
Implement system.CopySaveFile
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "system4.h"
|
||||
#include "system4/ain.h"
|
||||
#include "system4/instructions.h"
|
||||
#include "system4/file.h"
|
||||
#include "system4/string.h"
|
||||
#include "system4/utfsjis.h"
|
||||
|
||||
@@ -588,6 +589,18 @@ static void system_call(enum syscall_code code)
|
||||
heap_unref(funcname);
|
||||
break;
|
||||
}
|
||||
case SYS_COPY_SAVE_FILE: { // system.CopySaveFile(string szDestFileName, string szSourceFileName)
|
||||
int src = stack_pop().i;
|
||||
int dst = stack_pop().i;
|
||||
char *u_src = savedir_path(heap[src].s->text);
|
||||
char *u_dst = savedir_path(heap[dst].s->text);
|
||||
stack_push(file_copy(u_src, u_dst));
|
||||
free(u_src);
|
||||
free(u_dst);
|
||||
heap_unref(src);
|
||||
heap_unref(dst);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
VM_ERROR("Unimplemented syscall: 0x%X", code);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user