summaryrefslogtreecommitdiff
path: root/Ports/emu2/patches
diff options
context:
space:
mode:
authorBrendan Coles <bcoles@gmail.com>2021-04-14 17:24:58 +0000
committerAndreas Kling <kling@serenityos.org>2021-04-14 21:48:55 +0200
commitd65e74bffa169310fc25ff36a1ca2e2dc3bf693c (patch)
treeba5cd24bed95c60eef0c754891fd4132465e06f0 /Ports/emu2/patches
parent6ac7d946be8e0d3dbe0a7238a8462c4634e042d8 (diff)
downloadserenity-d65e74bffa169310fc25ff36a1ca2e2dc3bf693c.zip
Ports: Add emu2 DOS emulator
Diffstat (limited to 'Ports/emu2/patches')
-rw-r--r--Ports/emu2/patches/codepage.patch9
-rw-r--r--Ports/emu2/patches/dosnames.patch27
-rw-r--r--Ports/emu2/patches/keyb.patch10
-rw-r--r--Ports/emu2/patches/main.patch14
-rw-r--r--Ports/emu2/patches/video.patch10
5 files changed, 70 insertions, 0 deletions
diff --git a/Ports/emu2/patches/codepage.patch b/Ports/emu2/patches/codepage.patch
new file mode 100644
index 0000000000..daba393bb1
--- /dev/null
+++ b/Ports/emu2/patches/codepage.patch
@@ -0,0 +1,9 @@
++++ emu2-master/src/codepage.c 2021-04-14 07:13:48.165698165 -0700
+@@ -3,6 +3,7 @@
+ #include "env.h"
+ #include <stdlib.h>
+ #include <string.h>
++#include <strings.h>
+
+ /* List of code-pages */
+ struct cp_data
diff --git a/Ports/emu2/patches/dosnames.patch b/Ports/emu2/patches/dosnames.patch
new file mode 100644
index 0000000000..bec40c66df
--- /dev/null
+++ b/Ports/emu2/patches/dosnames.patch
@@ -0,0 +1,27 @@
++++ emu2-master/src/dosnames.c 2021-04-14 07:15:44.036839086 -0700
+@@ -9,6 +9,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <strings.h>
+ #include <sys/stat.h>
+
+ // DOS directory entries.
+@@ -179,7 +180,7 @@
+ struct dirent **dir;
+ struct dos_file_list *ret;
+
+- int n = scandir(path, &dir, 0, dos_unix_sort);
++ int n = 0; //scandir(path, &dir, 0, dos_unix_sort);
+ if(n <= 0)
+ return 0;
+
+@@ -589,7 +590,7 @@
+ static struct dos_file_list *find_first_file(char *fspec)
+ {
+ // Now, separate the path to the spec
+- char *glob, *unixpath, *p = rindex(fspec, '/');
++ char *glob, *unixpath, *p = strrchr(fspec, '/');
+ if(!p)
+ {
+ glob = fspec;
diff --git a/Ports/emu2/patches/keyb.patch b/Ports/emu2/patches/keyb.patch
new file mode 100644
index 0000000000..5ab794b2cf
--- /dev/null
+++ b/Ports/emu2/patches/keyb.patch
@@ -0,0 +1,10 @@
++++ emu2-master/src/keyb.c 2021-04-14 09:28:52.597237515 -0700
+@@ -385,7 +385,7 @@
+ {
+ if(tty_fd < 0)
+ {
+- tty_fd = open("/dev/tty", O_NOCTTY | O_RDONLY);
++ tty_fd = open(ttyname(0), O_NOCTTY | O_RDONLY);
+ if(tty_fd < 0)
+ {
+ print_error("error at open TTY, %s\n", strerror(errno));
diff --git a/Ports/emu2/patches/main.patch b/Ports/emu2/patches/main.patch
new file mode 100644
index 0000000000..9a82281cb2
--- /dev/null
+++ b/Ports/emu2/patches/main.patch
@@ -0,0 +1,14 @@
++++ emu2-master/src/main.c 2021-04-14 07:16:54.192314882 -0700
+@@ -304,12 +304,6 @@
+ signal(SIGQUIT, exit_handler);
+ signal(SIGPIPE, exit_handler);
+ signal(SIGTERM, exit_handler);
+- struct itimerval itv;
+- itv.it_interval.tv_sec = 0;
+- itv.it_interval.tv_usec = 54925;
+- itv.it_value.tv_sec = 0;
+- itv.it_value.tv_usec = 54925;
+- setitimer(ITIMER_REAL, &itv, 0);
+ init_bios_mem();
+ while(1)
+ {
diff --git a/Ports/emu2/patches/video.patch b/Ports/emu2/patches/video.patch
new file mode 100644
index 0000000000..95bfe39852
--- /dev/null
+++ b/Ports/emu2/patches/video.patch
@@ -0,0 +1,10 @@
++++ emu2-master/src/video.c 2021-04-14 09:29:03.273155128 -0700
+@@ -154,7 +154,7 @@
+ static void init_video(void)
+ {
+ debug(debug_video, "starting video emulation.\n");
+- int tty_fd = open("/dev/tty", O_NOCTTY | O_WRONLY);
++ int tty_fd = open(ttyname(0), O_NOCTTY | O_WRONLY);
+ if(tty_fd < 0)
+ {
+ print_error("error at open TTY, %s\n", strerror(errno));