mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:27:45 +00:00
Ports: Add emu2 DOS emulator
This commit is contained in:
parent
6ac7d946be
commit
d65e74bffa
7 changed files with 80 additions and 0 deletions
9
Ports/emu2/patches/codepage.patch
Normal file
9
Ports/emu2/patches/codepage.patch
Normal file
|
@ -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
|
27
Ports/emu2/patches/dosnames.patch
Normal file
27
Ports/emu2/patches/dosnames.patch
Normal file
|
@ -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;
|
10
Ports/emu2/patches/keyb.patch
Normal file
10
Ports/emu2/patches/keyb.patch
Normal file
|
@ -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));
|
14
Ports/emu2/patches/main.patch
Normal file
14
Ports/emu2/patches/main.patch
Normal file
|
@ -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)
|
||||
{
|
10
Ports/emu2/patches/video.patch
Normal file
10
Ports/emu2/patches/video.patch
Normal file
|
@ -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));
|
Loading…
Add table
Add a link
Reference in a new issue