diff --git a/src/86box.h b/src/86box.h index 42b516047..1b926a40b 100644 --- a/src/86box.h +++ b/src/86box.h @@ -8,7 +8,7 @@ * * Main emulator include file. * - * Version: @(#)86box.h 1.0.3 2017/10/09 + * Version: @(#)86box.h 1.0.4 2017/10/16 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -20,6 +20,11 @@ # define EMU_86BOX_H +/* Configuration values. */ +#define SERIAL_MAX 2 +#define PARALLEL_MAX 1 + + #if defined(ENABLE_BUSLOGIC_LOG) || \ defined(ENABLE_CDROM_LOG) || \ defined(ENABLE_D86F_LOG) || \ @@ -45,4 +50,58 @@ #define SCREENSHOT_PATH L"screenshots" +/* Global variables. */ +#ifdef ENABLE_LOG_TOGGLES +extern int buslogic_do_log; +extern int cdrom_do_log; +extern int d86f_do_log; +extern int fdc_do_log; +extern int ide_do_log; +extern int serial_do_log; +extern int nic_do_log; +#endif + +extern int suppress_overscan; +extern int invert_display; +extern int scale; +extern int vid_api; +extern int vid_resize; +extern int winsizex,winsizey; + +extern wchar_t exe_path[1024]; +extern wchar_t cfg_path[1024]; + +extern uint64_t timer_freq; /* plat.h */ +extern int infocus; /* plat.h */ + +extern int dump_on_exit; +extern int start_in_fullscreen; +extern int window_w, window_h, window_x, window_y, window_remember; + + +/* Function prototypes. */ +#ifdef __cplusplus +extern "C" { +#endif + +extern void pclog(const char *format, ...); +extern void fatal(const char *format, ...); +extern int pc_init_modules(void); +extern int pc_init(int argc, wchar_t *argv[]); +extern void pc_close(void); +extern void pc_reset_hard_close(void); +extern void pc_reset_hard_init(void); +extern void pc_reset_hard(void); +extern void pc_reset(int hard); +extern void pc_full_speed(void); +extern void pc_speed_changed(void); +extern void pc_send_cad(void); +extern void pc_send_cae(void); +extern void pc_run(void); + +#ifdef __cplusplus +} +#endif + + #endif /*EMU_86BOX_H*/ diff --git a/src/bugger.c b/src/bugger.c index 75d5c983c..5d6f77ce0 100644 --- a/src/bugger.c +++ b/src/bugger.c @@ -44,7 +44,7 @@ * configuration register (CTRL_SPCFG bit set) but have to * remember that stuff first... * - * Version: @(#)bugger.c 1.0.7 2017/10/09 + * Version: @(#)bugger.c 1.0.8 2017/10/16 * * Author: Fred N. van Kempen, * Copyright 1989-2017 Fred N. van Kempen. @@ -53,6 +53,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "ui.h" diff --git a/src/cdrom/cdrom_dosbox.cpp b/src/cdrom/cdrom_dosbox.cpp index a8b1ef389..0ccf4973a 100644 --- a/src/cdrom/cdrom_dosbox.cpp +++ b/src/cdrom/cdrom_dosbox.cpp @@ -100,6 +100,7 @@ void CDROM_Interface_Image::InitNewMedia() bool CDROM_Interface_Image::SetDevice(char* path, int forceCD) { + (void)forceCD; if (LoadCueSheet(path)) return true; if (LoadIsoFile(path)) return true; @@ -174,6 +175,7 @@ bool CDROM_Interface_Image::ReadSectors(PhysPt buffer, bool raw, unsigned long s bool CDROM_Interface_Image::LoadUnloadMedia(bool unload) { + (void)unload; return true; } diff --git a/src/cdrom/cdrom_image.cc b/src/cdrom/cdrom_image.cc index 6a22a9414..c9dc4670c 100644 --- a/src/cdrom/cdrom_image.cc +++ b/src/cdrom/cdrom_image.cc @@ -57,6 +57,8 @@ void cdrom_image_log(const char *format, ...) va_end(ap); fflush(stdout); } +#else + (void)format; #endif } @@ -211,7 +213,7 @@ static int image_ready(uint8_t id) return 1; } -static int image_get_last_block(uint8_t id, uint8_t starttrack, int msf, int maxlen, int single) +static int image_get_last_block(uint8_t id, UNUSED(uint8_t starttrack), UNUSED(int msf), UNUSED(int maxlen), UNUSED(int single)) { int c; uint32_t lb=0; @@ -321,12 +323,12 @@ static uint8_t image_getcurrentsubchannel(uint8_t id, uint8_t *b, int msf) return ret; } -static void image_eject(uint8_t id) +static void image_eject(UNUSED(uint8_t id)) { return; } -static void image_load(uint8_t id) +static void image_load(UNUSED(uint8_t id)) { return; } @@ -965,7 +967,7 @@ static int image_status(uint8_t id) return CD_STATUS_DATA_ONLY; } -void image_reset(uint8_t id) +void image_reset(UNUSED(uint8_t id)) { return; } @@ -998,7 +1000,7 @@ int image_open(uint8_t id, wchar_t *fn) swprintf(cdrom_image[id].image_path, sizeof(cdrom_image[id].image_path)/sizeof(wchar_t), L"%ls", fn); } - if (! wcscasecmp(get_extension_w(fn), L"ISO")) + if (! wcscasecmp(plat_get_extension(fn), L"ISO")) { cdrom_image[id].image_is_iso = 1; } diff --git a/src/cdrom/cdrom_null.c b/src/cdrom/cdrom_null.c index 28d383100..f0d6c19ea 100644 --- a/src/cdrom/cdrom_null.c +++ b/src/cdrom/cdrom_null.c @@ -9,7 +9,7 @@ * Implementation of the CD-ROM null interface for unmounted * guest CD-ROM drives. * - * Version: @(#)cdrom_null.c 1.0.4 2017/10/09 + * Version: @(#)cdrom_null.c 1.0.5 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "cdrom.h" diff --git a/src/config.c b/src/config.c index 3ba7b842e..6476c7efd 100644 --- a/src/config.c +++ b/src/config.c @@ -8,7 +8,7 @@ * * Configuration file handler. * - * Version: @(#)config.c 1.0.21 2017/10/13 + * Version: @(#)config.c 1.0.22 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -29,6 +29,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "cpu/cpu.h" #include "nvr.h" @@ -1988,58 +1989,3 @@ config_set_wstring(char *head, char *name, wchar_t *val) memcpy(ent->wdata, val, sizeof_w(ent->wdata)); wcstombs(ent->data, ent->wdata, sizeof(ent->data)); } - - -/* FIXME: should be moved elsewhere. --FvK */ -wchar_t * -get_filename_w(wchar_t *s) -{ - int c = wcslen(s) - 1; - - while (c > 0) { - if (s[c] == L'/' || s[c] == L'\\') - return(&s[c+1]); - c--; - } - - return(s); -} - - -/* FIXME: should be moved elsewhere. --FvK */ -void -append_filename_w(wchar_t *dest, wchar_t *s1, wchar_t *s2, int size) -{ - wcscat(dest, s1); - wcscat(dest, s2); -} - - -/* FIXME: should be moved elsewhere. --FvK */ -void -put_backslash_w(wchar_t *s) -{ - int c = wcslen(s) - 1; - - if (s[c] != L'/' && s[c] != L'\\') - s[c] = L'/'; -} - - -/* FIXME: should be moved elsewhere. --FvK */ -wchar_t -*get_extension_w(wchar_t *s) -{ - int c = wcslen(s) - 1; - - if (c <= 0) - return(s); - - while (c && s[c] != L'.') - c--; - - if (!c) - return(&s[wcslen(s)]); - - return(&s[c+1]); -} diff --git a/src/config.h b/src/config.h index bca7591d2..257bdd1b7 100644 --- a/src/config.h +++ b/src/config.h @@ -8,7 +8,7 @@ * * Configuration file handler header. * - * Version: @(#)config.h 1.0.3 2017/10/13 + * Version: @(#)config.h 1.0.4 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -49,12 +49,6 @@ extern void config_set_mac(char *head, char *name, int val); extern void config_set_string(char *head, char *name, char *val); extern void config_set_wstring(char *head, char *name, wchar_t *val); -extern wchar_t *get_filename_w(wchar_t *s); -extern void append_filename_w(wchar_t *dest, wchar_t *s1, wchar_t *s2, int size); -extern void put_backslash_w(wchar_t *s); -extern wchar_t *get_extension_w(wchar_t *s); - - #ifdef __cplusplus } #endif diff --git a/src/cpu/386.c b/src/cpu/386.c index 4bbb87976..abdcf668e 100644 --- a/src/cpu/386.c +++ b/src/cpu/386.c @@ -7,6 +7,7 @@ #ifndef INFINITY # define INFINITY (__builtin_inff()) #endif +#include "../86box.h" #include "../ibm.h" #include "cpu.h" #include "x86.h" diff --git a/src/cpu/386_dynarec.c b/src/cpu/386_dynarec.c index 504a002be..88f97ae7f 100644 --- a/src/cpu/386_dynarec.c +++ b/src/cpu/386_dynarec.c @@ -7,6 +7,7 @@ #ifndef INFINITY # define INFINITY (__builtin_inff()) #endif +#include "../86box.h" #include "../ibm.h" #include "cpu.h" #include "x86.h" diff --git a/src/cpu/386_dynarec_ops.c b/src/cpu/386_dynarec_ops.c index 5e7a6692c..e0f8e345f 100644 --- a/src/cpu/386_dynarec_ops.c +++ b/src/cpu/386_dynarec_ops.c @@ -6,6 +6,7 @@ #ifndef INFINITY # define INFINITY (__builtin_inff()) #endif +#include "../86box.h" #include "../ibm.h" #include "cpu.h" #include "x86.h" diff --git a/src/cpu/808x.c b/src/cpu/808x.c index 3d77f2018..026908c4d 100644 --- a/src/cpu/808x.c +++ b/src/cpu/808x.c @@ -18,7 +18,7 @@ * 2 clocks - fetch opcode 1 2 clocks - execute * 2 clocks - fetch opcode 2 etc * - * Version: @(#)808x.c 1.0.4 2017/10/12 + * Version: @(#)808x.c 1.0.5 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -30,6 +30,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "cpu.h" #include "x86.h" diff --git a/src/cpu/codegen.c b/src/cpu/codegen.c index e3773089b..b860ee96f 100644 --- a/src/cpu/codegen.c +++ b/src/cpu/codegen.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "x86_ops.h" diff --git a/src/cpu/codegen_ops.c b/src/cpu/codegen_ops.c index 309241c0e..b101222a6 100644 --- a/src/cpu/codegen_ops.c +++ b/src/cpu/codegen_ops.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "x86.h" diff --git a/src/cpu/codegen_timing_486.c b/src/cpu/codegen_timing_486.c index 56f654313..407dffb1c 100644 --- a/src/cpu/codegen_timing_486.c +++ b/src/cpu/codegen_timing_486.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "cpu.h" diff --git a/src/cpu/codegen_timing_686.c b/src/cpu/codegen_timing_686.c index 17ec4ab43..3b58c9a6c 100644 --- a/src/cpu/codegen_timing_686.c +++ b/src/cpu/codegen_timing_686.c @@ -12,6 +12,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "cpu.h" diff --git a/src/cpu/codegen_timing_common.c b/src/cpu/codegen_timing_common.c index d02ff2a42..e8a2375f2 100644 --- a/src/cpu/codegen_timing_common.c +++ b/src/cpu/codegen_timing_common.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "codegen_timing_common.h" diff --git a/src/cpu/codegen_timing_pentium.c b/src/cpu/codegen_timing_pentium.c index 95edbe1d6..11676c69d 100644 --- a/src/cpu/codegen_timing_pentium.c +++ b/src/cpu/codegen_timing_pentium.c @@ -13,6 +13,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "cpu.h" diff --git a/src/cpu/codegen_timing_winchip.c b/src/cpu/codegen_timing_winchip.c index 06644e90f..0bb47b024 100644 --- a/src/cpu/codegen_timing_winchip.c +++ b/src/cpu/codegen_timing_winchip.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "cpu.h" #include "x86.h" diff --git a/src/cpu/codegen_x86-64.c b/src/cpu/codegen_x86-64.c index ff2e25541..d44cda3d1 100644 --- a/src/cpu/codegen_x86-64.c +++ b/src/cpu/codegen_x86-64.c @@ -5,6 +5,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "cpu.h" diff --git a/src/cpu/codegen_x86.c b/src/cpu/codegen_x86.c index fb2ea44d3..a3932e55a 100644 --- a/src/cpu/codegen_x86.c +++ b/src/cpu/codegen_x86.c @@ -5,6 +5,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "cpu.h" diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 2c2e79773..346373790 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -8,7 +8,7 @@ * * CPU type handler. * - * Version: @(#)cpu.c 1.0.4 2017/10/14 + * Version: @(#)cpu.c 1.0.5 2017/10/16 * * Authors: Sarah Walker, * leilei, @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "cpu.h" #include "../device.h" diff --git a/src/cpu/x86_ops.h b/src/cpu/x86_ops.h index e0b981807..4435587d4 100644 --- a/src/cpu/x86_ops.h +++ b/src/cpu/x86_ops.h @@ -5,7 +5,7 @@ #define _X86_OPS_H -#define UNUSED(x) (void)(x) +#define UN_USED(x) (void)(x) typedef int (*OpFn)(uint32_t fetchdat); diff --git a/src/cpu/x86_ops_call.h b/src/cpu/x86_ops_call.h index d1f61021c..30e60410c 100644 --- a/src/cpu/x86_ops_call.h +++ b/src/cpu/x86_ops_call.h @@ -61,7 +61,7 @@ static int opCALL_far_w(uint32_t fetchdat) { uint32_t old_cs, old_pc; uint16_t new_cs, new_pc; - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); new_pc = getwordf(); new_cs = getword(); if (cpu_state.abrt) return 1; @@ -77,7 +77,7 @@ static int opCALL_far_l(uint32_t fetchdat) { uint32_t old_cs, old_pc; uint32_t new_cs, new_pc; - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); new_pc = getlong(); new_cs = getword(); if (cpu_state.abrt) return 1; @@ -95,7 +95,7 @@ static int opFF_w_a16(uint32_t fetchdat) { uint16_t old_cs, new_cs; uint32_t old_pc, new_pc; - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); uint16_t temp; @@ -172,7 +172,7 @@ static int opFF_w_a32(uint32_t fetchdat) { uint16_t old_cs, new_cs; uint32_t old_pc, new_pc; - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); uint16_t temp; @@ -250,7 +250,7 @@ static int opFF_l_a16(uint32_t fetchdat) { uint16_t old_cs, new_cs; uint32_t old_pc, new_pc; - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); uint32_t temp; @@ -327,7 +327,7 @@ static int opFF_l_a32(uint32_t fetchdat) { uint16_t old_cs, new_cs; uint32_t old_pc, new_pc; - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); uint32_t temp; diff --git a/src/cpu/x86_ops_int.h b/src/cpu/x86_ops_int.h index 354bcd59b..5aa05fc11 100644 --- a/src/cpu/x86_ops_int.h +++ b/src/cpu/x86_ops_int.h @@ -1,6 +1,6 @@ static int opINT3(uint32_t fetchdat) { - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); if ((cr0 & 1) && (eflags & VM_FLAG) && (IOPL != 3)) { x86gpf(NULL,0); @@ -14,7 +14,7 @@ static int opINT3(uint32_t fetchdat) static int opINT1(uint32_t fetchdat) { - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); if ((cr0 & 1) && (eflags & VM_FLAG) && (IOPL != 3)) { x86gpf(NULL,0); @@ -28,7 +28,7 @@ static int opINT1(uint32_t fetchdat) static int opINT(uint32_t fetchdat) { - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); uint8_t temp = getbytef(); if ((cr0 & 1) && (eflags & VM_FLAG) && (IOPL != 3)) @@ -70,7 +70,7 @@ static int opINT(uint32_t fetchdat) static int opINTO(uint32_t fetchdat) { - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); if ((cr0 & 1) && (eflags & VM_FLAG) && (IOPL != 3)) { diff --git a/src/cpu/x86_ops_ret.h b/src/cpu/x86_ops_ret.h index 72998c0f6..95872588c 100644 --- a/src/cpu/x86_ops_ret.h +++ b/src/cpu/x86_ops_ret.h @@ -44,7 +44,7 @@ static int opRETF_a16(uint32_t fetchdat) { - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); CPU_BLOCK_END(); RETF_a16(0); @@ -55,7 +55,7 @@ static int opRETF_a16(uint32_t fetchdat) } static int opRETF_a32(uint32_t fetchdat) { - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); CPU_BLOCK_END(); RETF_a32(0); @@ -68,7 +68,7 @@ static int opRETF_a32(uint32_t fetchdat) static int opRETF_a16_imm(uint32_t fetchdat) { uint16_t offset = getwordf(); - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); CPU_BLOCK_END(); RETF_a16(offset); @@ -80,7 +80,7 @@ static int opRETF_a16_imm(uint32_t fetchdat) static int opRETF_a32_imm(uint32_t fetchdat) { uint16_t offset = getwordf(); - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); CPU_BLOCK_END(); RETF_a32(offset); @@ -92,7 +92,7 @@ static int opRETF_a32_imm(uint32_t fetchdat) static int opIRET_286(uint32_t fetchdat) { - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); if ((cr0 & 1) && (eflags & VM_FLAG) && (IOPL != 3)) { @@ -137,7 +137,7 @@ static int opIRET_286(uint32_t fetchdat) static int opIRET(uint32_t fetchdat) { - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); if ((cr0 & 1) && (eflags & VM_FLAG) && (IOPL != 3)) { @@ -214,7 +214,7 @@ static int opIRET(uint32_t fetchdat) static int opIRETD(uint32_t fetchdat) { - int cycles_old = cycles; UNUSED(cycles_old); + int cycles_old = cycles; UN_USED(cycles_old); if ((cr0 & 1) && (eflags & VM_FLAG) && (IOPL != 3)) { diff --git a/src/cpu/x86seg.c b/src/cpu/x86seg.c index e365488bc..babc40b1b 100644 --- a/src/cpu/x86seg.c +++ b/src/cpu/x86seg.c @@ -8,7 +8,7 @@ * * x86 CPU segment emulation. * - * Version: @(#)x86seg.c 1.0.3 2017/10/12 + * Version: @(#)x86seg.c 1.0.4 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "../nvr.h" diff --git a/src/cpu/x87.c b/src/cpu/x87.c index 362e288d7..5d95b6fa9 100644 --- a/src/cpu/x87.c +++ b/src/cpu/x87.c @@ -4,6 +4,7 @@ #include #define fplog 0 #include +#include "../86box.h" #include "../ibm.h" #include "../pic.h" #include "x86.h" diff --git a/src/device.c b/src/device.c index ef2904f1a..8b5d25f1e 100644 --- a/src/device.c +++ b/src/device.c @@ -9,10 +9,11 @@ * Implementation of the generic device interface to handle * all devices attached to the emulator. * - * Version: @(#)device.c 1.0.4 2017/10/04 + * Version: @(#)device.c 1.0.5 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, + * * Copyright 2008-2016 Sarah Walker. * Copyright 2016,2017 Miran Grca. */ @@ -20,6 +21,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "cpu/cpu.h" #include "config.h" diff --git a/src/disk/hdc.c b/src/disk/hdc.c index 39b180599..87248cc64 100644 --- a/src/disk/hdc.c +++ b/src/disk/hdc.c @@ -8,10 +8,11 @@ * * Common code to handle all sorts of disk controllers. * - * Version: @(#)hdc.c 1.0.3 2017/10/04 + * Version: @(#)hdc.c 1.0.4 2017/10/16 * * Authors: Miran Grca, * Fred N. van Kempen, + * * Copyright 2016,2017 Miran Grca. * Copyright 2017 Fred N. van Kempen. */ @@ -19,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../device.h" diff --git a/src/disk/hdc_esdi_at.c b/src/disk/hdc_esdi_at.c index 91d847c5a..183bc5b16 100644 --- a/src/disk/hdc_esdi_at.c +++ b/src/disk/hdc_esdi_at.c @@ -8,7 +8,7 @@ * * Driver for the ESDI controller (WD1007-vse1) for PC/AT. * - * Version: @(#)hdc_esdi_at.c 1.0.4 2017/10/09 + * Version: @(#)hdc_esdi_at.c 1.0.5 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -26,6 +26,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../io.h" diff --git a/src/disk/hdc_esdi_mca.c b/src/disk/hdc_esdi_mca.c index 19868e488..92df525be 100644 --- a/src/disk/hdc_esdi_mca.c +++ b/src/disk/hdc_esdi_mca.c @@ -52,7 +52,7 @@ * however, are auto-configured by the system software as * shown above. * - * Version: @(#)hdc_esdi_mca.c 1.0.6 2017/10/09 + * Version: @(#)hdc_esdi_mca.c 1.0.7 2017/10/16 * * Authors: Sarah Walker, * Fred N. van Kempen, @@ -65,6 +65,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../dma.h" diff --git a/src/disk/hdc_mfm_at.c b/src/disk/hdc_mfm_at.c index 11d77373e..473999dcb 100644 --- a/src/disk/hdc_mfm_at.c +++ b/src/disk/hdc_mfm_at.c @@ -12,7 +12,7 @@ * based design. Most cards were WD1003-WA2 or -WAH, where the * -WA2 cards had a floppy controller as well (to save space.) * - * Version: @(#)hdd_mfm_at.c 1.0.8 2017/10/14 + * Version: @(#)hdd_mfm_at.c 1.0.9 2017/10/16 * * Authors: Sarah Walker, * Fred N. van Kempen, @@ -28,6 +28,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../io.h" diff --git a/src/disk/hdc_mfm_xt.c b/src/disk/hdc_mfm_xt.c index 0ff2c652a..7deae868b 100644 --- a/src/disk/hdc_mfm_xt.c +++ b/src/disk/hdc_mfm_xt.c @@ -41,7 +41,7 @@ * Since all controllers (including the ones made by DTC) use * (mostly) the same API, we keep them all in this module. * - * Version: @(#)hdd_mfm_xt.c 1.0.9 2017/10/11 + * Version: @(#)hdd_mfm_xt.c 1.0.10 2017/10/16 * * Authors: Sarah Walker, * Fred N. van Kempen, @@ -57,6 +57,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../dma.h" diff --git a/src/disk/hdc_xtide.c b/src/disk/hdc_xtide.c index d3e5789e1..9e81817d0 100644 --- a/src/disk/hdc_xtide.c +++ b/src/disk/hdc_xtide.c @@ -21,7 +21,7 @@ * already on their way out, the newer IDE standard based on the * PC/AT controller and 16b design became the IDE we now know. * - * Version: @(#)hdc_xtide.c 1.0.8 2017/10/09 + * Version: @(#)hdc_xtide.c 1.0.9 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -36,6 +36,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/disk/hdd.c b/src/disk/hdd.c index 90cb7a140..ade328272 100644 --- a/src/disk/hdd.c +++ b/src/disk/hdd.c @@ -8,7 +8,7 @@ * * Common code to handle all sorts of hard disk images. * - * Version: @(#)hdd.c 1.0.4 2017/10/09 + * Version: @(#)hdd.c 1.0.5 2017/10/16 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -20,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../ui.h" #include "hdd.h" diff --git a/src/disk/hdd_image.c b/src/disk/hdd_image.c index 956a6732a..1422e3a5a 100644 --- a/src/disk/hdd_image.c +++ b/src/disk/hdd_image.c @@ -8,7 +8,7 @@ * * Handling of hard disk image files. * - * Version: @(#)hdd_image.c 1.0.5 2017/11/13 + * Version: @(#)hdd_image.c 1.0.5 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -28,6 +28,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../plat.h" #include "hdd.h" diff --git a/src/disk/hdd_table.c b/src/disk/hdd_table.c index bf61beef9..98045f031 100644 --- a/src/disk/hdd_table.c +++ b/src/disk/hdd_table.c @@ -9,7 +9,7 @@ * Implementation of the IDE emulation for hard disks and ATAPI * CD-ROM devices. * - * Version: @(#)hdd_table.c 1.0.3 2017/09/30 + * Version: @(#)hdd_table.c 1.0.4 2017/10/16 * * Authors: Miran Grca, * Fred N. van Kempen, diff --git a/src/dma.c b/src/dma.c index f31bfe475..32efc672e 100644 --- a/src/dma.c +++ b/src/dma.c @@ -8,10 +8,11 @@ * * Implementation of the Intel DMA controllers. * - * Version: @(#)dma.c 1.0.3 2017/09/24 + * Version: @(#)dma.c 1.0.4 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, + * * Copyright 2008-2017 Sarah Walker. * Copyright 2016,2017 Miran Grca. */ @@ -19,6 +20,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "cpu/x86.h" #include "mem.h" diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index e08d440db..9b17643e8 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -9,10 +9,11 @@ * Implementation of the NEC uPD-765 and compatible floppy disk * controller. * - * Version: @(#)fdc.c 1.0.5 2017/10/09 + * Version: @(#)fdc.c 1.0.6 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, + * * Copyright 2008-2017 Sarah Walker. * Copyright 2016,2017 Miran Grca. */ @@ -21,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/floppy/fdd.c b/src/floppy/fdd.c index 10a755dc8..d6ea4f0e5 100644 --- a/src/floppy/fdd.c +++ b/src/floppy/fdd.c @@ -8,10 +8,11 @@ * * Implementation of the floppy drive emulation. * - * Version: @(#)fdd.c 1.0.3 2017/09/24 + * Version: @(#)fdd.c 1.0.4 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, + * * Copyright 2008-2017 Sarah Walker. * Copyright 2016,2017 Miran Grca. */ @@ -19,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "floppy.h" #include "fdc.h" diff --git a/src/floppy/fdi2raw.c b/src/floppy/fdi2raw.c index 84e2c7388..3b80d888c 100644 --- a/src/floppy/fdi2raw.c +++ b/src/floppy/fdi2raw.c @@ -30,6 +30,7 @@ #include "zfile.h"*/ /* ELSE */ #define xmalloc malloc +#include "../86box.h" #include "../ibm.h" #include "fdi2raw.h" diff --git a/src/floppy/floppy.c b/src/floppy/floppy.c index 809de0a88..9118a85bb 100644 --- a/src/floppy/floppy.c +++ b/src/floppy/floppy.c @@ -9,7 +9,7 @@ * Generic floppy disk interface that communicates with the * other handlers. * - * Version: @(#)floppy.c 1.0.8 2017/10/12 + * Version: @(#)floppy.c 1.0.10 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "../rom.h" @@ -135,7 +136,7 @@ void floppy_load(int drive, wchar_t *fn) wchar_t *p; FILE *f; if (!fn) return; - p = get_extension_w(fn); + p = plat_get_extension(fn); if (!p) return; f = plat_fopen(fn, L"rb"); if (!f) return; diff --git a/src/floppy/floppy_86f.c b/src/floppy/floppy_86f.c index 9328d7d3d..450500967 100644 --- a/src/floppy/floppy_86f.c +++ b/src/floppy/floppy_86f.c @@ -10,7 +10,7 @@ * data in the form of FM/MFM-encoded transitions) which also * forms the core of the emulator's floppy disk emulation. * - * Version: @(#)floppy_86f.c 1.0.7 2017/10/12 + * Version: @(#)floppy_86f.c 1.0.8 2017/10/16 * * Author: Miran Grca, * Copyright 2016,2017 Miran Grca. @@ -23,6 +23,7 @@ #include #include #include "../lzf/lzf.h" +#include "../86box.h" #include "../ibm.h" #include "../config.h" #include "../dma.h" diff --git a/src/floppy/floppy_common.c b/src/floppy/floppy_common.c index 167dc6efb..d6d0b218c 100644 --- a/src/floppy/floppy_common.c +++ b/src/floppy/floppy_common.c @@ -8,7 +8,7 @@ * * Shared code for all the floppy modules. * - * Version: @(#)floppy_common.c 1.0.2 2017/09/24 + * Version: @(#)floppy_common.c 1.0.3 2017/10/16 * * Author: Fred N. van Kempen, * Copyright 2017 Fred N. van Kempen. @@ -18,6 +18,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../floppy/floppy.h" #include "floppy_common.h" diff --git a/src/floppy/floppy_fdi.c b/src/floppy/floppy_fdi.c index 1f65696b5..67c179aa4 100644 --- a/src/floppy/floppy_fdi.c +++ b/src/floppy/floppy_fdi.c @@ -9,7 +9,7 @@ * Implementation of the FDI floppy stream image format * interface to the FDI2RAW module. * - * Version: @(#)floppy_fdi.c 1.0.3 2017/10/12 + * Version: @(#)floppy_fdi.c 1.0.4 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../plat.h" #include "floppy.h" diff --git a/src/floppy/floppy_imd.c b/src/floppy/floppy_imd.c index f5de9700d..e109ec057 100644 --- a/src/floppy/floppy_imd.c +++ b/src/floppy/floppy_imd.c @@ -8,7 +8,7 @@ * * Implementation of the IMD floppy image format. * - * Version: @(#)floppy_imd.c 1.0.3 2017/10/12 + * Version: @(#)floppy_imd.c 1.0.4 2017/10/16 * * Author: Miran Grca, * Copyright 2016,2017 Miran Grca. @@ -18,6 +18,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../plat.h" #include "floppy.h" diff --git a/src/floppy/floppy_img.c b/src/floppy/floppy_img.c index 20f712981..9c5e4d9c1 100644 --- a/src/floppy/floppy_img.c +++ b/src/floppy/floppy_img.c @@ -9,7 +9,7 @@ * Implementation of the raw sector-based floppy image format, * as well as the Japanese FDI, CopyQM, and FDF formats. * - * Version: @(#)floppy_img.c 1.0.3 2017/10/12 + * Version: @(#)floppy_img.c 1.0.5 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../config.h" #include "../plat.h" @@ -346,7 +347,7 @@ void img_load(int drive, wchar_t *fn) uint8_t *literal; int guess = 0; - ext = get_extension_w(fn); + ext = plat_get_extension(fn); d86f_unregister(drive); diff --git a/src/floppy/floppy_json.c b/src/floppy/floppy_json.c index 495269799..c4822f095 100644 --- a/src/floppy/floppy_json.c +++ b/src/floppy/floppy_json.c @@ -8,7 +8,7 @@ * * Implementation of the PCjs JSON floppy image format. * - * Version: @(#)floppy_json.c 1.0.7 2017/10/14 + * Version: @(#)floppy_json.c 1.0.8 2017/10/16 * * Author: Fred N. van Kempen, * @@ -19,6 +19,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../plat.h" #include "floppy.h" diff --git a/src/floppy/floppy_td0.c b/src/floppy/floppy_td0.c index 0d16e3250..97e5e45a2 100644 --- a/src/floppy/floppy_td0.c +++ b/src/floppy/floppy_td0.c @@ -8,7 +8,7 @@ * * Implementation of the Teledisk floppy image format. * - * Version: @(#)floppy_td0.c 1.0.4 2017/10/12 + * Version: @(#)floppy_td0.c 1.0.5 2017/10/16 * * Authors: Milodrag Milanovic, * Haruhiko OKUMURA, @@ -42,6 +42,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../plat.h" #include "floppy.h" diff --git a/src/game/gameport.c b/src/game/gameport.c index 7410abdd9..9756facb8 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -6,6 +6,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../device.h" diff --git a/src/game/joystick_ch_flightstick_pro.c b/src/game/joystick_ch_flightstick_pro.c index ffec5e7bf..fe9917059 100644 --- a/src/game/joystick_ch_flightstick_pro.c +++ b/src/game/joystick_ch_flightstick_pro.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../timer.h" diff --git a/src/game/joystick_standard.c b/src/game/joystick_standard.c index 329355d0e..9eb632410 100644 --- a/src/game/joystick_standard.c +++ b/src/game/joystick_standard.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../timer.h" diff --git a/src/game/joystick_sw_pad.c b/src/game/joystick_sw_pad.c index f127d2f49..6713ffa63 100644 --- a/src/game/joystick_sw_pad.c +++ b/src/game/joystick_sw_pad.c @@ -24,6 +24,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../timer.h" diff --git a/src/game/joystick_tm_fcs.c b/src/game/joystick_tm_fcs.c index 2fcbe4920..13b3a38a5 100644 --- a/src/game/joystick_tm_fcs.c +++ b/src/game/joystick_tm_fcs.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../timer.h" diff --git a/src/ibm.h b/src/ibm.h index 288224314..185b20b05 100644 --- a/src/ibm.h +++ b/src/ibm.h @@ -10,7 +10,7 @@ * * !!!NOTE!!! The goal is to GET RID of this file. Do NOT add stuff !! * - * Version: @(#)ibm.h 1.0.9 2017/10/15 + * Version: @(#)ibm.h 1.0.10 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -285,6 +285,7 @@ extern int CPUID; extern int cpl_override; + /*Timer*/ typedef struct PIT_nr { @@ -382,9 +383,8 @@ extern int driveempty[4]; #define MDA ((gfxcard==GFX_MDA || gfxcard==GFX_HERCULES || gfxcard==GFX_HERCULESPLUS || gfxcard==GFX_INCOLOR || gfxcard==GFX_GENIUS) && (romset=ROM_IBMAT)) #define VGA ((gfxcard>=GFX_TVGA) && gfxcard!=GFX_COLORPLUS && gfxcard!=GFX_INCOLOR && gfxcard!=GFX_WY700 && gfxcard!=GFX_GENIUS && gfxcard!=GFX_COMPAQ_EGA && gfxcard!=GFX_SUPER_EGA && gfxcard!=GFX_HERCULESPLUS && romset!=ROM_PC1640 && romset!=ROM_PC1512 && romset!=ROM_TANDY && romset!=ROM_PC200) -int GAMEBLASTER, GUS, SSI2001, voodoo_enabled, buslogic_enabled; +int GAMEBLASTER, GUS, SSI2001, voodoo_enabled; extern int AMSTRAD, AT, is286, is386, PCI, TANDY; - extern int hasfpu; enum @@ -462,9 +462,6 @@ int cpuspeed; /*Video*/ extern int egareads,egawrites; -extern int vid_resize; -extern int vid_api; -extern int winsizex,winsizey; extern int changeframecount; @@ -491,9 +488,6 @@ extern int gated,speakval,speakon; #define SND_WSS 9 /*Windows Sound System*/ #define SND_PAS16 10 /*Pro Audio Spectrum 16*/ -extern wchar_t exe_path[1024]; -extern wchar_t cfg_path[1024]; - /*Keyboard*/ extern int64_t keybsenddelay; @@ -531,18 +525,6 @@ extern int nmi_auto_clear; extern float isa_timing, bus_timing; - -extern uint64_t timer_read(void); -extern uint64_t timer_freq; - - -extern int infocus; - - -extern int dump_on_exit; -extern int start_in_fullscreen; -extern int window_w, window_h, window_x, window_y, window_remember; - extern uint64_t pmc[2]; extern uint16_t temp_seg_data[4]; @@ -560,18 +542,6 @@ extern uint64_t star; extern int mem_a20_state; -#ifdef ENABLE_LOG_TOGGLES -extern int buslogic_do_log; -extern int cdrom_do_log; -extern int d86f_do_log; -extern int fdc_do_log; -extern int ide_do_log; -extern int serial_do_log; -extern int nic_do_log; -#endif - -extern int suppress_overscan; - typedef struct PCI_RESET { void (*pci_master_reset)(void); @@ -589,35 +559,16 @@ extern int serial_enabled[2]; extern int lpt_enabled, bugger_enabled; extern int romset; -extern int invert_display; - uint32_t svga_color_transform(uint32_t color); -extern int scale; - /* Function prototypes. */ #ifdef __cplusplus extern "C" { #endif -extern void pclog(const char *format, ...); -extern void fatal(const char *format, ...); -extern wchar_t *pc_concat(wchar_t *str); -extern int pc_init_modules(void); -extern int pc_init(int argc, wchar_t *argv[]); -extern void pc_close(void); -extern void pc_reset_hard_close(void); -extern void pc_reset_hard_init(void); -extern void pc_reset_hard(void); -extern void pc_full_speed(void); -extern void pc_speed_changed(void); -extern void pc_send_cad(void); -extern void pc_send_cae(void); -extern void pc_run(void); extern void onesec(void); - extern int checkio(int port); extern void codegen_block_end(void); extern void codegen_reset(void); diff --git a/src/intel_flash.c b/src/intel_flash.c index 7da82f2ac..7ad1268b2 100644 --- a/src/intel_flash.c +++ b/src/intel_flash.c @@ -8,7 +8,7 @@ * * Implementation of the Intel 2 Mbit 8-bit flash devices. * - * Version: @(#)intel_flash.c 1.0.8 2017/10/14 + * Version: @(#)intel_flash.c 1.0.9 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "cpu/cpu.h" #include "device.h" diff --git a/src/io.c b/src/io.c index 6983b47ad..5b6d04926 100644 --- a/src/io.c +++ b/src/io.c @@ -5,6 +5,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" diff --git a/src/keyboard.c b/src/keyboard.c index 8a4bbdf5b..716b0c015 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -8,7 +8,7 @@ * * Host to guest keyboard interface and keyboard scan code sets. * - * Version: @(#)keyboard.c 1.0.4 2017/10/10 + * Version: @(#)keyboard.c 1.0.5 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -20,6 +20,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "plat_keyboard.h" #include "keyboard.h" diff --git a/src/keyboard_amstrad.c b/src/keyboard_amstrad.c index 6ebbaa0f3..022ecb4a1 100644 --- a/src/keyboard_amstrad.c +++ b/src/keyboard_amstrad.c @@ -5,6 +5,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "mem.h" diff --git a/src/keyboard_at.c b/src/keyboard_at.c index 2b98f21f6..7e5eaaf07 100644 --- a/src/keyboard_at.c +++ b/src/keyboard_at.c @@ -8,10 +8,11 @@ * * Intel 8042 (AT keyboard controller) emulation. * - * Version: @(#)keyboard_at.c 1.0.3 2017/09/24 + * Version: @(#)keyboard_at.c 1.0.4 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, + * * Copyright 2008-2017 Sarah Walker. * Copyright 2016,2017 Miran Grca. */ @@ -19,6 +20,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "pic.h" diff --git a/src/keyboard_olim24.c b/src/keyboard_olim24.c index 371a104c3..9bd139087 100644 --- a/src/keyboard_olim24.c +++ b/src/keyboard_olim24.c @@ -3,6 +3,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "mem.h" diff --git a/src/keyboard_pcjr.c b/src/keyboard_pcjr.c index ccd9986f2..87e3fc0b6 100644 --- a/src/keyboard_pcjr.c +++ b/src/keyboard_pcjr.c @@ -5,6 +5,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "mem.h" diff --git a/src/keyboard_xt.c b/src/keyboard_xt.c index 3e93125c9..d413575b7 100644 --- a/src/keyboard_xt.c +++ b/src/keyboard_xt.c @@ -5,6 +5,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "mem.h" diff --git a/src/machine/machine.c b/src/machine/machine.c index d164499dc..af328bed7 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -8,7 +8,7 @@ * * Handling of the emulated machines. * - * Version: @(#)machine.c 1.0.19 2017/10/12 + * Version: @(#)machine.c 1.0.20 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../mem.h" diff --git a/src/machine/machine_amstrad.c b/src/machine/machine_amstrad.c index d2eb674cf..ca63131c8 100644 --- a/src/machine/machine_amstrad.c +++ b/src/machine/machine_amstrad.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../nmi.h" diff --git a/src/machine/machine_at.c b/src/machine/machine_at.c index 0c6faab0c..71cde9e1b 100644 --- a/src/machine/machine_at.c +++ b/src/machine/machine_at.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../pic.h" #include "../pit.h" diff --git a/src/machine/machine_at_430fx.c b/src/machine/machine_at_430fx.c index e50ad18cf..58a2bd95b 100644 --- a/src/machine/machine_at_430fx.c +++ b/src/machine/machine_at_430fx.c @@ -8,7 +8,7 @@ * * Implementation of the Intel 430FX PCISet chip. * - * Version: @(#)machine_at_430fx.c 1.0.6 2017/10/07 + * Version: @(#)machine_at_430fx.c 1.0.7 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -20,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "../memregs.h" diff --git a/src/machine/machine_at_430hx.c b/src/machine/machine_at_430hx.c index ca110dd60..ff8b22a56 100644 --- a/src/machine/machine_at_430hx.c +++ b/src/machine/machine_at_430hx.c @@ -8,7 +8,7 @@ * * Implementation of the Intel 430HX PCISet chip. * - * Version: @(#)machine_at_430hx.c 1.0.6 2017/10/07 + * Version: @(#)machine_at_430hx.c 1.0.7 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -20,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/machine/machine_at_430lx_nx.c b/src/machine/machine_at_430lx_nx.c index 2f7530435..48e111f97 100644 --- a/src/machine/machine_at_430lx_nx.c +++ b/src/machine/machine_at_430lx_nx.c @@ -8,7 +8,7 @@ * * Implementation of the Intel 430LX and 430NX PCISet chips. * - * Version: @(#)machine_at_430lx_nx.c 1.0.6 2017/10/07 + * Version: @(#)machine_at_430lx_nx.c 1.0.7 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -20,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "../memregs.h" diff --git a/src/machine/machine_at_430vx.c b/src/machine/machine_at_430vx.c index 54171e2a4..a860af7e4 100644 --- a/src/machine/machine_at_430vx.c +++ b/src/machine/machine_at_430vx.c @@ -8,7 +8,7 @@ * * Implementation of the Intel 430VX PCISet chip. * - * Version: @(#)machine_at_430vx.c 1.0.7 2017/10/07 + * Version: @(#)machine_at_430vx.c 1.0.8 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -20,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../pci.h" diff --git a/src/machine/machine_at_440fx.c b/src/machine/machine_at_440fx.c index fcb579111..167cd870f 100644 --- a/src/machine/machine_at_440fx.c +++ b/src/machine/machine_at_440fx.c @@ -8,7 +8,7 @@ * * Implementation of the Intel 440FX PCISet chip. * - * Version: @(#)machine_at_440fx.c 1.0.6 2017/10/07 + * Version: @(#)machine_at_440fx.c 1.0.7 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -20,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../pci.h" diff --git a/src/machine/machine_at_ali1429.c b/src/machine/machine_at_ali1429.c index 36c689419..baaf1ad3e 100644 --- a/src/machine/machine_at_ali1429.c +++ b/src/machine/machine_at_ali1429.c @@ -5,6 +5,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../io.h" diff --git a/src/machine/machine_at_commodore.c b/src/machine/machine_at_commodore.c index 05bcbad86..820ba1cda 100644 --- a/src/machine/machine_at_commodore.c +++ b/src/machine/machine_at_commodore.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../lpt.h" diff --git a/src/machine/machine_at_compaq.c b/src/machine/machine_at_compaq.c index 9ed973abb..17ef88467 100644 --- a/src/machine/machine_at_compaq.c +++ b/src/machine/machine_at_compaq.c @@ -5,6 +5,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../mem.h" diff --git a/src/machine/machine_at_headland.c b/src/machine/machine_at_headland.c index 74778e83f..4ab6e711e 100644 --- a/src/machine/machine_at_headland.c +++ b/src/machine/machine_at_headland.c @@ -5,6 +5,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../io.h" diff --git a/src/machine/machine_at_neat.c b/src/machine/machine_at_neat.c index d43872a16..4c46015cb 100644 --- a/src/machine/machine_at_neat.c +++ b/src/machine/machine_at_neat.c @@ -6,6 +6,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "machine.h" diff --git a/src/machine/machine_at_opti495.c b/src/machine/machine_at_opti495.c index 7570c7922..54ac72178 100644 --- a/src/machine/machine_at_opti495.c +++ b/src/machine/machine_at_opti495.c @@ -255,6 +255,7 @@ SeeAlso: #P0178,#P0187 #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../io.h" diff --git a/src/machine/machine_at_scat.c b/src/machine/machine_at_scat.c index 26ecdb6d5..b06fad779 100644 --- a/src/machine/machine_at_scat.c +++ b/src/machine/machine_at_scat.c @@ -10,7 +10,7 @@ * * Re-worked version based on the 82C235 datasheet and errata. * - * Version: @(#)at_scat.c 1.0.2 2017/10/07 + * Version: @(#)at_scat.c 1.0.3 2017/10/16 * * Authors: Original by GreatPsycho for PCem. * Fred N. van Kempen, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../cpu/x86.h" diff --git a/src/machine/machine_at_sis_85c471.c b/src/machine/machine_at_sis_85c471.c index 68b9b5ab1..6e80fad31 100644 --- a/src/machine/machine_at_sis_85c471.c +++ b/src/machine/machine_at_sis_85c471.c @@ -9,7 +9,7 @@ * SiS sis85c471 Super I/O Chip * Used by DTK PKM-0038S E-2 * - * Version: @(#)sis85c471.c 1.0.6 2017/10/07 + * Version: @(#)sis85c471.c 1.0.7 2017/10/16 * * Author: Miran Grca, * @@ -19,6 +19,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../memregs.h" diff --git a/src/machine/machine_at_sis_85c496.c b/src/machine/machine_at_sis_85c496.c index 77a9c3580..287ef129e 100644 --- a/src/machine/machine_at_sis_85c496.c +++ b/src/machine/machine_at_sis_85c496.c @@ -6,6 +6,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../io.h" diff --git a/src/machine/machine_at_sis_85c50x.c b/src/machine/machine_at_sis_85c50x.c index c6aa5dfb6..23607f74a 100644 --- a/src/machine/machine_at_sis_85c50x.c +++ b/src/machine/machine_at_sis_85c50x.c @@ -6,7 +6,7 @@ * * Emulation of the SiS 50x PCI chips. * - * Version: @(#)machine_at_sis_85c50x.c 1.0.3 2017/10/07 + * Version: @(#)machine_at_sis_85c50x.c 1.0.4 2017/10/16 * * Author: Miran Grca, * @@ -17,6 +17,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../pci.h" diff --git a/src/machine/machine_at_wd76c10.c b/src/machine/machine_at_wd76c10.c index acdb47245..ca7efd07a 100644 --- a/src/machine/machine_at_wd76c10.c +++ b/src/machine/machine_at_wd76c10.c @@ -5,6 +5,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/machine/machine_common.c b/src/machine/machine_common.c index bf22dca68..5a3ca1d1d 100644 --- a/src/machine/machine_common.c +++ b/src/machine/machine_common.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../dma.h" #include "../pic.h" diff --git a/src/machine/machine_europc.c b/src/machine/machine_europc.c index 9328293a3..ecc9c80bc 100644 --- a/src/machine/machine_europc.c +++ b/src/machine/machine_europc.c @@ -5,6 +5,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../nmi.h" diff --git a/src/machine/machine_olivetti_m24.c b/src/machine/machine_olivetti_m24.c index 36ca77f1f..52a5cc48f 100644 --- a/src/machine/machine_olivetti_m24.c +++ b/src/machine/machine_olivetti_m24.c @@ -5,6 +5,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../nmi.h" diff --git a/src/machine/machine_pcjr.c b/src/machine/machine_pcjr.c index aace2715e..f719fa325 100644 --- a/src/machine/machine_pcjr.c +++ b/src/machine/machine_pcjr.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../nmi.h" #include "../pic.h" diff --git a/src/machine/machine_ps1.c b/src/machine/machine_ps1.c index 3e2be3012..de10cd709 100644 --- a/src/machine/machine_ps1.c +++ b/src/machine/machine_ps1.c @@ -5,6 +5,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../io.h" diff --git a/src/machine/machine_ps2_isa.c b/src/machine/machine_ps2_isa.c index c3b71007a..97ba57477 100644 --- a/src/machine/machine_ps2_isa.c +++ b/src/machine/machine_ps2_isa.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../io.h" diff --git a/src/machine/machine_ps2_mca.c b/src/machine/machine_ps2_mca.c index c4ddc4ec9..6c7a6d75c 100644 --- a/src/machine/machine_ps2_mca.c +++ b/src/machine/machine_ps2_mca.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../cpu/x86.h" diff --git a/src/machine/machine_tandy.c b/src/machine/machine_tandy.c index 0698ad6f9..1565a80a5 100644 --- a/src/machine/machine_tandy.c +++ b/src/machine/machine_tandy.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../nmi.h" #include "../mem.h" diff --git a/src/machine/machine_xt.c b/src/machine/machine_xt.c index 183482fd5..2954390e1 100644 --- a/src/machine/machine_xt.c +++ b/src/machine/machine_xt.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../nmi.h" #include "../pit.h" diff --git a/src/machine/machine_xt_laserxt.c b/src/machine/machine_xt_laserxt.c index 6cbadf648..04b89709b 100644 --- a/src/machine/machine_xt_laserxt.c +++ b/src/machine/machine_xt_laserxt.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../io.h" diff --git a/src/mcr.c b/src/mcr.c index bdde8e27e..9f753639f 100644 --- a/src/mcr.c +++ b/src/mcr.c @@ -5,6 +5,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" diff --git a/src/mem.c b/src/mem.c index b21f9939d..db519d6fa 100644 --- a/src/mem.c +++ b/src/mem.c @@ -6,6 +6,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "cpu/cpu.h" #include "cpu/x86_ops.h" diff --git a/src/memregs.c b/src/memregs.c index 018f07d84..103ab3582 100644 --- a/src/memregs.c +++ b/src/memregs.c @@ -9,7 +9,7 @@ * Emulation of the memory I/O scratch registers on ports 0xE1 * and 0xE2, used by just about any emulated machine. * - * Version: @(#)memregs.c 1.0.2 2017/09/24 + * Version: @(#)memregs.c 1.0.3 2017/10/16 * * Author: Miran Grca, * Copyright 2016-2017 Miran Grca. @@ -18,6 +18,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "memregs.h" diff --git a/src/mouse_bus.c b/src/mouse_bus.c index fa2225685..2b37aec0e 100644 --- a/src/mouse_bus.c +++ b/src/mouse_bus.c @@ -32,10 +32,11 @@ * Based on an early driver for MINIX 1.5. * Based on the 86Box PS/2 mouse driver as a framework. * - * Version: @(#)mouse_bus.c 1.0.9 2017/09/24 + * Version: @(#)mouse_bus.c 1.0.10 2017/10/16 * * Authors: Fred N. van Kempen, * TheCollector1995 + * * Copyright 1989-2017 Fred N. van Kempen. */ #include @@ -43,6 +44,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "pic.h" diff --git a/src/network/net_ne2000.c b/src/network/net_ne2000.c index 449623715..d6ae42cd1 100644 --- a/src/network/net_ne2000.c +++ b/src/network/net_ne2000.c @@ -10,7 +10,7 @@ * * NOTE: The file will also implement an NE1000 for 8-bit ISA systems. * - * Version: @(#)net_ne2000.c 1.0.18 2017/10/09 + * Version: @(#)net_ne2000.c 1.0.19 2017/10/16 * * Authors: Fred N. van Kempen, * Peter Grehan, grehan@iprg.nokia.com> @@ -27,6 +27,7 @@ #include #include #include +#include "../86box.h" #include "../config.h" #include "../ibm.h" #include "../io.h" diff --git a/src/network/net_pcap.c b/src/network/net_pcap.c index 18878db79..87b26196e 100644 --- a/src/network/net_pcap.c +++ b/src/network/net_pcap.c @@ -8,7 +8,7 @@ * * Handle WinPcap library processing. * - * Version: @(#)net_pcap.c 1.0.9 2017/10/11 + * Version: @(#)net_pcap.c 1.0.10 2017/10/16 * * Author: Fred N. van Kempen, * @@ -20,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../config.h" #include "../device.h" diff --git a/src/network/net_slirp.c b/src/network/net_slirp.c index a664eba81..2f2b5c8ab 100644 --- a/src/network/net_slirp.c +++ b/src/network/net_slirp.c @@ -8,7 +8,7 @@ * * Handle SLiRP library processing. * - * Version: @(#)net_slirp.c 1.0.9 2017/10/14 + * Version: @(#)net_slirp.c 1.0.10 2017/10/16 * * Author: Fred N. van Kempen, * @@ -21,6 +21,7 @@ #include #include "slirp/slirp.h" #include "slirp/queue.h" +#include "../86box.h" #include "../ibm.h" #include "../config.h" #include "../device.h" diff --git a/src/network/network.c b/src/network/network.c index f74f20d16..df72ed87c 100644 --- a/src/network/network.c +++ b/src/network/network.c @@ -12,7 +12,7 @@ * it should be malloc'ed and then linked to the NETCARD def. * Will be done later. * - * Version: @(#)network.c 1.0.14 2017/10/15 + * Version: @(#)network.c 1.0.15 2017/10/16 * * Author: Fred N. van Kempen, * @@ -23,6 +23,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../plat.h" diff --git a/src/nvr.c b/src/nvr.c index dea2717ef..78ecd1698 100644 --- a/src/nvr.c +++ b/src/nvr.c @@ -186,7 +186,7 @@ * (DS12887A) which implemented a "century" register to be * compatible with Y2K. * - * Version: @(#)nvr.c 1.0.9 2017/10/14 + * Version: @(#)nvr.c 1.0.10 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -756,8 +756,8 @@ nvr_path(wchar_t *str) wcscat(temp, NVR_PATH); /* Create the directory if needed. */ - if (! dir_check_exist(temp)) - dir_create(temp); + if (! plat_dir_check(temp)) + plat_dir_create(temp); /* Now append the actual filename. */ #ifdef WIN32 diff --git a/src/pc.c b/src/pc.c index ac0e4ba6c..5a88e5b49 100644 --- a/src/pc.c +++ b/src/pc.c @@ -8,7 +8,7 @@ * * Emulation core dispatcher. * - * Version: @(#)pc.c 1.0.27 2017/10/14 + * Version: @(#)pc.c 1.0.28 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -90,7 +90,7 @@ int insc = 0; float mips, flops; int framecount, fps; int win_title_update = 0; -int updatestatus = 0; +int status_update_needed = 0; int pollmouse_delay = 2; int mousecapture; int suppress_overscan = 0; @@ -149,35 +149,6 @@ fatal(const char *format, ...) } -/* - * This function returns the absolute pathname to a file (str) - * that is to be found in the user (formerly 'nvr_path' area. - */ -wchar_t * -pc_concat(wchar_t *str) -{ - static wchar_t temp[1024]; - - /* Get the full prefix in place. */ - memset(temp, 0x00, sizeof(temp)); - wcscpy(temp, cfg_path); - - /* Create the directory if needed. */ - if (! dir_check_exist(temp)) - dir_create(temp); - - /* Now append the actual filename. */ -#ifdef WIN32 - wcscat(temp, L"\\"); -#else - wcscat(temp, L"/"); -#endif - wcscat(temp, str); - - return(temp); -} - - /* * Perform initial startup of the PC. * @@ -192,8 +163,8 @@ pc_init(int argc, wchar_t *argv[]) int c; /* Grab the executable's full path. */ - get_executable_name(exe_path, sizeof(exe_path)-1); - p = get_filename_w(exe_path); + plat_get_exe_name(exe_path, sizeof(exe_path)-1); + p = plat_get_filename(exe_path); *p = L'\0'; /* @@ -280,11 +251,10 @@ usage: #endif wcscpy(config_file_default, cfg); else - append_filename_w(config_file_default, - cfg_path, cfg, 511); + plat_append_filename(config_file_default, cfg_path, cfg, 511); cfg = NULL; } else { - append_filename_w(config_file_default, cfg_path, CONFIG_FILE_W, 511); + plat_append_filename(config_file_default, cfg_path, CONFIG_FILE_W, 511); } /* @@ -622,6 +592,26 @@ pc_reset_hard(void) } +void +pc_reset(int hard) +{ + plat_pause(1); + + plat_delay_ms(100); + + nvr_save(); + + config_save(); + + if (hard) + pc_reset_hard(); + else + pc_send_cad(); + + plat_pause(0); +} + + void pc_close(void) { @@ -748,7 +738,7 @@ pc_run(void) cpu_notreps = 0; #endif - updatestatus = 1; + status_update_needed = 1; readlnum = writelnum = 0; egareads = egawrites = 0; cycles_lost = 0; @@ -765,7 +755,7 @@ pc_run(void) EMU_NAME_W, EMU_VERSION_W, fps, wmachine, wcpu, (!mousecapture) ? plat_get_string(IDS_2077) : ((mouse_get_type(mouse_type) & MOUSE_TYPE_3BUTTON) ? plat_get_string(IDS_2078) : plat_get_string(IDS_2079))); - set_window_title(temp); + ui_window_title(temp); win_title_update = 0; } diff --git a/src/pic.c b/src/pic.c index 797e16266..9c9639209 100644 --- a/src/pic.c +++ b/src/pic.c @@ -2,6 +2,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "pci.h" diff --git a/src/piix.c b/src/piix.c index 4fbb059d1..c136dde1b 100644 --- a/src/piix.c +++ b/src/piix.c @@ -12,10 +12,11 @@ * word 0 - base address * word 1 - bits 1 - 15 = byte count, bit 31 = end of transfer * - * Version: @(#)piix.c 1.0.5 2017/10/01 + * Version: @(#)piix.c 1.0.6 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, + * * Copyright 2008-2017 Sarah Walker. * Copyright 2016,2017 Miran Grca. */ @@ -23,6 +24,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "dma.h" #include "io.h" diff --git a/src/plat.h b/src/plat.h index ff5c9ed62..9b9f27eb3 100644 --- a/src/plat.h +++ b/src/plat.h @@ -8,7 +8,7 @@ * * Define the various platform support functions. * - * Version: @(#)plat.h 1.0.8 2017/10/15 + * Version: @(#)plat.h 1.0.9 2017/10/16 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -19,13 +19,21 @@ #ifndef EMU_PLAT_H # define EMU_PLAT_H +#ifndef GLOBAL +# define GLOBAL extern +#endif + + +/* A hack (GCC-specific) to allow us to ignore unused parameters. */ +#define UNUSED(arg) __attribute__((unused))arg + #ifdef __cplusplus extern "C" { #endif /* Global variables residing in the platform module. */ -extern int dopause; +GLOBAL int dopause; /* System-related functions. */ @@ -33,13 +41,16 @@ extern FILE *plat_fopen(wchar_t *path, wchar_t *mode); extern void plat_remove(wchar_t *path); extern int plat_getcwd(wchar_t *bufp, int max); extern int plat_chdir(wchar_t *path); -extern void get_executable_name(wchar_t *s, int size); -extern wchar_t *set_window_title(wchar_t *s); -extern int dir_check_exist(wchar_t *path); -extern int dir_create(wchar_t *path); - -extern void leave_fullscreen(void); -extern void plat_pc_reset(int hard); +extern void plat_get_exe_name(wchar_t *s, int size); +extern wchar_t *plat_get_filename(wchar_t *s); +extern wchar_t *plat_get_extension(wchar_t *s); +extern void plat_append_filename(wchar_t *dest, wchar_t *s1, wchar_t *s2, int size); +extern void plat_put_backslash(wchar_t *s); +extern int plat_dir_check(wchar_t *path); +extern int plat_dir_create(wchar_t *path); +extern uint64_t plat_timer_read(void); +extern uint32_t plat_get_ticks(void); +extern void plat_delay_ms(uint32_t count); extern void plat_pause(int p); @@ -98,13 +109,11 @@ extern int thread_release_mutex(mutex_t *mutex); /* Other stuff. */ extern void startblit(void); extern void endblit(void); +extern void updatewindowsize(int x, int y); +extern void uws_natural(void); +extern void leave_fullscreen(void); extern void take_screenshot(void); - -extern uint32_t get_ticks(void); -extern void delay_ms(uint32_t count); - - #ifdef __cplusplus } #endif diff --git a/src/rom.c b/src/rom.c index cc7bf154a..4ab1ee82c 100644 --- a/src/rom.c +++ b/src/rom.c @@ -13,7 +13,7 @@ * - c386sx16 BIOS fails checksum * - the loadfont() calls should be done elsewhere * - * Version: @(#)rom.c 1.0.11 2017/10/14 + * Version: @(#)rom.c 1.0.13 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -28,6 +28,7 @@ #include #include #include +#include "86box.h" #include "config.h" #include "ibm.h" #include "mem.h" @@ -45,7 +46,7 @@ rom_fopen(wchar_t *fn, wchar_t *mode) wchar_t temp[1024]; wcscpy(temp, exe_path); - put_backslash_w(temp); + plat_put_backslash(temp); wcscat(temp, fn); return(plat_fopen(temp, mode)); @@ -58,7 +59,7 @@ rom_getfile(wchar_t *fn, wchar_t *s, int size) FILE *f; wcscpy(s, exe_path); - put_backslash_w(s); + plat_put_backslash(s); wcscat(s, fn); f = plat_fopen(s, L"rb"); diff --git a/src/scsi/scsi_aha154x.c b/src/scsi/scsi_aha154x.c index 970dff1bb..74b272c62 100644 --- a/src/scsi/scsi_aha154x.c +++ b/src/scsi/scsi_aha154x.c @@ -23,6 +23,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mca.h" diff --git a/src/scsi/scsi_bus.c b/src/scsi/scsi_bus.c index 36b8e7e16..5cf516887 100644 --- a/src/scsi/scsi_bus.c +++ b/src/scsi/scsi_bus.c @@ -8,10 +8,10 @@ * * The generic SCSI bus operations handler. * - * Version: @(#)scsi_bus.c 1.0.1 2017/10/04 + * Version: @(#)scsi_bus.c 1.0.2 2017/10/16 * * NOTES: For now ported from PCem with some modifications - * but at least it's a start. + * but at least it's a start. * * Authors: TheCollector1995, */ @@ -21,10 +21,12 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "scsi.h" #include "scsi_device.h" + #define STATE_IDLE 0 #define STATE_COMMAND 1 #define STATE_COMMANDWAIT 2 diff --git a/src/scsi/scsi_buslogic.c b/src/scsi/scsi_buslogic.c index 8c7b22eb5..5b5265cb4 100644 --- a/src/scsi/scsi_buslogic.c +++ b/src/scsi/scsi_buslogic.c @@ -26,6 +26,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mca.h" diff --git a/src/scsi/scsi_device.c b/src/scsi/scsi_device.c index 73e3e0789..214e0c74b 100644 --- a/src/scsi/scsi_device.c +++ b/src/scsi/scsi_device.c @@ -8,10 +8,11 @@ * * The generic SCSI device command handler. * - * Version: @(#)scsi_device.c 1.0.7 2017/10/10 + * Version: @(#)scsi_device.c 1.0.8 2017/10/17 * * Authors: Miran Grca, * Fred N. van Kempen, + * * Copyright 2016,2017 Miran Grca. * Copyright 2017 Fred N. van Kempen. */ @@ -19,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../cdrom/cdrom.h" diff --git a/src/scsi/scsi_disk.c b/src/scsi/scsi_disk.c index 5b2390abc..e03329dd2 100644 --- a/src/scsi/scsi_disk.c +++ b/src/scsi/scsi_disk.c @@ -6,9 +6,10 @@ * * Emulation of SCSI fixed and removable disks. * - * Version: @(#)scsi_disk.c 1.0.16 2017/10/16 + * Version: @(#)scsi_disk.c 1.0.17 2017/10/16 * * Author: Miran Grca, + * * Copyright 2017 Miran Grca. */ #include diff --git a/src/scsi/scsi_ncr5380.c b/src/scsi/scsi_ncr5380.c index 5f2f24ee2..e366b8102 100644 --- a/src/scsi/scsi_ncr5380.c +++ b/src/scsi/scsi_ncr5380.c @@ -9,7 +9,7 @@ * Implementation of the NCR 5380 series of SCSI Host Adapters * made by NCR. These controllers were designed for the ISA bus. * - * Version: @(#)scsi_ncr5380.c 1.0.3 2017/10/10 + * Version: @(#)scsi_ncr5380.c 1.0.4 2017/10/16 * * Authors: Sarah Walker, * TheCollector1995, @@ -20,17 +20,17 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" -#include "../mca.h" -#include "../mem.h" -#include "../mca.h" -#include "../rom.h" -#include "../nvr.h" #include "../dma.h" #include "../pic.h" -#include "../timer.h" +#include "../mca.h" +#include "../mem.h" +#include "../rom.h" +#include "../nvr.h" #include "../device.h" +#include "../timer.h" #include "../plat.h" #include "scsi.h" #include "scsi_device.h" diff --git a/src/scsi/scsi_x54x.c b/src/scsi/scsi_x54x.c index adc646974..f55a34649 100644 --- a/src/scsi/scsi_x54x.c +++ b/src/scsi/scsi_x54x.c @@ -26,18 +26,18 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" +#include "../dma.h" +#include "../pic.h" +#include "../pci.h" #include "../mca.h" #include "../mem.h" -#include "../mca.h" #include "../rom.h" #include "../nvr.h" -#include "../dma.h" -#include "../pci.h" -#include "../pic.h" -#include "../timer.h" #include "../device.h" +#include "../timer.h" #include "../plat.h" #include "scsi.h" #include "scsi_device.h" diff --git a/src/sio_detect.c b/src/sio_detect.c index a51fd9006..ffa6507bd 100644 --- a/src/sio_detect.c +++ b/src/sio_detect.c @@ -2,6 +2,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "floppy/floppy.h" diff --git a/src/sio_fdc37c665.c b/src/sio_fdc37c665.c index c9cef0759..abceb6d2b 100644 --- a/src/sio_fdc37c665.c +++ b/src/sio_fdc37c665.c @@ -8,10 +8,11 @@ * * Implementation of the SMC FDC37C665 Super I/O Chip. * - * Version: @(#)sio_fdc37c665.c 1.0.6 2017/09/30 + * Version: @(#)sio_fdc37c665.c 1.0.7 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, + * * Copyright 2008-2017 Sarah Walker. * Copyright 2016,2017 Miran Grca. */ @@ -19,6 +20,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "device.h" diff --git a/src/sio_fdc37c669.c b/src/sio_fdc37c669.c index bfff245b0..6ac8762cb 100644 --- a/src/sio_fdc37c669.c +++ b/src/sio_fdc37c669.c @@ -8,7 +8,7 @@ * * Implementation of the SMC FDC37C669 Super I/O Chip. * - * Version: @(#)sio_fdc37c669.c 1.0.4 2017/09/30 + * Version: @(#)sio_fdc37c669.c 1.0.5 2017/10/16 * * Author: Miran Grca, * Copyright 2016,2017 Miran Grca. @@ -17,6 +17,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "device.h" diff --git a/src/sio_fdc37c932fr.c b/src/sio_fdc37c932fr.c index 205cfde23..bb165d72a 100644 --- a/src/sio_fdc37c932fr.c +++ b/src/sio_fdc37c932fr.c @@ -8,7 +8,7 @@ * * Implementation of the SMC FDC37C932FR Super I/O Chip. * - * Version: @(#)sio_fdc37c932fr.c 1.0.5 2017/09/30 + * Version: @(#)sio_fdc37c932fr.c 1.0.6 2017/10/16 * * Author: Miran Grca, * Copyright 2016,2017 Miran Grca. @@ -17,6 +17,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "device.h" diff --git a/src/sio_pc87306.c b/src/sio_pc87306.c index c955c372e..8186514e2 100644 --- a/src/sio_pc87306.c +++ b/src/sio_pc87306.c @@ -8,7 +8,7 @@ * * Emulation of the NatSemi PC87306 Super I/O chip. * - * Version: @(#)sio_pc87306.c 1.0.5 2017/09/30 + * Version: @(#)sio_pc87306.c 1.0.6 2017/10/16 * * Author: Miran Grca, * Copyright 2016,2017 Miran Grca. @@ -17,6 +17,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "device.h" diff --git a/src/sio_um8669f.c b/src/sio_um8669f.c index f94d3c92e..9f27fd97b 100644 --- a/src/sio_um8669f.c +++ b/src/sio_um8669f.c @@ -25,6 +25,7 @@ PnP registers : #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "lpt.h" diff --git a/src/sio_w83877f.c b/src/sio_w83877f.c index d63414cc6..65cc05c74 100644 --- a/src/sio_w83877f.c +++ b/src/sio_w83877f.c @@ -11,7 +11,7 @@ * Winbond W83877F Super I/O Chip * Used by the Award 430HX * - * Version: @(#)sio_w83877f.c 1.0.3 2017/09/24 + * Version: @(#)sio_w83877f.c 1.0.4 2017/10/16 * * Author: Miran Grca, * Copyright 2016,2017 Miran Grca. @@ -20,6 +20,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "io.h" #include "mem.h" diff --git a/src/sound/midi.c b/src/sound/midi.c index 1c70b252d..9d07f3b1b 100644 --- a/src/sound/midi.c +++ b/src/sound/midi.c @@ -3,8 +3,9 @@ #include #include #include -#include "../device.h" +#include "../86box.h" #include "../ibm.h" +#include "../device.h" #include "../plat.h" #include "../plat_midi.h" #include "midi.h" @@ -177,10 +178,10 @@ void midi_write(uint8_t val) if (midi_sysex_start) { - passed_ticks = get_ticks() - midi_sysex_start; + passed_ticks = plat_get_ticks() - midi_sysex_start; if (passed_ticks < midi_sysex_delay) { - delay_ms(midi_sysex_delay - passed_ticks); + plat_delay_ms(midi_sysex_delay - passed_ticks); } } @@ -229,7 +230,7 @@ void midi_write(uint8_t val) else midi_sysex_delay = (unsigned int) (((float) (midi_pos) * 1.25f) * 1000.0f / 3125.0f) + 2; - midi_sysex_start = get_ticks(); + midi_sysex_start = plat_get_ticks(); } } } diff --git a/src/sound/midi_fluidsynth.c b/src/sound/midi_fluidsynth.c index cce894675..2e63823a5 100644 --- a/src/sound/midi_fluidsynth.c +++ b/src/sound/midi_fluidsynth.c @@ -6,6 +6,7 @@ #include #include #include +#include "../86box.h" #include "../config.h" #include "../device.h" #include "../plat.h" diff --git a/src/sound/midi_mt32.c b/src/sound/midi_mt32.c index eab3e7dab..d1ddb78bf 100644 --- a/src/sound/midi_mt32.c +++ b/src/sound/midi_mt32.c @@ -4,6 +4,7 @@ #include #include #include "munt/c_interface/c_interface.h" +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../mem.h" diff --git a/src/sound/midi_system.c b/src/sound/midi_system.c index 982049bdc..209889401 100644 --- a/src/sound/midi_system.c +++ b/src/sound/midi_system.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../device.h" #include "../plat.h" #include "../plat_midi.h" diff --git a/src/sound/munt/SampleRateConverter_dummy.cpp b/src/sound/munt/SampleRateConverter_dummy.cpp index 84d51e736..5bef50187 100644 --- a/src/sound/munt/SampleRateConverter_dummy.cpp +++ b/src/sound/munt/SampleRateConverter_dummy.cpp @@ -14,17 +14,20 @@ * along with this program. If not, see . */ +#include +#include +#include "../plat.h" #include "SampleRateConverter.h" #include "Synth.h" using namespace MT32Emu; -static inline void *createDelegate(Synth &synth, double targetSampleRate, SamplerateConversionQuality quality) { +static inline void *createDelegate(UNUSED(Synth &synth), UNUSED(double targetSampleRate), UNUSED(SamplerateConversionQuality quality)) { return 0; } -AnalogOutputMode SampleRateConverter::getBestAnalogOutputMode(double targetSampleRate) { +AnalogOutputMode SampleRateConverter::getBestAnalogOutputMode(UNUSED(double targetSampleRate)) { return AnalogOutputMode_COARSE; } diff --git a/src/sound/munt/config.h b/src/sound/munt/config.h index 9cbdf2bc6..5f5b6c9fb 100644 --- a/src/sound/munt/config.h +++ b/src/sound/munt/config.h @@ -35,4 +35,6 @@ */ #define MT32EMU_EXPORTS_TYPE 3 +#define MT32EMU_API_TYPE 0 + #endif diff --git a/src/sound/openal.c b/src/sound/openal.c index 1c80de8fd..1a0c1a311 100644 --- a/src/sound/openal.c +++ b/src/sound/openal.c @@ -13,6 +13,7 @@ # include # include #endif +#include "../86box.h" #include "../ibm.h" #include "sound.h" diff --git a/src/sound/snd_ad1848.c b/src/sound/snd_ad1848.c index 4a22e4c76..f670b7095 100644 --- a/src/sound/snd_ad1848.c +++ b/src/sound/snd_ad1848.c @@ -7,6 +7,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../dma.h" #include "../pic.h" diff --git a/src/sound/snd_adlib.c b/src/sound/snd_adlib.c index 964d6e475..e297dabaa 100644 --- a/src/sound/snd_adlib.c +++ b/src/sound/snd_adlib.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mca.h" diff --git a/src/sound/snd_adlibgold.c b/src/sound/snd_adlibgold.c index 3c8a76c19..6b015ff0e 100644 --- a/src/sound/snd_adlibgold.c +++ b/src/sound/snd_adlibgold.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../dma.h" diff --git a/src/sound/snd_audiopci.c b/src/sound/snd_audiopci.c index a5eeb752f..5fdbff406 100644 --- a/src/sound/snd_audiopci.c +++ b/src/sound/snd_audiopci.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../io.h" diff --git a/src/sound/snd_cms.c b/src/sound/snd_cms.c index 9f148a57f..ff10b7a57 100644 --- a/src/sound/snd_cms.c +++ b/src/sound/snd_cms.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../device.h" diff --git a/src/sound/snd_emu8k.c b/src/sound/snd_emu8k.c index 0bd4e3122..2c2f61edd 100644 --- a/src/sound/snd_emu8k.c +++ b/src/sound/snd_emu8k.c @@ -6,6 +6,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../io.h" diff --git a/src/sound/snd_gus.c b/src/sound/snd_gus.c index 860c93e77..9c0a84ffb 100644 --- a/src/sound/snd_gus.c +++ b/src/sound/snd_gus.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../pic.h" diff --git a/src/sound/snd_lpt_dac.c b/src/sound/snd_lpt_dac.c index ed424250d..8730c2c8e 100644 --- a/src/sound/snd_lpt_dac.c +++ b/src/sound/snd_lpt_dac.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../lpt.h" diff --git a/src/sound/snd_lpt_dss.c b/src/sound/snd_lpt_dss.c index 8dfb1ddab..a3c914709 100644 --- a/src/sound/snd_lpt_dss.c +++ b/src/sound/snd_lpt_dss.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../timer.h" diff --git a/src/sound/snd_mpu401.c b/src/sound/snd_mpu401.c index 3506764e3..c1e245b16 100644 --- a/src/sound/snd_mpu401.c +++ b/src/sound/snd_mpu401.c @@ -8,12 +8,13 @@ * * Roland MPU-401 emulation. * - * Version: @(#)snd_mpu401.c 1.0.3 2017/10/04 + * Version: @(#)snd_mpu401.c 1.0.4 2017/10/16 * * Authors: Sarah Walker, * DOSBox Team, * Miran Grca, * TheCollector1995, + * * Copyright 2008-2017 Sarah Walker. * Copyright 2008-2017 DOSBox Team. * Copyright 2016,2017 Miran Grca. @@ -24,6 +25,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../io.h" diff --git a/src/sound/snd_opl.c b/src/sound/snd_opl.c index 990769d58..e65a73d52 100644 --- a/src/sound/snd_opl.c +++ b/src/sound/snd_opl.c @@ -6,6 +6,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../timer.h" diff --git a/src/sound/snd_pas16.c b/src/sound/snd_pas16.c index 6a39568dc..234bb7751 100644 --- a/src/sound/snd_pas16.c +++ b/src/sound/snd_pas16.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../pic.h" diff --git a/src/sound/snd_ps1.c b/src/sound/snd_ps1.c index 60a836995..9b62db6bf 100644 --- a/src/sound/snd_ps1.c +++ b/src/sound/snd_ps1.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../pic.h" diff --git a/src/sound/snd_pssj.c b/src/sound/snd_pssj.c index 395717350..763122850 100644 --- a/src/sound/snd_pssj.c +++ b/src/sound/snd_pssj.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../dma.h" diff --git a/src/sound/snd_resid.cc b/src/sound/snd_resid.cc index ef1d32854..a984323bd 100644 --- a/src/sound/snd_resid.cc +++ b/src/sound/snd_resid.cc @@ -3,6 +3,7 @@ #include #include #include "resid-fp/sid.h" +#include "../plat.h" #include "snd_resid.h" @@ -58,14 +59,14 @@ void *sid_init(void) return (void *)psid; } -void sid_close(void *p) +void sid_close(UNUSED(void *p)) { // psid_t *psid = (psid_t *)p; delete psid->sid; // free(psid); } -void sid_reset(void *p) +void sid_reset(UNUSED(void *p)) { // psid_t *psid = (psid_t *)p; int c; @@ -77,7 +78,7 @@ void sid_reset(void *p) } -uint8_t sid_read(uint16_t addr, void *p) +uint8_t sid_read(uint16_t addr, UNUSED(void *p)) { // psid_t *psid = (psid_t *)p; @@ -85,7 +86,7 @@ uint8_t sid_read(uint16_t addr, void *p) // return 0xFF; } -void sid_write(uint16_t addr, uint8_t val, void *p) +void sid_write(uint16_t addr, uint8_t val, UNUSED(void *p)) { // psid_t *psid = (psid_t *)p; @@ -102,7 +103,7 @@ static void fillbuf2(int& count, int16_t *buf, int len) *buf = psid->last_sample; psid->last_sample = *buf; } -void sid_fillbuf(int16_t *buf, int len, void *p) +void sid_fillbuf(int16_t *buf, int len, UNUSED(void *p)) { // psid_t *psid = (psid_t *)p; int x = CLOCK_DELTA(len); diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index 05d5e179e..f1f8c6536 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -8,11 +8,12 @@ * * Sound Blaster emulation. * - * Version: @(#)sound_sb.c 1.0.2 2017/10/04 + * Version: @(#)sound_sb.c 1.0.3 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, * TheCollector1995, + * * Copyright 2008-2017 Sarah Walker. * Copyright 2016,2017 Miran Grca. */ @@ -21,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mca.h" diff --git a/src/sound/snd_sb_dsp.c b/src/sound/snd_sb_dsp.c index e26c93f78..e1216769d 100644 --- a/src/sound/snd_sb_dsp.c +++ b/src/sound/snd_sb_dsp.c @@ -9,6 +9,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../pic.h" diff --git a/src/sound/snd_sn76489.c b/src/sound/snd_sn76489.c index 7f7d02f2f..09cbe28e4 100644 --- a/src/sound/snd_sn76489.c +++ b/src/sound/snd_sn76489.c @@ -4,6 +4,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../device.h" diff --git a/src/sound/snd_speaker.c b/src/sound/snd_speaker.c index 44d576941..3109d66e8 100644 --- a/src/sound/snd_speaker.c +++ b/src/sound/snd_speaker.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "sound.h" #include "snd_speaker.h" diff --git a/src/sound/snd_ssi2001.c b/src/sound/snd_ssi2001.c index cba259422..8161b4153 100644 --- a/src/sound/snd_ssi2001.c +++ b/src/sound/snd_ssi2001.c @@ -3,6 +3,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../device.h" diff --git a/src/sound/snd_wss.c b/src/sound/snd_wss.c index 7c47f38e4..c247c9903 100644 --- a/src/sound/snd_wss.c +++ b/src/sound/snd_wss.c @@ -8,6 +8,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../pic.h" diff --git a/src/sound/snd_ym7128.c b/src/sound/snd_ym7128.c index 354b8b3b0..7a74eac01 100644 --- a/src/sound/snd_ym7128.c +++ b/src/sound/snd_ym7128.c @@ -2,6 +2,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "snd_ym7128.h" diff --git a/src/sound/sound.c b/src/sound/sound.c index 2d3afd6d0..aa8b6c570 100644 --- a/src/sound/sound.c +++ b/src/sound/sound.c @@ -8,7 +8,7 @@ * * Sound emulation core. * - * Version: @(#)sound.c 1.0.5 2017/10/10 + * Version: @(#)sound.c 1.0.6 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../timer.h" diff --git a/src/timer.c b/src/timer.c index 8313ebed6..6a7128f61 100644 --- a/src/timer.c +++ b/src/timer.c @@ -2,6 +2,7 @@ #include #include #include +#include "86box.h" #include "ibm.h" #include "timer.h" diff --git a/src/ui.h b/src/ui.h index 6b32fd7d4..52f675e7d 100644 --- a/src/ui.h +++ b/src/ui.h @@ -8,7 +8,7 @@ * * Define the various UI functions. * - * Version: @(#)ui.h 1.0.3 2017/10/14 + * Version: @(#)ui.h 1.0.4 2017/10/16 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -51,6 +51,7 @@ extern int ui_msgbox(int type, void *arg); #define SB_NETWORK 0x50 #define SB_TEXT 0x60 +extern wchar_t *ui_window_title(wchar_t *s); extern int ui_sb_find_part(int tag); extern void ui_sb_update_panes(void); extern void ui_sb_update_tip(int meaning); diff --git a/src/video/vid_ati18800.c b/src/video/vid_ati18800.c index 8794af217..ae1cec1d0 100644 --- a/src/video/vid_ati18800.c +++ b/src/video/vid_ati18800.c @@ -8,7 +8,7 @@ * * ATI 18800 emulation (VGA Edge-16) * - * Version: @(#)vid_ati18800.c 1.0.1 2017/10/10 + * Version: @(#)vid_ati18800.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_ati28800.c b/src/video/vid_ati28800.c index 99709def8..e2a99e0d8 100644 --- a/src/video/vid_ati28800.c +++ b/src/video/vid_ati28800.c @@ -8,7 +8,7 @@ * * ATI 28800 emulation (VGA Charger) * - * Version: @(#)vid_ati28800.c 1.0.1 2017/10/10 + * Version: @(#)vid_ati28800.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_ati68860_ramdac.c b/src/video/vid_ati68860_ramdac.c index c82dbc4bc..a304cd0d2 100644 --- a/src/video/vid_ati68860_ramdac.c +++ b/src/video/vid_ati68860_ramdac.c @@ -28,7 +28,7 @@ * 7 If set can remove "snow" in some cases * (A860_Delay_L ?) ?? * - * Version: @(#)vid_ati68860.c 1.0.1 2017/10/10 + * Version: @(#)vid_ati68860.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -40,6 +40,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "video.h" diff --git a/src/video/vid_ati_eeprom.c b/src/video/vid_ati_eeprom.c index b2d5ae6c8..8ecb25e8e 100644 --- a/src/video/vid_ati_eeprom.c +++ b/src/video/vid_ati_eeprom.c @@ -8,7 +8,7 @@ * * Emulation of the EEPROM on select ATI cards. * - * Version: @(#)vid_ati_eeprom.c 1.0.1 2017/10/10 + * Version: @(#)vid_ati_eeprom.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -20,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "../nvr.h" diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index 3f707d8cf..a4d2f8ef1 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -8,7 +8,7 @@ * * ATi Mach64 graphics card emulation. * - * Version: @(#)vid_ati_mach64.c 1.0.4 2017/10/10 + * Version: @(#)vid_ati_mach64.c 1.0.5 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../io.h" @@ -879,7 +880,7 @@ static void fifo_thread(void *param) mach64->blitter_busy = 1; while (!FIFO_EMPTY) { - uint64_t start_time = timer_read(); + uint64_t start_time = plat_timer_read(); uint64_t end_time; fifo_entry_t *fifo = &mach64->fifo[mach64->fifo_read_idx & FIFO_MASK]; @@ -902,7 +903,7 @@ static void fifo_thread(void *param) if (FIFO_ENTRIES > 0xe000) thread_set_event(mach64->fifo_not_full_event); - end_time = timer_read(); + end_time = plat_timer_read(); mach64->blitter_time += end_time - start_time; } mach64->blitter_busy = 0; @@ -3422,7 +3423,7 @@ void mach64_add_status_info(char *s, int max_len, void *p) { mach64_t *mach64 = (mach64_t *)p; char temps[256]; - uint64_t new_time = timer_read(); + uint64_t new_time = plat_timer_read(); uint64_t status_diff = new_time - mach64->status_time; mach64->status_time = new_time; diff --git a/src/video/vid_bt485_ramdac.c b/src/video/vid_bt485_ramdac.c index ee97b6d60..1957d05b9 100644 --- a/src/video/vid_bt485_ramdac.c +++ b/src/video/vid_bt485_ramdac.c @@ -11,7 +11,7 @@ * Currently only a dummy stub for logging and passing output * to the generic SVGA handler. * - * Version: @(#)vid_bt485_ramdac.c 1.0.1 2017/10/10 + * Version: @(#)vid_bt485_ramdac.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -23,6 +23,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "video.h" diff --git a/src/video/vid_cga.c b/src/video/vid_cga.c index 384a0a5c5..05dc6710b 100644 --- a/src/video/vid_cga.c +++ b/src/video/vid_cga.c @@ -8,7 +8,7 @@ * * Emulation of the old and new IBM CGA graphics cards. * - * Version: @(#)vid_cga.c 1.0.5 2017/10/13 + * Version: @(#)vid_cga.c 1.0.5 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_cga_comp.c b/src/video/vid_cga_comp.c index 407e38726..da99a2442 100644 --- a/src/video/vid_cga_comp.c +++ b/src/video/vid_cga_comp.c @@ -9,7 +9,7 @@ * IBM CGA composite filter, borrowed from reenigne's DOSBox * patch and ported to C. * - * Version: @(#)vid_cga_comp.c 1.0.2 2017/10/10 + * Version: @(#)vid_cga_comp.c 1.0.2 2017/10/16 * * Authors: reenigne, * Miran Grca, @@ -23,6 +23,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../mem.h" diff --git a/src/video/vid_cl_gd.c b/src/video/vid_cl_gd.c index ffb58f4b3..0627301b5 100644 --- a/src/video/vid_cl_gd.c +++ b/src/video/vid_cl_gd.c @@ -8,7 +8,7 @@ * * Emulation of select Cirrus Logic cards. * - * Version: @(#)vid_cl_gd.c 1.0.1 2017/10/10 + * Version: @(#)vid_cl_gd.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_cl_gd_blit.c b/src/video/vid_cl_gd_blit.c index 28c58b692..2e4706f20 100644 --- a/src/video/vid_cl_gd_blit.c +++ b/src/video/vid_cl_gd_blit.c @@ -8,7 +8,7 @@ * * This is the CL-GD 5446 blitter, directly from QEMU. * - * Version: @(#)vid_cl_gd_blit.c 1.0.1 2017/10/10 + * Version: @(#)vid_cl_gd_blit.c 1.0.1 2017/10/16 * * Author: Miran Grca, * @@ -19,6 +19,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_cl_ramdac.c b/src/video/vid_cl_ramdac.c index d33d0a7eb..4a9644ff6 100644 --- a/src/video/vid_cl_ramdac.c +++ b/src/video/vid_cl_ramdac.c @@ -8,7 +8,7 @@ * * Emulation of the Cirrus Logic RAMDAC. * - * Version: @(#)vid_cl_ramdac.c 1.0.1 2017/10/10 + * Version: @(#)vid_cl_ramdac.c 1.0.1 2017/10/16 * * Author: Miran Grca, * @@ -18,6 +18,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "../rom.h" diff --git a/src/video/vid_colorplus.c b/src/video/vid_colorplus.c index df85e2f9e..cd220e702 100644 --- a/src/video/vid_colorplus.c +++ b/src/video/vid_colorplus.c @@ -8,7 +8,7 @@ * * Plantronics ColorPlus emulation. * - * Version: @(#)vid_colorplus.c 1.0.1 2017/10/10 + * Version: @(#)vid_colorplus.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_ega.c b/src/video/vid_ega.c index b199431f1..b5c2d1bdd 100644 --- a/src/video/vid_ega.c +++ b/src/video/vid_ega.c @@ -9,7 +9,7 @@ * Emulation of the EGA, Chips & Technologies SuperEGA, and * AX JEGA graphics cards. * - * Version: @(#)vid_ega.c 1.0.6 2017/10/10 + * Version: @(#)vid_ega.c 1.0.6 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -23,6 +23,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_ega_render.c b/src/video/vid_ega_render.c index 2e6ca4357..be7429a72 100644 --- a/src/video/vid_ega_render.c +++ b/src/video/vid_ega_render.c @@ -8,7 +8,7 @@ * * EGA renderers. * - * Version: @(#)vid_ega_render.c 1.0.3 2017/10/10 + * Version: @(#)vid_ega_render.c 1.0.3 2017/10/16 * * Author: Sarah Walker, * Miran Grca, @@ -20,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../mem.h" diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c index 3b809da20..23ba00c7a 100644 --- a/src/video/vid_et4000.c +++ b/src/video/vid_et4000.c @@ -8,7 +8,7 @@ * * Emulation of the Tseng Labs ET4000. * - * Version: @(#)vid_et4000.c 1.0.1 2017/10/10 + * Version: @(#)vid_et4000.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_et4000w32.c b/src/video/vid_et4000w32.c index fda5e2ff1..edec65dff 100644 --- a/src/video/vid_et4000w32.c +++ b/src/video/vid_et4000w32.c @@ -10,7 +10,7 @@ * * Known bugs: Accelerator doesn't work in planar modes * - * Version: @(#)vid_et4000w32.c 1.0.1 2017/10/10 + * Version: @(#)vid_et4000w32.c 1.0.2 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -23,6 +23,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" @@ -470,7 +471,7 @@ static void fifo_thread(void *param) et4000->blitter_busy = 1; while (!FIFO_EMPTY) { - start_time = timer_read(); + start_time = plat_timer_read(); fifo = &et4000->fifo[et4000->fifo_read_idx & FIFO_MASK]; switch (fifo->addr_type & FIFO_TYPE) @@ -489,7 +490,7 @@ static void fifo_thread(void *param) if (FIFO_ENTRIES > 0xe000) thread_set_event(et4000->fifo_not_full_event); - end_time = timer_read(); + end_time = plat_timer_read(); et4000->blitter_time += end_time - start_time; } et4000->blitter_busy = 0; @@ -1243,7 +1244,7 @@ void et4000w32p_add_status_info(char *s, int max_len, void *p) { et4000w32p_t *et4000 = (et4000w32p_t *)p; char temps[256]; - uint64_t new_time = timer_read(); + uint64_t new_time = plat_timer_read(); uint64_t status_diff = new_time - et4000->status_time; et4000->status_time = new_time; diff --git a/src/video/vid_et4000w32i.c b/src/video/vid_et4000w32i.c index d4208eaa2..7e382d819 100644 --- a/src/video/vid_et4000w32i.c +++ b/src/video/vid_et4000w32i.c @@ -26,6 +26,7 @@ #include #include #include +#include "../86box.h" #include "ibm.h" int et4k_b8000; diff --git a/src/video/vid_genius.c b/src/video/vid_genius.c index de2ac599c..d06472887 100644 --- a/src/video/vid_genius.c +++ b/src/video/vid_genius.c @@ -8,7 +8,7 @@ * * MDSI Genius VHR emulation. * - * Version: @(#)vid_genius.c 1.0.1 2017/10/10 + * Version: @(#)vid_genius.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_hercules.c b/src/video/vid_hercules.c index 0329c9b7a..24e685ce6 100644 --- a/src/video/vid_hercules.c +++ b/src/video/vid_hercules.c @@ -8,7 +8,7 @@ * * Hercules emulation. * - * Version: @(#)vid_hercules.c 1.0.2 2017/10/13 + * Version: @(#)vid_hercules.c 1.0.2 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "../rom.h" diff --git a/src/video/vid_herculesplus.c b/src/video/vid_herculesplus.c index c9ef61bd9..89ad4450b 100644 --- a/src/video/vid_herculesplus.c +++ b/src/video/vid_herculesplus.c @@ -8,7 +8,7 @@ * * Hercules InColor emulation. * - * Version: @(#)vid_herculesplus.c 1.0.1 2017/10/10 + * Version: @(#)vid_herculesplus.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_icd2061.c b/src/video/vid_icd2061.c index 1292752b0..644534ed4 100644 --- a/src/video/vid_icd2061.c +++ b/src/video/vid_icd2061.c @@ -10,7 +10,7 @@ * * Used by ET4000w32/p (Diamond Stealth 32) * - * Version: @(#)vid_icd2061.c 1.0.1 2017/10/10 + * Version: @(#)vid_icd2061.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "vid_icd2061.h" diff --git a/src/video/vid_ics2595.c b/src/video/vid_ics2595.c index eb2aaf4a1..f4b36ef4e 100644 --- a/src/video/vid_ics2595.c +++ b/src/video/vid_ics2595.c @@ -8,7 +8,7 @@ * * ICS2595 clock chip emulation. Used by ATI Mach64. * - * Version: @(#)vid_ics2595.c 1.0.1 2017/10/10 + * Version: @(#)vid_ics2595.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -20,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "vid_ics2595.h" diff --git a/src/video/vid_incolor.c b/src/video/vid_incolor.c index 6fdee5417..d65d0bc59 100644 --- a/src/video/vid_incolor.c +++ b/src/video/vid_incolor.c @@ -8,7 +8,7 @@ * * Hercules InColor emulation. * - * Version: @(#)vid_incolor.c 1.0.1 2017/10/10 + * Version: @(#)vid_incolor.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_mda.c b/src/video/vid_mda.c index 942425cda..7d36b73a8 100644 --- a/src/video/vid_mda.c +++ b/src/video/vid_mda.c @@ -8,7 +8,7 @@ * * MDA emulation. * - * Version: @(#)vid_mda.c 1.0.2 2017/10/13 + * Version: @(#)vid_mda.c 1.0.2 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_nv_riva128.c b/src/video/vid_nv_riva128.c index 368d87d52..1e16a743b 100644 --- a/src/video/vid_nv_riva128.c +++ b/src/video/vid_nv_riva128.c @@ -8,7 +8,7 @@ * * nVidia RIVA 128 emulation. * - * Version: @(#)vid_nv_riva128.c 1.0.1 2017/10/10 + * Version: @(#)vid_nv_riva128.c 1.0.1 2017/10/16 * * Author: Melissa Goad * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_olivetti_m24.c b/src/video/vid_olivetti_m24.c index 5db33a6d2..91d6e52b8 100644 --- a/src/video/vid_olivetti_m24.c +++ b/src/video/vid_olivetti_m24.c @@ -8,7 +8,7 @@ * * Olivetti M24 video emulation- essentially double-res CGA. * - * Version: @(#)vid_olivetti_m24.c 1.0.1 2017/10/10 + * Version: @(#)vid_olivetti_m24.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_oti067.c b/src/video/vid_oti067.c index 4b0c45135..aaea70e4e 100644 --- a/src/video/vid_oti067.c +++ b/src/video/vid_oti067.c @@ -8,7 +8,7 @@ * * Oak OTI067/077 emulation. * - * Version: @(#)vid_oti067.c 1.0.1 2017/10/10 + * Version: @(#)vid_oti067.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_paradise.c b/src/video/vid_paradise.c index 744341afc..1090b6c97 100644 --- a/src/video/vid_paradise.c +++ b/src/video/vid_paradise.c @@ -10,7 +10,7 @@ * PC2086, PC3086 use PVGA1A * MegaPC uses W90C11A * - * Version: @(#)vid_paradise.c 1.0.1 2017/10/10 + * Version: @(#)vid_paradise.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -23,6 +23,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_pc1512.c b/src/video/vid_pc1512.c index 5bfce6251..1e5a616da 100644 --- a/src/video/vid_pc1512.c +++ b/src/video/vid_pc1512.c @@ -15,7 +15,7 @@ * time as between 12 and 46 cycles. We currently always use * the lower number. * - * Version: @(#)vid_pc1512.c 1.0.1 2017/10/10 + * Version: @(#)vid_pc1512.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -28,6 +28,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_pc1640.c b/src/video/vid_pc1640.c index 77e4d0940..970f35e06 100644 --- a/src/video/vid_pc1640.c +++ b/src/video/vid_pc1640.c @@ -9,7 +9,7 @@ * PC1640 video emulation. * Mostly standard EGA, but with CGA & Hercules emulation. * - * Version: @(#)vid_pc1640.c 1.0.1 2017/10/10 + * Version: @(#)vid_pc1640.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_pc200.c b/src/video/vid_pc200.c index 32811e8ea..179926b7e 100644 --- a/src/video/vid_pc200.c +++ b/src/video/vid_pc200.c @@ -10,7 +10,7 @@ * CGA with some NMI stuff. But we don't need that as it's only * used for TV and LCD displays, and we're emulating a CRT. * - * Version: @(#)vid_pc200.c 1.0.1 2017/10/10 + * Version: @(#)vid_pc200.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -23,6 +23,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_pcjr.c b/src/video/vid_pcjr.c index 7610a5db7..43bcc580d 100644 --- a/src/video/vid_pcjr.c +++ b/src/video/vid_pcjr.c @@ -8,7 +8,7 @@ * * Video emulation for IBM PCjr. * - * Version: @(#)vid_pcjr.c 1.0.1 2017/10/10 + * Version: @(#)vid_pcjr.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_ps1_svga.c b/src/video/vid_ps1_svga.c index 93aff8732..54bc2426d 100644 --- a/src/video/vid_ps1_svga.c +++ b/src/video/vid_ps1_svga.c @@ -16,7 +16,7 @@ * drivers for any operating system and there is no VBE * implementation, so it's just a VGA for now. * - * Version: @(#)vid_ps1_svga.c 1.0.1 2017/10/10 + * Version: @(#)vid_ps1_svga.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -29,6 +29,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index 11c0221a1..232257038 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -8,7 +8,7 @@ * * S3 emulation. * - * Version: @(#)vid_s3.c 1.0.1 2017/10/10 + * Version: @(#)vid_s3.c 1.0.2 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../io.h" @@ -711,7 +712,7 @@ static void fifo_thread(void *param) s3->blitter_busy = 1; while (!FIFO_EMPTY) { - uint64_t start_time = timer_read(); + uint64_t start_time = plat_timer_read(); uint64_t end_time; fifo_entry_t *fifo = &s3->fifo[s3->fifo_read_idx & FIFO_MASK]; @@ -743,7 +744,7 @@ static void fifo_thread(void *param) if (FIFO_ENTRIES > 0xe000) thread_set_event(s3->fifo_not_full_event); - end_time = timer_read(); + end_time = plat_timer_read(); s3->blitter_time += end_time - start_time; } s3->blitter_busy = 0; @@ -2357,7 +2358,7 @@ static void s3_add_status_info(char *s, int max_len, void *p) { s3_t *s3 = (s3_t *)p; char temps[256]; - uint64_t new_time = timer_read(); + uint64_t new_time = plat_timer_read(); uint64_t status_diff = new_time - s3->status_time; s3->status_time = new_time; diff --git a/src/video/vid_s3_virge.c b/src/video/vid_s3_virge.c index b8937a349..180e93af7 100644 --- a/src/video/vid_s3_virge.c +++ b/src/video/vid_s3_virge.c @@ -8,7 +8,7 @@ * * S3 ViRGE emulation. * - * Version: @(#)vid_s3_virge.c 1.0.1 2017/10/10 + * Version: @(#)vid_s3_virge.c 1.0.2 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" @@ -956,7 +957,7 @@ static void fifo_thread(void *param) virge->virge_busy = 1; while (!FIFO_EMPTY) { - uint64_t start_time = timer_read(); + uint64_t start_time = plat_timer_read(); uint64_t end_time; fifo_entry_t *fifo = &virge->fifo[virge->fifo_read_idx & FIFO_MASK]; uint32_t val = fifo->val; @@ -1287,7 +1288,7 @@ static void fifo_thread(void *param) if (FIFO_ENTRIES > 0xe000) thread_set_event(virge->fifo_not_full_event); - end_time = timer_read(); + end_time = plat_timer_read(); virge_time += end_time - start_time; } virge->virge_busy = 0; @@ -3168,7 +3169,7 @@ static void s3_virge_triangle(virge_t *virge, s3d_t *s3d_tri) uint32_t tex_base; int c; - uint64_t start_time = timer_read(); + uint64_t start_time = plat_timer_read(); uint64_t end_time; state.tbu = s3d_tri->tbu << 11; @@ -3296,7 +3297,7 @@ static void s3_virge_triangle(virge_t *virge, s3d_t *s3d_tri) virge->tri_count++; - end_time = timer_read(); + end_time = plat_timer_read(); virge_time += end_time - start_time; } @@ -4136,7 +4137,7 @@ static void s3_virge_add_status_info(char *s, int max_len, void *p) { virge_t *virge = (virge_t *)p; char temps[256]; - uint64_t new_time = timer_read(); + uint64_t new_time = plat_timer_read(); uint64_t status_diff = new_time - status_time; status_time = new_time; diff --git a/src/video/vid_sc1502x_ramdac.c b/src/video/vid_sc1502x_ramdac.c index 3ef8830ac..afb1a6a1d 100644 --- a/src/video/vid_sc1502x_ramdac.c +++ b/src/video/vid_sc1502x_ramdac.c @@ -10,7 +10,7 @@ * * Used by the TLIVESA1 driver for ET4000. * - * Version: @(#)vid_sc1502x_ramdac.c 1.0.1 2017/10/10 + * Version: @(#)vid_sc1502x_ramdac.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "video.h" diff --git a/src/video/vid_sdac_ramdac.c b/src/video/vid_sdac_ramdac.c index 2dbcdabbf..9d78e8815 100644 --- a/src/video/vid_sdac_ramdac.c +++ b/src/video/vid_sdac_ramdac.c @@ -10,7 +10,7 @@ * * Misidentifies as AT&T 21C504. * - * Version: @(#)vid_sdac_ramdac.c 1.0.1 2017/10/10 + * Version: @(#)vid_sdac_ramdac.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "video.h" diff --git a/src/video/vid_stg_ramdac.c b/src/video/vid_stg_ramdac.c index a2200163a..8029b4ad2 100644 --- a/src/video/vid_stg_ramdac.c +++ b/src/video/vid_stg_ramdac.c @@ -8,7 +8,7 @@ * * STG1702 true colour RAMDAC emulation. * - * Version: @(#)vid_stg_ramdac.c 1.0.1 2017/10/10 + * Version: @(#)vid_stg_ramdac.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -20,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "video.h" diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index 27e61cbc4..c9ee4119d 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -11,7 +11,7 @@ * This is intended to be used by another SVGA driver, * and not as a card in it's own right. * - * Version: @(#)vid_svga.c 1.0.5 2017/10/10 + * Version: @(#)vid_svga.c 1.0.5 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -24,6 +24,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_svga_render.c b/src/video/vid_svga_render.c index 145e26a26..216efed29 100644 --- a/src/video/vid_svga_render.c +++ b/src/video/vid_svga_render.c @@ -8,7 +8,7 @@ * * SVGA renderers. * - * Version: @(#)vid_svga_render.c 1.0.2 2017/10/10 + * Version: @(#)vid_svga_render.c 1.0.2 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -20,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "video.h" diff --git a/src/video/vid_table.c b/src/video/vid_table.c index 6dc7307bb..efd714747 100644 --- a/src/video/vid_table.c +++ b/src/video/vid_table.c @@ -8,7 +8,7 @@ * * Define all known video cards. * - * Version: @(#)vid_table.c 1.0.2 2017/10/14 + * Version: @(#)vid_table.c 1.0.2 2017/10/16 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "../rom.h" diff --git a/src/video/vid_tandy.c b/src/video/vid_tandy.c index a83e32377..f703efb43 100644 --- a/src/video/vid_tandy.c +++ b/src/video/vid_tandy.c @@ -8,7 +8,7 @@ * * Emulation of the Tandy Model 1000 video. * - * Version: @(#)vid_tandy.c 1.0.1 2017/10/10 + * Version: @(#)vid_tandy.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_tandysl.c b/src/video/vid_tandysl.c index 84d21a3f7..f09590ad1 100644 --- a/src/video/vid_tandysl.c +++ b/src/video/vid_tandysl.c @@ -8,7 +8,7 @@ * * Emulation of the Tandy Model 1000/SL video. * - * Version: @(#)vid_tandysl.c 1.0.1 2017/10/10 + * Version: @(#)vid_tandysl.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_tgui9440.c b/src/video/vid_tgui9440.c index a51922a28..e540423b3 100644 --- a/src/video/vid_tgui9440.c +++ b/src/video/vid_tgui9440.c @@ -8,7 +8,7 @@ * * Trident TGUI9440 emulation. * - * Version: @(#)vid_tgui9440.c 1.0.1 2017/10/10 + * Version: @(#)vid_tgui9440.c 1.0.2 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" @@ -1029,7 +1030,7 @@ static void fifo_thread(void *param) tgui->blitter_busy = 1; while (!FIFO_EMPTY) { - start_time = timer_read(); + start_time = plat_timer_read(); fifo = &tgui->fifo[tgui->fifo_read_idx & FIFO_MASK]; switch (fifo->addr_type & FIFO_TYPE) @@ -1054,7 +1055,7 @@ static void fifo_thread(void *param) if (FIFO_ENTRIES > 0xe000) thread_set_event(tgui->fifo_not_full_event); - end_time = timer_read(); + end_time = plat_timer_read(); tgui->blitter_time += end_time - start_time; } tgui->blitter_busy = 0; @@ -1258,7 +1259,7 @@ void tgui_add_status_info(char *s, int max_len, void *p) { tgui_t *tgui = (tgui_t *)p; char temps[256]; - uint64_t new_time = timer_read(); + uint64_t new_time = plat_timer_read(); uint64_t status_diff = new_time - tgui->status_time; tgui->status_time = new_time; diff --git a/src/video/vid_tkd8001_ramdac.c b/src/video/vid_tkd8001_ramdac.c index 123c9e118..f4429e216 100644 --- a/src/video/vid_tkd8001_ramdac.c +++ b/src/video/vid_tkd8001_ramdac.c @@ -8,7 +8,7 @@ * * Trident TKD8001 RAMDAC emulation. * - * Version: @(#)vid_tkd8001_ramdac.c 1.0.1 2017/10/10 + * Version: @(#)vid_tkd8001_ramdac.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -20,6 +20,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "video.h" diff --git a/src/video/vid_tvga.c b/src/video/vid_tvga.c index 1112fd3fb..b7c525989 100644 --- a/src/video/vid_tvga.c +++ b/src/video/vid_tvga.c @@ -8,7 +8,7 @@ * * Trident TVGA (8900D) emulation. * - * Version: @(#)vid_tvga.c 1.0.1 2017/10/10 + * Version: @(#)vid_tvga.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_vga.c b/src/video/vid_vga.c index f11a4a81a..e0598f7b8 100644 --- a/src/video/vid_vga.c +++ b/src/video/vid_vga.c @@ -8,7 +8,7 @@ * * IBM VGA emulation. * - * Version: @(#)vid_vga.c 1.0.1 2017/10/10 + * Version: @(#)vid_vga.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/video/vid_voodoo.c b/src/video/vid_voodoo.c index 1fd3e7ab2..cf9b74062 100644 --- a/src/video/vid_voodoo.c +++ b/src/video/vid_voodoo.c @@ -8,7 +8,7 @@ * * Emulation of the 3DFX Voodoo Graphics controller. * - * Version: @(#)vid_voodoo.c 1.0.2 2017/10/11 + * Version: @(#)vid_voodoo.c 1.0.3 2017/10/16 * * Authors: Sarah Walker, * leilei @@ -22,6 +22,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../cpu/cpu.h" #include "../device.h" @@ -3489,7 +3490,7 @@ static void render_thread(void *param, int odd_even) while (!(odd_even ? PARAM_EMPTY_2 : PARAM_EMPTY_1)) { - uint64_t start_time = timer_read(); + uint64_t start_time = plat_timer_read(); uint64_t end_time; voodoo_params_t *params = &voodoo->params_buffer[voodoo->params_read_idx[odd_even] & PARAM_MASK]; @@ -3500,7 +3501,7 @@ static void render_thread(void *param, int odd_even) if ((odd_even ? PARAM_ENTRIES_2 : PARAM_ENTRIES_1) > (PARAM_SIZE - 10)) thread_set_event(voodoo->render_not_full_event[odd_even]); - end_time = timer_read(); + end_time = plat_timer_read(); voodoo->render_time[odd_even] += end_time - start_time; } @@ -6494,7 +6495,7 @@ static void fifo_thread(void *param) voodoo->voodoo_busy = 1; while (!FIFO_EMPTY) { - uint64_t start_time = timer_read(); + uint64_t start_time = plat_timer_read(); uint64_t end_time; fifo_entry_t *fifo = &voodoo->fifo[voodoo->fifo_read_idx & FIFO_MASK]; @@ -6522,13 +6523,13 @@ static void fifo_thread(void *param) if (FIFO_ENTRIES > 0xe000) thread_set_event(voodoo->fifo_not_full_event); - end_time = timer_read(); + end_time = plat_timer_read(); voodoo->time += end_time - start_time; } while (voodoo->cmdfifo_depth_rd != voodoo->cmdfifo_depth_wr) { - uint64_t start_time = timer_read(); + uint64_t start_time = plat_timer_read(); uint64_t end_time; uint32_t header = cmdfifo_get(voodoo); uint32_t addr; @@ -6698,7 +6699,7 @@ static void fifo_thread(void *param) pclog("Bad CMDFIFO packet %08x %08x\n", header, voodoo->cmdfifo_rp); } - end_time = timer_read(); + end_time = plat_timer_read(); voodoo->time += end_time - start_time; } voodoo->voodoo_busy = 0; @@ -7388,7 +7389,7 @@ static void voodoo_add_status_info(char *s, int max_len, void *p) int texel_count_current[2]; int texel_count_total; int render_time[2]; - uint64_t new_time = timer_read(); + uint64_t new_time = plat_timer_read(); uint64_t status_diff = new_time - status_time; status_time = new_time; diff --git a/src/video/vid_wy700.c b/src/video/vid_wy700.c index 1cf02cb6c..cbcf404b7 100644 --- a/src/video/vid_wy700.c +++ b/src/video/vid_wy700.c @@ -8,7 +8,7 @@ * * Wyse-700 emulation. * - * Version: @(#)vid_wy700.c 1.0.1 2017/10/10 + * Version: @(#)vid_wy700.c 1.0.1 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -21,6 +21,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../io.h" #include "../mem.h" diff --git a/src/win/win.c b/src/win/win.c index ab12e005d..c034c0e3f 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -8,7 +8,7 @@ * * The Emulator's Windows core. * - * Version: @(#)win.c 1.0.24 2017/10/14 + * Version: @(#)win.c 1.0.25 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -38,8 +38,8 @@ #include "../86box.h" #include "../config.h" #include "../ibm.h" -#include "../mem.h" -#include "../rom.h" +#include "../mem.h" // because of load_config +#include "../rom.h" // because of load_config #include "../device.h" #include "../nvr.h" #include "../mouse.h" @@ -50,9 +50,9 @@ #include "../scsi/scsi.h" #include "../network/network.h" #include "../video/video.h" -#include "../video/vid_ega.h" +#include "../video/vid_ega.h" // for update_overscan #include "../sound/sound.h" -#include "../sound/snd_dbopl.h" +#define GLOBAL #include "../plat.h" #include "../plat_keyboard.h" #include "../plat_mouse.h" @@ -74,7 +74,7 @@ typedef struct { } rc_str_t; -extern int updatestatus; +extern int status_update_needed; /* Public data, more or less non-specific to platform. */ @@ -84,9 +84,7 @@ int winsizex = 640, winsizey = 480; int efwinsizey = 480; int gfx_present[GFX_MAX]; -int infocus = 1; int drawits = 0; -int quited = 0; int mousecapture = 0; uint64_t main_time; @@ -98,6 +96,7 @@ HINSTANCE hinstance; HICON hIcon[512]; RECT oldclip; LCID dwLanguage; +int infocus = 1; int recv_key[272]; uint32_t dwLangID, dwSubLangID; @@ -114,11 +113,11 @@ static RAWINPUTDEVICE device; static HHOOK hKeyboardHook; static int hook_enabled = 0; static int save_window_pos = 0; -static int win_doresize = 0; +static int doresize = 0; +static int quited; static int leave_fullscreen_flag = 0; static int unscaled_size_x = 0; static int unscaled_size_y = 0; -static int pause; static uint64_t start_time; static uint64_t end_time; static wchar_t **argv; @@ -207,26 +206,6 @@ releasemouse(void) } -static void -win_pc_reset(int hard) -{ - plat_pause(1); - - Sleep(100); - - nvr_save(); - - config_save(); - - if (hard) - pc_reset_hard(); - else - pc_send_cad(); - - plat_pause(vid_apis[video_fullscreen][vid_api].pause()); -} - - static void video_toggle_option(HMENU h, int *val, int id) { @@ -250,19 +229,19 @@ MainThread(LPVOID param) RECT r; drawits = 0; - old_time = GetTickCount(); + old_time = plat_get_ticks(); while (! quited) { - if (updatestatus) { + if (status_update_needed) { if (hwndStatus != NULL) SendMessage(hwndStatus, WM_USER, 0, 0); - updatestatus = 0; + status_update_needed = 0; } - new_time = GetTickCount(); + new_time = plat_get_ticks(); drawits += new_time - old_time; old_time = new_time; - if (drawits > 0 && !pause) { - start_time = timer_read(); + if (drawits > 0 && !dopause) { + start_time = plat_timer_read(); drawits -= 10; if (drawits > 50) drawits = 0; pc_run(); @@ -273,13 +252,13 @@ MainThread(LPVOID param) nvr_dosave = 0; } - end_time = timer_read(); + end_time = plat_timer_read(); main_time += end_time - start_time; } else - Sleep(1); + plat_delay_ms(1); if (!video_fullscreen && vid_apis[0][vid_api].local && - win_doresize && (winsizex>0) && (winsizey>0)) { + doresize && (winsizex>0) && (winsizey>0)) { SendMessage(hwndSBAR, SB_GETBORDERS, 0, (LPARAM) sb_borders); GetWindowRect(hwndMain, &r); MoveWindow(hwndRender, 0, 0, winsizex, winsizey, TRUE); @@ -299,7 +278,7 @@ MainThread(LPVOID param) ClipCursor(&r); } - win_doresize = 0; + doresize = 0; } if (leave_fullscreen_flag) { @@ -473,11 +452,11 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) break; case IDM_ACTION_HRESET: - win_pc_reset(1); + pc_reset(1); break; case IDM_ACTION_RESET_CAD: - win_pc_reset(0); + pc_reset(0); break; case IDM_ACTION_EXIT: @@ -489,7 +468,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) break; case IDM_ACTION_PAUSE: - plat_pause(pause ^ 1); + plat_pause(dopause ^ 1); break; case IDM_CONFIG: @@ -524,7 +503,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) EnableMenuItem(hmenu, IDM_VID_SCALE_2X, vid_resize ? MF_GRAYED : MF_ENABLED); EnableMenuItem(hmenu, IDM_VID_SCALE_3X, vid_resize ? MF_GRAYED : MF_ENABLED); EnableMenuItem(hmenu, IDM_VID_SCALE_4X, vid_resize ? MF_GRAYED : MF_ENABLED); - win_doresize = 1; + doresize = 1; config_save(); break; @@ -561,9 +540,9 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) CheckMenuItem(hmenu, IDM_VID_DDRAW+vid_api, MF_CHECKED); vid_apis[0][vid_api].init(hwndRender); endblit(); - config_save(); device_force_redraw(); cgapal_rebuild(); + config_save(); break; case IDM_VID_FULLSCREEN: @@ -583,9 +562,9 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) mouse_init(); leave_fullscreen_flag = 0; endblit(); - config_save(); device_force_redraw(); cgapal_rebuild(); + config_save(); break; case IDM_VID_FS_FULL: @@ -595,8 +574,8 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) CheckMenuItem(hmenu, IDM_VID_FS_FULL + video_fullscreen_scale, MF_UNCHECKED); video_fullscreen_scale = LOWORD(wParam) - IDM_VID_FS_FULL; CheckMenuItem(hmenu, IDM_VID_FS_FULL + video_fullscreen_scale, MF_CHECKED); - config_save(); device_force_redraw(); + config_save(); break; case IDM_VID_SCALE_1X: @@ -606,8 +585,8 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) CheckMenuItem(hmenu, IDM_VID_SCALE_1X + scale, MF_UNCHECKED); scale = LOWORD(wParam) - IDM_VID_SCALE_1X; CheckMenuItem(hmenu, IDM_VID_SCALE_1X + scale, MF_CHECKED); - config_save(); device_force_redraw(); + config_save(); break; case IDM_VID_FORCE43: @@ -636,8 +615,8 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) CheckMenuItem(hmenu, IDM_VID_GRAYCT_601 + video_graytype, MF_UNCHECKED); video_graytype = LOWORD(wParam) - IDM_VID_GRAYCT_601; CheckMenuItem(hmenu, IDM_VID_GRAYCT_601 + video_graytype, MF_CHECKED); - config_save(); device_force_redraw(); + config_save(); break; case IDM_VID_GRAY_RGB: @@ -648,8 +627,8 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) CheckMenuItem(hmenu, IDM_VID_GRAY_RGB + video_grayscale, MF_UNCHECKED); video_grayscale = LOWORD(wParam) - IDM_VID_GRAY_RGB; CheckMenuItem(hmenu, IDM_VID_GRAY_RGB + video_grayscale, MF_CHECKED); - config_save(); device_force_redraw(); + config_save(); break; #ifdef ENABLE_LOG_TOGGLES @@ -697,7 +676,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) # ifdef ENABLE_NIC_LOG case IDM_LOG_NIC: - /*FIXME: should be network_setlog() */ nic_do_log ^= 1; CheckMenuItem(hmenu, IDM_LOG_NIC, nic_do_log ? MF_CHECKED : MF_UNCHECKED); break; @@ -722,46 +700,30 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if (ui_msgbox(MBX_QUESTION, (wchar_t *)IDS_2051) == IDYES) { config_write(config_file_default); for (i = 0; i < FDD_NUM; i++) - { floppy_close(i); - } for (i = 0; i < CDROM_NUM; i++) { cdrom_drives[i].handler->exit(i); if (cdrom_drives[i].host_drive == 200) - { image_close(i); - } else if ((cdrom_drives[i].host_drive >= 'A') && (cdrom_drives[i].host_drive <= 'Z')) - { ioctl_close(i); - } else - { null_close(i); - } } pc_reset_hard_close(); config_load(wopenfilestring); for (i = 0; i < CDROM_NUM; i++) { if (cdrom_drives[i].bus_type) - { SCSIReset(cdrom_drives[i].scsi_device_id, cdrom_drives[i].scsi_device_lun); - } if (cdrom_drives[i].host_drive == 200) - { image_open(i, cdrom_image[i].image_path); - } else if ((cdrom_drives[i].host_drive >= 'A') && (cdrom_drives[i].host_drive <= 'Z')) - { ioctl_open(i, cdrom_drives[i].host_drive); - } else - { cdrom_null_open(i, cdrom_drives[i].host_drive); - } } floppy_load(0, floppyfns[0]); @@ -1168,7 +1130,6 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nFunsterStil) /* Set the initial title for the program's main window. */ _swprintf(title, L"%s v%s", EMU_NAME_W, EMU_VERSION_W); - set_window_title(title); /* Now create our main window. */ hwnd = CreateWindowEx ( @@ -1186,6 +1147,8 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nFunsterStil) NULL); /* no Window Creation data */ hwndMain = hwnd; + ui_window_title(title); + /* Resize the window if needed. */ if (vid_resize) SetWindowLongPtr(hwnd, GWL_STYLE, @@ -1297,16 +1260,16 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nFunsterStil) * UI until we're done. */ timeBeginPeriod(1); + QueryPerformanceFrequency(&qpc_freq); + timer_freq = qpc_freq.QuadPart; atexit(releasemouse); thMain = (HANDLE)_beginthread(MainThread, 0, NULL); SetThreadPriority(thMain, THREAD_PRIORITY_HIGHEST); - QueryPerformanceFrequency(&qpc_freq); - timer_freq = qpc_freq.QuadPart; - /* Run the message loop. It will run until GetMessage() returns 0 */ + quited = 0; while (! quited) { bRet = GetMessage(&messages, NULL, 0, 0); if ((bRet == 0) || quited) break; @@ -1397,14 +1360,65 @@ plat_chdir(wchar_t *path) void -get_executable_name(wchar_t *s, int size) +plat_get_exe_name(wchar_t *s, int size) { GetModuleFileName(hinstance, s, size); } wchar_t * -set_window_title(wchar_t *s) +plat_get_filename(wchar_t *s) +{ + int c = wcslen(s) - 1; + + while (c > 0) { + if (s[c] == L'/' || s[c] == L'\\') + return(&s[c+1]); + c--; + } + + return(s); +} + + +wchar_t * +plat_get_extension(wchar_t *s) +{ + int c = wcslen(s) - 1; + + if (c <= 0) + return(s); + + while (c && s[c] != L'.') + c--; + + if (!c) + return(&s[wcslen(s)]); + + return(&s[c+1]); +} + + +void +plat_append_filename(wchar_t *dest, wchar_t *s1, wchar_t *s2, int size) +{ + wcscat(dest, s1); + wcscat(dest, s2); +} + + +void +plat_put_backslash(wchar_t *s) +{ + int c = wcslen(s) - 1; + + if (s[c] != L'/' && s[c] != L'\\') + s[c] = L'/'; +} + + +wchar_t * +ui_window_title(wchar_t *s) { if (! video_fullscreen) { if (s != NULL) @@ -1420,7 +1434,7 @@ set_window_title(wchar_t *s) int -dir_check_exist(wchar_t *path) +plat_dir_check(wchar_t *path) { DWORD dwAttrib = GetFileAttributes(path); @@ -1430,14 +1444,14 @@ dir_check_exist(wchar_t *path) int -dir_create(wchar_t *path) +plat_dir_create(wchar_t *path) { return((int)CreateDirectory(path, NULL)); } uint64_t -timer_read(void) +plat_timer_read(void) { LARGE_INTEGER li; @@ -1448,14 +1462,14 @@ timer_read(void) uint32_t -get_ticks(void) +plat_get_ticks(void) { return(GetTickCount()); } void -delay_ms(uint32_t count) +plat_delay_ms(uint32_t count) { Sleep(count); } @@ -1504,20 +1518,20 @@ plat_pause(int p) p = vid_apis[video_fullscreen][vid_api].pause(); /* If already so, done. */ - if (pause == p) return; + if (dopause == p) return; if (p) { wcscpy(oldtitle, wTitle); wcscat(wTitle, L" - PAUSED -"); - set_window_title(NULL); + ui_window_title(NULL); } else { - set_window_title(oldtitle); + ui_window_title(oldtitle); } - pause = p; + dopause = p; /* Update the actual menu. */ - CheckMenuItem(menuMain, IDM_ACTION_PAUSE, (pause)?MF_CHECKED:MF_UNCHECKED); + CheckMenuItem(menuMain, IDM_ACTION_PAUSE, (dopause)?MF_CHECKED:MF_UNCHECKED); } @@ -1573,10 +1587,10 @@ take_screenshot(void) (void)time(&now); info = localtime(&now); - append_filename_w(path, cfg_path, SCREENSHOT_PATH, sizeof(path)-2); + plat_append_filename(path, cfg_path, SCREENSHOT_PATH, sizeof(path)-2); - if (! dir_check_exist(path)) - dir_create(path); + if (! plat_dir_check(path)) + plat_dir_create(path); #ifdef WIN32 wcscat(path, L"\\"); @@ -1587,7 +1601,7 @@ take_screenshot(void) switch(vid_api) { case 0: /* ddraw */ wcsftime(path, 128, L"%Y%m%d_%H%M%S.bmp", info); - append_filename_w(path, cfg_path, fn, 1024); + plat_append_filename(path, cfg_path, fn, 1024); if (video_fullscreen) ddraw_fs_take_screenshot(path); else @@ -1597,7 +1611,7 @@ take_screenshot(void) case 1: /* d3d9 */ wcsftime(fn, 128, L"%Y%m%d_%H%M%S.png", info); - append_filename_w(path, cfg_path, fn, 1024); + plat_append_filename(path, cfg_path, fn, 1024); if (video_fullscreen) d3d_fs_take_screenshot(path); else @@ -1608,7 +1622,7 @@ take_screenshot(void) #ifdef USE_VNC case 2: /* vnc */ wcsftime(fn, 128, L"%Y%m%d_%H%M%S.png", info); - append_filename_w(path, cfg_path, fn, 1024); + plat_append_filename(path, cfg_path, fn, 1024); vnc_take_screenshot(path); pclog("Screenshot: fn='%ls'\n", path); break; @@ -1703,9 +1717,9 @@ updatewindowsize(int x, int y) } if ((owsx != winsizex) || (owsy != winsizey)) - win_doresize = 1; + doresize = 1; else - win_doresize = 0; + doresize = 0; } diff --git a/src/win/win_about.c b/src/win/win_about.c index c8b46d86a..f9e5dfad4 100644 --- a/src/win/win_about.c +++ b/src/win/win_about.c @@ -8,7 +8,7 @@ * * Handle the About dialog. * - * Version: @(#)win_about.c 1.0.3 2017/10/13 + * Version: @(#)win_about.c 1.0.4 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, diff --git a/src/win/win_cdrom.c b/src/win/win_cdrom.c index 19e0f454e..7695e451c 100644 --- a/src/win/win_cdrom.c +++ b/src/win/win_cdrom.c @@ -8,7 +8,7 @@ * * Handle the platform-side of CDROM drives. * - * Version: @(#)win_cdrom.c 1.0.3 2017/10/09 + * Version: @(#)win_cdrom.c 1.0.4 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, diff --git a/src/win/win_cdrom_ioctl.c b/src/win/win_cdrom_ioctl.c index e99b372d1..def543d6f 100644 --- a/src/win/win_cdrom_ioctl.c +++ b/src/win/win_cdrom_ioctl.c @@ -9,7 +9,7 @@ * Implementation of the CD-ROM host drive IOCTL interface for * Windows using SCSI Passthrough Direct. * - * Version: @(#)cdrom_ioctl.c 1.0.6 2017/10/09 + * Version: @(#)cdrom_ioctl.c 1.0.6 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -26,6 +26,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../device.h" #include "../scsi/scsi.h" diff --git a/src/win/win_deviceconfig.c b/src/win/win_deviceconfig.c index 531a2867d..7f0ae33c5 100644 --- a/src/win/win_deviceconfig.c +++ b/src/win/win_deviceconfig.c @@ -8,7 +8,7 @@ * * Windows device configuration dialog implementation. * - * Version: @(#)win_deviceconfig.c 1.0.7 2017/10/10 + * Version: @(#)win_deviceconfig.c 1.0.8 2017/10/16 * * Authors: Sarah Walker, * Miran Grca, @@ -20,7 +20,7 @@ #include #include #include -#include "../ibm.h" +#include "../86box.h" #include "../config.h" #include "../device.h" #include "../plat.h" diff --git a/src/win/win_dialog.c b/src/win/win_dialog.c index a92bf8c02..9621a8e4e 100644 --- a/src/win/win_dialog.c +++ b/src/win/win_dialog.c @@ -8,7 +8,7 @@ * * Several dialogs for the application. * - * Version: @(#)win_dialog.c 1.0.3 2017/10/10 + * Version: @(#)win_dialog.c 1.0.4 2017/10/16 * * Author: Miran Grca, * Fred N. van Kempen, @@ -27,7 +27,7 @@ #include #include #include -#include "../ibm.h" +#include "../86box.h" #include "../device.h" #include "../plat.h" #include "../ui.h" diff --git a/src/win/win_dynld.c b/src/win/win_dynld.c index 1065867e8..06a308365 100644 --- a/src/win/win_dynld.c +++ b/src/win/win_dynld.c @@ -8,7 +8,7 @@ * * Try to load a support DLL. * - * Version: @(#)win_dynld.c 1.0.5 2017/10/11 + * Version: @(#)win_dynld.c 1.0.6 2017/10/16 * * Author: Fred N. van Kempen, * @@ -20,7 +20,7 @@ #include #include #include -#include "../ibm.h" +#include "../86box.h" #include "../plat_dynld.h" diff --git a/src/win/win_joystickconfig.c b/src/win/win_joystickconfig.c index 28c300629..cd5304805 100644 --- a/src/win/win_joystickconfig.c +++ b/src/win/win_joystickconfig.c @@ -9,7 +9,7 @@ #include #include #include -#include "../ibm.h" +#include "../86box.h" #include "../config.h" #include "../device.h" #include "../game/gameport.h" diff --git a/src/win/win_keyboard.c b/src/win/win_keyboard.c index 75bc80e6a..3f10e3a8c 100644 --- a/src/win/win_keyboard.c +++ b/src/win/win_keyboard.c @@ -8,7 +8,7 @@ * * Windows raw keyboard input handler. * - * Version: @(#)win_keyboard.c 1.0.2 2017/10/10 + * Version: @(#)win_keyboard.c 1.0.3 2017/10/16 * * Author: Miran Grca, * @@ -20,12 +20,11 @@ #include #include #undef BITMAP -//#include -//#include #include #include #include #include +#include "../86box.h" #include "../device.h" #include "../plat.h" #include "../plat_keyboard.h" diff --git a/src/win/win_midi.c b/src/win/win_midi.c index 0d49bf81e..d9d92eeb6 100644 --- a/src/win/win_midi.c +++ b/src/win/win_midi.c @@ -4,7 +4,7 @@ #include #include #include -#include "../ibm.h" +#include "../86box.h" #include "../config.h" #include "../sound/midi.h" #include "../plat.h" diff --git a/src/win/win_opendir.c b/src/win/win_opendir.c index ba8430a86..af0c6e768 100644 --- a/src/win/win_opendir.c +++ b/src/win/win_opendir.c @@ -10,7 +10,7 @@ * * Based on old original code @(#)dir_win32.c 1.2.0 2007/04/19 * - * Version: @(#)win_opendir.c 1.0.3 2017/10/10 + * Version: @(#)win_opendir.c 1.0.3 2017/10/16 * * Author: Fred N. van Kempen, * @@ -25,7 +25,7 @@ #include #include #include -#include "../ibm.h" +#include "../86box.h" #include "../plat.h" #include "../plat_dir.h" diff --git a/src/win/win_serial.c b/src/win/win_serial.c index df5823171..21dc7443d 100644 --- a/src/win/win_serial.c +++ b/src/win/win_serial.c @@ -12,7 +12,7 @@ * Windows and UNIX systems, with support for FTDI and Prolific * USB ports. Support for these has been removed. * - * Version: @(#)win_serial.c 1.0.6 2017/10/10 + * Version: @(#)win_serial.c 1.0.6 2017/10/16 * * Author: Fred N. van Kempen, * @@ -23,7 +23,7 @@ #include #include #define PLAT_SERIAL_C -#include "../ibm.h" +#include "../86box.h" #include "../plat.h" #include "../plat_serial.h" diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 15b774d5e..928f977e8 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -8,7 +8,7 @@ * * Windows 86Box Settings dialog handler. * - * Version: @(#)win_settings.c 1.0.21 2017/10/13 + * Version: @(#)win_settings.c 1.0.21 2017/10/16 * * Author: Miran Grca, * @@ -25,6 +25,7 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../config.h" #include "../cpu/cpu.h" diff --git a/src/win/win_status.c b/src/win/win_status.c index 86565f865..b32e02d42 100644 --- a/src/win/win_status.c +++ b/src/win/win_status.c @@ -9,13 +9,15 @@ #include #include #include +#include "../86box.h" #include "../ibm.h" #include "../mem.h" #include "../cpu/x86_ops.h" #ifdef USE_DYNAREC -#include "../cpu/codegen.h" +# include "../cpu/codegen.h" #endif #include "../device.h" +#include "../plat.h" #include "win.h" @@ -41,7 +43,7 @@ StatusWindowProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) /*FALLTHROUGH*/ case WM_USER: - new_time = timer_read(); + new_time = plat_timer_read(); status_diff = new_time - status_time; status_time = new_time; sprintf(temp, diff --git a/src/win/win_stbar.c b/src/win/win_stbar.c index 3651eabeb..b3fd18887 100644 --- a/src/win/win_stbar.c +++ b/src/win/win_stbar.c @@ -8,7 +8,7 @@ * * Implement the application's Status Bar. * - * Version: @(#)win_stbar.c 1.0.3 2017/10/09 + * Version: @(#)win_stbar.c 1.0.3 2017/10/16 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -28,6 +28,7 @@ #include #include #include +#include "../86box.h" #include "../config.h" #include "../ibm.h" #include "../cpu/cpu.h" diff --git a/src/win/win_thread.c b/src/win/win_thread.c index db8afc75e..2a23c9885 100644 --- a/src/win/win_thread.c +++ b/src/win/win_thread.c @@ -8,7 +8,7 @@ * * Implement threads and mutexes for the Win32 platform. * - * Version: @(#)win_thread.c 1.0.3 2017/10/14 + * Version: @(#)win_thread.c 1.0.4 2017/10/16 * * Authors: Sarah Walker, * Fred N. van Kempen, @@ -27,7 +27,7 @@ #include #include #include -#include "../ibm.h" +#include "../86box.h" #include "../plat.h" diff --git a/src/win/win_vnc.c b/src/win/win_vnc.c index 3ef79e3ce..a5e8f4413 100644 --- a/src/win/win_vnc.c +++ b/src/win/win_vnc.c @@ -8,7 +8,7 @@ * * Implement the VNC renderer with LibVNCServer. * - * Version: @(#)win_vnc.c 1.0.2 2017/10/14 + * Version: @(#)win_vnc.c 1.0.3 2017/10/16 * * Authors: Fred N. van Kempen, * Based on raw code by RichardG, @@ -17,7 +17,7 @@ */ #include #include -#include "../ibm.h" +#include "../86box.h" #include "../device.h" #include "../video/video.h" #include "../plat.h" @@ -249,7 +249,7 @@ vnc_init(HWND h) }; if (rfb == NULL) { - wcstombs(title, set_window_title(NULL), sizeof(title)); + wcstombs(title, ui_window_title(NULL), sizeof(title)); updatingSize = 0; allowedX = allowedY = 2048;