This commit is contained in:
Nunuhara Cabbage
2020-05-23 12:41:55 -07:00
4 changed files with 24 additions and 5 deletions
+6 -1
View File
@@ -21,7 +21,6 @@
#include <dirent.h>
#include <ctype.h>
#include <signal.h>
#include <sys/wait.h>
#include <getopt.h>
#include "debugger.h"
#include "file.h"
@@ -206,10 +205,14 @@ static void config_init(void)
mkdir_p(new_save_dir);
}
#if (!defined(_WIN32) && !defined(__WIN32__))
#include <sys/wait.h>
void cleanup(possibly_unused int signal)
{
while (waitpid((pid_t)-1, 0, WNOHANG) > 0);
}
#endif
static void ain_audit(FILE *f, struct ain *ain)
{
@@ -320,7 +323,9 @@ int main(int argc, char *argv[])
ERROR("Not an AIN/INI file: %s", &argv[0][len - 4]);
}
#if (!defined(_WIN32) && !defined(__WIN32__))
signal(SIGCHLD, cleanup);
#endif
config_init();
+7
View File
@@ -156,6 +156,13 @@ nunuhara@haniwa.technology, or find me on /haniho/.
Version History
---------------
### [Version 0.3.0](https://haniwa.technology/alice-tools/alice-tools-0.3.0.zip)
* Now supports ain files up to version 14 (Evenicle 2, Haha Ranman)
* Improved ex file compatibility, now works with Rance 03, Rance IX and Evenicle 2
* aindump now emits macro instructions by default (makes bytecode easier to read)
* Most error messages now include line numbers
### [Version 0.2.1](https://haniwa.technology/alice-tools/alice-tools-0.2.1.zip)
* Added `--input-encoding` and `--output-encoding` options to control the text
+3 -3
View File
@@ -108,13 +108,13 @@ int main(int argc, char *argv[])
struct fnl *fnl = fnl_open(argv[0]);
for (size_t font = 0; font < fnl->nr_fonts; font++) {
NOTICE("FONT %zu", font);
NOTICE("FONT %u", (unsigned)font);
for (size_t face = 0; face < fnl->fonts[font].nr_faces; face++) {
struct fnl_font_face *font_face = &fnl->fonts[font].faces[face];
NOTICE("\tsize %lu (%lu glyphs)", font_face->height, font_face->nr_glyphs);
// create subdir
sprintf(path, "%s/font_%zu/face_%zu", output_dir, font, face);
sprintf(path, "%s/font_%u/face_%u", output_dir, (unsigned)font, (unsigned)face);
mkdir_p(path);
// extract glyphs
@@ -123,7 +123,7 @@ int main(int argc, char *argv[])
if (!glyph->data)
continue;
sprintf(path, "%s/font_%zu/face_%zu/glyph_%zu.webp", output_dir, font, face, g);
sprintf(path, "%s/font_%u/face_%u/glyph_%u.webp", output_dir, (unsigned)font, (unsigned)face, (unsigned)g);
FILE *f = fopen(path, "wb");
if (!f) {
ERROR("fopen failed: %s", strerror(errno));
+8 -1
View File
@@ -21,7 +21,6 @@
#include <math.h>
#include <time.h>
#include <errno.h>
#include <spawn.h>
#include <SDL.h> // for system.MsgBox
#include "debugger.h"
@@ -37,6 +36,10 @@
#include "vm/heap.h"
#include "vm/page.h"
#if (!defined(_WIN32) && !defined(__WIN32__))
#include <spawn.h>
#endif
extern char **environ;
static inline int32_t lint_clamp(int64_t n)
@@ -430,6 +433,9 @@ static void system_call(enum syscall_code code)
break;
}
case SYS_OPEN_WEB: {
#if (defined(_WIN32) || defined(__WIN32__))
WARNING("system.OpenWeb not implemented on Windows");
#else
struct string *url = stack_peek_string(0);
char *browser = getenv("BROWSER");
if (!browser || !*browser) {
@@ -442,6 +448,7 @@ static void system_call(enum syscall_code code)
if ((err = posix_spawnp(&child, browser, NULL, NULL, argv, environ))) {
WARNING("posix_spawn failed: %s", strerror(err));
}
#endif
heap_unref(stack_pop().i);
break;
};