More portability changes, and some bugfixes found through that.

This commit is contained in:
waltje
2017-10-27 20:54:31 -04:00
parent 77d695f430
commit 15538f1441
10 changed files with 45 additions and 18 deletions

View File

@@ -8,7 +8,7 @@
* *
* Main include file for the application. * Main include file for the application.
* *
* Version: @(#)86box.h 1.0.7 2017/10/21 * Version: @(#)86box.h 1.0.8 2017/10/27
* *
* Authors: Miran Grca, <mgrca8@gmail.com> * Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com> * Fred N. van Kempen, <decwiz@yahoo.com>
@@ -60,6 +60,9 @@ extern "C" {
extern int dump_on_exit; /* (O) dump regs on exit*/ extern int dump_on_exit; /* (O) dump regs on exit*/
extern int do_dump_config; /* (O) dump cfg after load */ extern int do_dump_config; /* (O) dump cfg after load */
extern int start_in_fullscreen; /* (O) start in fullscreen */ extern int start_in_fullscreen; /* (O) start in fullscreen */
#ifdef USE_WX
extern int video_fps; /* (O) render speed in fps */
#endif
extern int window_w, window_h, /* (C) window size and */ extern int window_w, window_h, /* (C) window size and */
window_x, window_y, /* position info */ window_x, window_y, /* position info */

View File

@@ -18,11 +18,6 @@
/* Modified for use with PCem by bit */ /* Modified for use with PCem by bit */
//#ifdef FREEBSD
//# define fopen64 fopen
//# define fseeko64 fseeko
//# define ftello64 ftello
//#endif
#define _LARGEFILE_SOURCE #define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE
#ifdef WIN32 #ifdef WIN32
@@ -30,6 +25,7 @@
# define _GNU_SOURCE # define _GNU_SOURCE
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdint.h>
#include <cctype> #include <cctype>
#include <cmath> #include <cmath>

View File

@@ -9,7 +9,7 @@
* Implementation of the IDE emulation for hard disks and ATAPI * Implementation of the IDE emulation for hard disks and ATAPI
* CD-ROM devices. * CD-ROM devices.
* *
* Version: @(#)hdc_ide.c 1.0.16 2017/10/26 * Version: @(#)hdc_ide.c 1.0.17 2017/10/27
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -2012,7 +2012,12 @@ void callbackide(int ide_board)
return; return;
case WIN_SET_FEATURES: case WIN_SET_FEATURES:
if ((ide->type == IDE_NONE)/* || ide_drive_is_cdrom(ide)*/) #if 1
/* To avoid Clang warning. --FvK */
if (ide->type == IDE_NONE)
#else
if ((ide->type == IDE_NONE) || ide_drive_is_cdrom(ide))
#endif
{ {
goto abort_cmd; goto abort_cmd;
} }

View File

@@ -64,6 +64,7 @@ typedef unsigned long ioctlsockopt_t;
# define HAVE_STDLIB_H # define HAVE_STDLIB_H
# define HAVE_STRING_H # define HAVE_STRING_H
# define HAVE_UNISTD_H # define HAVE_UNISTD_H
# define HAVE_INET_ATON
typedef uint8_t u_int8_t; typedef uint8_t u_int8_t;
typedef uint16_t u_int16_t; typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t; typedef uint32_t u_int32_t;

View File

@@ -8,7 +8,7 @@
* *
* Main emulator module where most things are controlled. * Main emulator module where most things are controlled.
* *
* Version: @(#)pc.c 1.0.34 2017/10/25 * Version: @(#)pc.c 1.0.35 2017/10/27
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -81,6 +81,9 @@
int dump_on_exit = 0; /* (O) dump regs on exit */ int dump_on_exit = 0; /* (O) dump regs on exit */
int do_dump_config = 0; /* (O) dump config on load */ int do_dump_config = 0; /* (O) dump config on load */
int start_in_fullscreen = 0; /* (O) start in fullscreen */ int start_in_fullscreen = 0; /* (O) start in fullscreen */
#ifdef USE_WX
int video_fps = RENDER_FPS; /* (O) render speed in fps */
#endif
/* Configuration values. */ /* Configuration values. */
int window_w, window_h, /* (C) window size and */ int window_w, window_h, /* (C) window size and */
@@ -318,6 +321,9 @@ usage:
printf("-D or --dump - dump memory on exit\n"); printf("-D or --dump - dump memory on exit\n");
printf("-F or --fullscreen - start in fullscreen mode\n"); printf("-F or --fullscreen - start in fullscreen mode\n");
printf("-P or --vmpath path - set 'path' to be root for vm\n"); printf("-P or --vmpath path - set 'path' to be root for vm\n");
#ifdef USE_WX
printf("-R or --fps num - set render speed to 'num' fps\n");
#endif
printf("\nA config file can be specified. If none is, the default file will be used.\n"); printf("\nA config file can be specified. If none is, the default file will be used.\n");
return(0); return(0);
} else if (!wcscasecmp(argv[c], L"--dumpcfg") || } else if (!wcscasecmp(argv[c], L"--dumpcfg") ||
@@ -331,9 +337,16 @@ usage:
start_in_fullscreen = 1; start_in_fullscreen = 1;
} else if (!wcscasecmp(argv[c], L"--vmpath") || } else if (!wcscasecmp(argv[c], L"--vmpath") ||
!wcscasecmp(argv[c], L"-P")) { !wcscasecmp(argv[c], L"-P")) {
if ((c+1) == argc) break; if ((c+1) == argc) goto usage;
wcscpy(cfg_path, argv[++c]); wcscpy(cfg_path, argv[++c]);
#ifdef USE_WX
} else if (!wcscasecmp(argv[c], L"--fps") ||
!wcscasecmp(argv[c], L"-R")) {
if ((c+1) == argc) goto usage;
video_fps = wcstol(argv[++c], NULL, 10);
#endif
} else if (!wcscasecmp(argv[c], L"--test")) { } else if (!wcscasecmp(argv[c], L"--test")) {
/* some (undocumented) test function here.. */ /* some (undocumented) test function here.. */

View File

@@ -8,7 +8,7 @@
* *
* Define the various platform support functions. * Define the various platform support functions.
* *
* Version: @(#)plat.h 1.0.14 2017/10/24 * Version: @(#)plat.h 1.0.15 2017/10/27
* *
* Authors: Miran Grca, <mgrca8@gmail.com> * Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com> * Fred N. van Kempen, <decwiz@yahoo.com>
@@ -24,6 +24,11 @@
#endif #endif
#ifndef WIN32
# define RENDER_FPS 70 /* default render speed */
#endif
#ifdef FREEBSD #ifdef FREEBSD
/* FreeBSD has largefile by default. */ /* FreeBSD has largefile by default. */
# define fopen64 fopen # define fopen64 fopen

View File

@@ -11,7 +11,7 @@
* 1 - BT-545S ISA; * 1 - BT-545S ISA;
* 2 - BT-958D PCI * 2 - BT-958D PCI
* *
* Version: @(#)scsi_buslogic.c 1.0.26 2017/10/22 * Version: @(#)scsi_buslogic.c 1.0.27 2017/10/27
* *
* Authors: TheCollector1995, <mariogplayer@gmail.com> * Authors: TheCollector1995, <mariogplayer@gmail.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -673,7 +673,7 @@ buslogic_cmds(void *p)
FILE *f; FILE *f;
uint16_t TargetsPresentMask = 0; uint16_t TargetsPresentMask = 0;
uint8_t Offset; uint32_t Offset;
int i = 0; int i = 0;
int j = 0; int j = 0;
MailboxInitExtended_t *MailboxInitE; MailboxInitExtended_t *MailboxInitE;

View File

@@ -11,7 +11,7 @@
* of SCSI Host Adapters made by Mylex. * of SCSI Host Adapters made by Mylex.
* These controllers were designed for various buses. * These controllers were designed for various buses.
* *
* Version: @(#)scsi_x54x.h 1.0.2 2017/10/22 * Version: @(#)scsi_x54x.h 1.0.3 2017/10/27
* *
* Authors: TheCollector1995, <mariogplayer@gmail.com> * Authors: TheCollector1995, <mariogplayer@gmail.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -368,7 +368,7 @@ typedef struct {
uint8_t Command; uint8_t Command;
uint8_t CmdBuf[128]; uint8_t CmdBuf[128];
uint8_t CmdParam; uint8_t CmdParam;
uint8_t CmdParamLeft; uint32_t CmdParamLeft;
uint8_t DataBuf[65536]; uint8_t DataBuf[65536];
uint16_t DataReply; uint16_t DataReply;
uint16_t DataReplyLeft; uint16_t DataReplyLeft;

View File

@@ -316,6 +316,7 @@ static inline int16_t EMU8K_READ(emu8k_t *emu8k, uint32_t addr)
return emu8k->ram_pointers[addrmem.hb_address][addrmem.lw_address]; return emu8k->ram_pointers[addrmem.hb_address][addrmem.lw_address];
} }
#if NOTUSED
static inline int16_t EMU8K_READ_INTERP_LINEAR(emu8k_t *emu8k, uint32_t int_addr, uint16_t fract) static inline int16_t EMU8K_READ_INTERP_LINEAR(emu8k_t *emu8k, uint32_t int_addr, uint16_t fract)
{ {
/* The interpolation in AWE32 used a so-called patented 3-point interpolation /* The interpolation in AWE32 used a so-called patented 3-point interpolation
@@ -328,6 +329,7 @@ static inline int16_t EMU8K_READ_INTERP_LINEAR(emu8k_t *emu8k, uint32_t int_addr
dat1 += ((dat2-(int32_t)dat1)* fract) >> 16; dat1 += ((dat2-(int32_t)dat1)* fract) >> 16;
return dat1; return dat1;
} }
#endif
static inline int32_t EMU8K_READ_INTERP_CUBIC(emu8k_t *emu8k, uint32_t int_addr, uint16_t fract) static inline int32_t EMU8K_READ_INTERP_CUBIC(emu8k_t *emu8k, uint32_t int_addr, uint16_t fract)
{ {

View File

@@ -40,7 +40,7 @@
* W = 3 bus clocks * W = 3 bus clocks
* L = 4 bus clocks * L = 4 bus clocks
* *
* Version: @(#)video.c 1.0.5 2017/10/22 * Version: @(#)video.c 1.0.6 2017/10/27
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -200,7 +200,9 @@ void blit_thread(void *param)
thread_wait_event(blit_data.wake_blit_thread, -1); thread_wait_event(blit_data.wake_blit_thread, -1);
thread_reset_event(blit_data.wake_blit_thread); thread_reset_event(blit_data.wake_blit_thread);
blit_func(blit_data.x, blit_data.y, blit_data.y1, blit_data.y2, blit_data.w, blit_data.h); blit_func(blit_data.x, blit_data.y,
blit_data.y1, blit_data.y2,
blit_data.w, blit_data.h);
blit_data.busy = 0; blit_data.busy = 0;
thread_set_event(blit_data.blit_complete); thread_set_event(blit_data.blit_complete);
@@ -529,7 +531,7 @@ video_init(void)
#endif #endif
for (c = 0; c < 65536; c++) for (c = 0; c < 65536; c++)
video_16to32[c] = calc_16to32(c); video_16to32[c] = calc_16to32(c);
blit_data.wake_blit_thread = thread_create_event(); blit_data.wake_blit_thread = thread_create_event();
blit_data.blit_complete = thread_create_event(); blit_data.blit_complete = thread_create_event();
blit_data.buffer_not_in_use = thread_create_event(); blit_data.buffer_not_in_use = thread_create_event();