aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2021-02-27 12:13:50 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2021-02-27 12:13:50 -0500
commit50d83a1ff55b7b06efa86ebd344e7b0f4808b980 (patch)
tree73e5ab45283d23f2f189fe88e2bb20f0207047c3 /src
parentd49887486c772592c0e8ecc158c1cc3efb3f7709 (diff)
downloadfake86-master.tar.gz
Quick and dirty fixups to make it buildableHEADmaster
Diffstat (limited to 'src')
-rwxr-xr-xsrc/fake86/console.c4
-rwxr-xr-xsrc/fake86/main.c8
-rwxr-xr-xsrc/fake86/timing.c3
-rwxr-xr-xsrc/fake86/video.c3
4 files changed, 12 insertions, 6 deletions
diff --git a/src/fake86/console.c b/src/fake86/console.c
index 03edebb..ab935d2 100755
--- a/src/fake86/console.c
+++ b/src/fake86/console.c
@@ -75,7 +75,9 @@ void waitforcmd (uint8_t *dst, uint16_t maxlen) {
SDL_Delay(10); //don't waste CPU time while in the polling loop
}
#else
- gets (dst);
+ char buf[255];
+
+ fgets (buf, dst, stdin);
#endif
}
diff --git a/src/fake86/main.c b/src/fake86/main.c
index 78b3c43..0cd550f 100755
--- a/src/fake86/main.c
+++ b/src/fake86/main.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
+#include <unistd.h>
#include "mutex.h"
#ifdef _WIN32
CRITICAL_SECTION screenmutex;
@@ -47,18 +48,18 @@ extern void reset86();
extern void exec86 (uint32_t execloops);
extern uint8_t initscreen (uint8_t *ver);
extern void VideoThread();
-extern doscrmodechange();
+extern int doscrmodechange();
extern void handleinput();
#ifdef CPU_ADDR_MODE_CACHE
extern uint64_t cached_access_count, uncached_access_count;
#endif
-extern uint8_t scrmodechange, doaudio;
+extern uint8_t verbose, scrmodechange, doaudio;
extern uint64_t totalexec, totalframes;
uint64_t starttick, endtick, lasttick;
-uint8_t *biosfile = NULL, verbose = 0, cgaonly = 0, useconsole = 0;
+uint8_t *biosfile = NULL, cgaonly = 0, useconsole = 0;
uint32_t speed = 0;
@@ -102,6 +103,7 @@ uint32_t loadbios (uint8_t *filename) {
binfile = fopen (filename, "rb");
if (binfile == NULL) {
+ fprintf(stderr, "Unable to load %s\n", filename);
return (0);
}
diff --git a/src/fake86/timing.c b/src/fake86/timing.c
index b3c4b23..010ebe0 100755
--- a/src/fake86/timing.c
+++ b/src/fake86/timing.c
@@ -41,8 +41,9 @@ extern void tickaudio();
extern void tickssource();
extern void tickadlib();
extern void tickBlaster();
+extern uint64_t lasttick;
-uint64_t hostfreq = 1000000, lasttick = 0, curtick = 0, tickgap, i8253tickgap, lasti8253tick, scanlinetiming, lastscanlinetick, curscanline = 0;
+uint64_t hostfreq = 1000000, curtick = 0, tickgap, i8253tickgap, lasti8253tick, scanlinetiming, lastscanlinetick, curscanline = 0;
uint64_t sampleticks, lastsampletick, ssourceticks, lastssourcetick, adlibticks, lastadlibtick, lastblastertick, gensamplerate;
uint16_t pit0counter = 65535;
diff --git a/src/fake86/video.c b/src/fake86/video.c
index 95c9c61..29cf0d1 100755
--- a/src/fake86/video.c
+++ b/src/fake86/video.c
@@ -43,7 +43,8 @@ extern uint8_t scrmodechange;
uint8_t VRAM[262144], vidmode, cgabg, blankattr, vidgfxmode, vidcolor;
uint16_t cursx, cursy, cols = 80, rows = 25, vgapage, cursorposition, cursorvisible;
-uint8_t updatedscreen, clocksafe, port3da, port6, portout16;
+extern uint8_t portout16;
+uint8_t updatedscreen, clocksafe, port3da, port6;
uint16_t VGA_SC[0x100], VGA_CRTC[0x100], VGA_ATTR[0x100], VGA_GC[0x100];
uint32_t videobase= 0xB8000, textbase = 0xB8000, x, y;
uint8_t fontcga[32768];