This commit is contained in:
Melissa Goad
2017-10-21 20:41:45 -05:00
243 changed files with 2797 additions and 2518 deletions

View File

@@ -6,9 +6,9 @@
*
* This file is part of the 86Box distribution.
*
* Main emulator include file.
* Main include file for the application.
*
* Version: @(#)86box.h 1.0.3 2017/10/09
* Version: @(#)86box.h 1.0.7 2017/10/21
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -20,6 +20,24 @@
# define EMU_86BOX_H
/* Configuration values. */
#define SERIAL_MAX 2
#define PARALLEL_MAX 1
#define SCREEN_RES_X 640
#define SCREEN_RES_Y 480
/* Version info. */
#define EMU_NAME "86Box"
#define EMU_NAME_W L"86Box"
#define EMU_VERSION "2.00"
#define EMU_VERSION_W L"2.00"
/* Filename and pathname info. */
#define CONFIG_FILE_W L"86box.cfg"
#define NVR_PATH L"nvr"
#define SCREENSHOT_PATH L"screenshots"
#if defined(ENABLE_BUSLOGIC_LOG) || \
defined(ENABLE_CDROM_LOG) || \
defined(ENABLE_D86F_LOG) || \
@@ -33,16 +51,72 @@
# define ENABLE_LOG_COMMANDS 1
#endif
#define EMU_VERSION "2.00"
#define EMU_VERSION_W L"2.00"
#define EMU_NAME "86Box"
#define EMU_NAME_W L"86Box"
#ifdef __cplusplus
extern "C" {
#endif
#define CONFIG_FILE_W L"86box.cfg"
/* Global variables. */
extern int dump_on_exit; /* (O) dump regs on exit*/
extern int do_dump_config; /* (O) dump cfg after load */
extern int start_in_fullscreen; /* (O) start in fullscreen */
#define NVR_PATH L"nvr"
#define SCREENSHOT_PATH L"screenshots"
extern int window_w, window_h, /* (C) window size and */
window_x, window_y, /* position info */
window_remember,
vid_resize, /* (C) allow resizing */
invert_display, /* (C) invert the display */
suppress_overscan; /* (C) suppress overscans */
extern int scale; /* (C) screen scale factor */
extern int vid_api; /* (C) video renderer */
extern int vid_cga_contrast, /* (C) video */
video_fullscreen, /* (C) video */
video_fullscreen_first, /* (C) video */
video_fullscreen_scale, /* (C) video */
enable_overscan, /* (C) video */
force_43, /* (C) video */
video_speed; /* (C) video */
#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 wchar_t exe_path[1024]; /* path (dir) of executable */
extern wchar_t cfg_path[1024]; /* path (dir) of user data */
extern int scrnsz_x, /* current screen size, X */
scrnsz_y; /* current screen size, Y */
/* Function prototypes. */
extern void pclog(const char *format, ...);
extern void fatal(const char *format, ...);
extern void set_screen_size(int x, int y);
extern void set_screen_size_natural(void);
extern int pc_init_modules(void);
extern int pc_init(int argc, wchar_t *argv[]);
extern void pc_close(void *threadid);
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_thread(void *param);
extern void pc_start(void);
extern void pc_onesec(void);
#ifdef __cplusplus
}
#endif
#endif /*EMU_86BOX_H*/

View File

@@ -10,7 +10,7 @@
# settings, so we can avoid changing the main one for all of
# our local setups.
#
# Version: @(#)Makefile.local 1.0.4 2017/10/14
# Version: @(#)Makefile.local 1.0.5 2017/10/19
#
# Author: Fred N. van Kempen, <decwiz@yahoo.com>
#
@@ -27,10 +27,56 @@ COPTIM := -O1
# Name of the executable.
PROG := yourexe
# Various compile-time options.
STUFF := #-DROM_TRACE=0xC800 -DIO_TRACE=0x70
EXTRAS := #-DYOURNAME
# Various compile-time options.
# -DROM_TRACE=0xc800 traces ROM access from segment C800
# -DIO_TRACE=0x66 traces I/O on port 0x66
STUFF :=
# Add feature selections here.
# -DANSI_CFG forces the config file to ANSI encoding.
# -DENABLE_VRAM_DUMP enables Video Ram dumping.
# -DENABLE_LOG_BREAKPOINT enables extra logging.
# -DENABLE_KEYBOARD_AMSTRAD_LOG=N sets logging level at N.
# -DENABLE_KEYBOARD_AT_LOG=N sets logging level at N.
# -DENABLE_KEYBOARD_LOG=N sets logging level at N.
# -DENABLE_PCI_LOG=N sets logging level at N.
# -DENABLE_CDROM_LOG=N sets logging level at N.
# -DENABLE_HDD_LOG=N sets logging level at N.
# -DENABLE_IDE_LOG=N sets logging level at N.
# -DENABLE_FDC_LOG=N sets logging level at N.
# -DENABLE_D86F_LOG=N sets logging level at N.
# -DENABLE_NIC_LOG=N sets logging level at N.
# -DENABLE_SCSI_BUS_LOG=N sets logging level at N.
# -DENABLE_SCSI_DISK_LOG=N sets logging level at N.
# -DENABLE_X54X_LOG=N sets logging level at N.
# -DENABLE_AHA154X_LOG=N sets logging level at N.
# -DENABLE_BUSLOGIC_LOG=N sets logging level at N.
# -DENABLE_NCR5380_LOG=N sets logging level at N.
# -DENABLE_AUDIOPCI_LOG=N sets logging level at N.
# -DENABLE_EMU8K_LOG=N sets logging level at N.
# -DENABLE_VRAM_DUMP=N sets logging level at N.
# -DENABLE_SERIAL_LOG=N sets logging level at N.
EXTRAS :=
AUTODEP := n
DEBUG := n
OPTIM := n
X64 := n
RELEASE := n
USB := n
VNC := n
RDP := n
DEV_BUILD := n
DEV_BRANCH := n
CIRRUS := n
NE1000 := n
NV_RIVA := n
FLUIDSYNTH := y
MUNT := y
PAS16 := n
DYNAREC := y
#########################################################################

View File

@@ -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, <decwiz@yahoo.com>
* Copyright 1989-2017 Fred N. van Kempen.
@@ -53,6 +53,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "io.h"
#include "ui.h"

View File

@@ -9,7 +9,7 @@
* Implementation of the CD-ROM drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage.
*
* Version: @(#)cdrom.c 1.0.18 2017/10/15
* Version: @(#)cdrom.c 1.0.19 2017/10/22
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
@@ -845,7 +845,7 @@ void cdrom_init(int id, int cdb_len_setting)
cdrom[id].sense[0] = 0xf0;
cdrom[id].sense[7] = 10;
cdrom_drives[id].bus_mode = 0;
if (cdrom_drives[id].bus_type > CDROM_BUS_ATAPI_PIO_AND_DMA)
if (cdrom_drives[id].bus_type >= CDROM_BUS_ATAPI_PIO_AND_DMA)
{
cdrom_drives[id].bus_mode |= 2;
}
@@ -890,6 +890,7 @@ int cdrom_current_mode(int id)
}
if (cdrom_supports_pio(id) && !cdrom_supports_dma(id))
{
cdrom_log("CD-ROM %i: Drive does not support DMA, setting to PIO\n", id);
return 1;
}
if (!cdrom_supports_pio(id) && cdrom_supports_dma(id))
@@ -898,6 +899,7 @@ int cdrom_current_mode(int id)
}
if (cdrom_supports_pio(id) && cdrom_supports_dma(id))
{
cdrom_log("CD-ROM %i: Drive supports both, setting to %s\n", id, (cdrom[id].features & 1) ? "DMA" : "PIO", id);
return (cdrom[id].features & 1) ? 2 : 1;
}
@@ -1366,6 +1368,8 @@ uint32_t cdrom_mode_sense(uint8_t id, uint8_t *buf, uint32_t pos, uint8_t type,
void cdrom_update_request_length(uint8_t id, int len, int block_len)
{
uint32_t bt;
/* For media access commands, make sure the requested DRQ length matches the block length. */
switch (cdrom[id].current_cdb[0])
{
@@ -1378,17 +1382,11 @@ void cdrom_update_request_length(uint8_t id, int len, int block_len)
{
cdrom[id].request_length = block_len;
}
/* Make sure we respect the limit of how many blocks we can transfer at once. */
if (cdrom[id].requested_blocks > cdrom_drives[id].max_blocks_at_once)
bt = (cdrom[id].requested_blocks * block_len);
if (len > bt)
{
cdrom[id].requested_blocks = cdrom_drives[id].max_blocks_at_once;
len = bt;
}
cdrom[id].block_total = (cdrom[id].requested_blocks * block_len);
if (len > cdrom[id].block_total)
{
len = cdrom[id].block_total;
}
break;
default:
cdrom[id].packet_len = len;
break;
@@ -1406,21 +1404,6 @@ void cdrom_update_request_length(uint8_t id, int len, int block_len)
return;
}
static int cdrom_is_media_access(uint8_t id)
{
switch (cdrom[id].current_cdb[0])
{
case 0x08:
case 0x28:
case 0xa8:
case 0xb9:
case 0xbe:
return 1;
default:
return 0;
}
}
static void cdrom_command_common(uint8_t id)
{
cdrom[id].status = BUSY_STAT;
@@ -1489,6 +1472,11 @@ static int cdrom_request_length_is_zero(uint8_t id)
return 0;
}
/* id = Current CD-ROM device ID;
len = Total transfer length;
block_len = Length of a single block (why does it matter?!);
alloc_len = Allocated transfer length;
direction = Transfer direction (0 = read from host, 1 = write to host). */
static void cdrom_data_command_finish(uint8_t id, int len, int block_len, int alloc_len, int direction)
{
cdrom_log("CD-ROM %i: Finishing command (%02X): %i, %i, %i, %i, %i\n", id, cdrom[id].current_cdb[0], len, block_len, alloc_len, direction, cdrom[id].request_length);
@@ -2547,15 +2535,9 @@ cdrom_readtoc_fallback:
}
max_len = cdrom[id].sector_len;
/* if (cdrom_drives[id].bus_type == CDROM_BUS_SCSI) */
if (cdrom_current_mode(id) == 2)
{
cdrom[id].requested_blocks = max_len;
}
else
{
cdrom[id].requested_blocks = 1;
}
cdrom[id].requested_blocks = max_len; /* If we're reading all blocks in one go for DMA, why not also for PIO, it should NOT
matter anyway, this step should be identical and only the way the read dat is
transferred to the host should be different. */
cdrom[id].packet_len = max_len * alloc_length;
cdrom_buf_alloc(id, cdrom[id].packet_len);
@@ -2566,27 +2548,13 @@ cdrom_readtoc_fallback:
return;
}
if (cdrom_current_mode(id) == 2)
{
cdrom[id].requested_blocks = max_len;
cdrom[id].packet_len = alloc_length;
}
else
{
cdrom[id].requested_blocks = 1;
cdrom[id].packet_len = max_len * alloc_length;
}
cdrom[id].requested_blocks = max_len;
cdrom[id].packet_len = alloc_length;
cdrom_set_buf_len(id, BufLen, &cdrom[id].packet_len);
if (cdrom[id].requested_blocks > 1)
{
cdrom_data_command_finish(id, alloc_length, alloc_length / cdrom[id].requested_blocks, alloc_length, 0);
}
else
{
cdrom_data_command_finish(id, alloc_length, alloc_length, alloc_length, 0);
}
cdrom_data_command_finish(id, alloc_length, alloc_length / cdrom[id].requested_blocks, alloc_length, 0);
cdrom[id].all_blocks_total = cdrom[id].block_total;
if (cdrom[id].packet_status != CDROM_PHASE_COMPLETE)
{
@@ -3434,63 +3402,6 @@ atapi_out:
/* cdrom_log("CD-ROM %i: Phase: %02X, request length: %i\n", cdrom[id].phase, cdrom[id].request_length); */
}
/* This is for block reads. */
int cdrom_block_check(uint8_t id)
{
uint32_t alloc_length = 0;
int ret = 0;
/* If this is a media access command, and we hit the end of the block but not the entire length,
read the next block. */
if (cdrom_is_media_access(id))
{
/* We have finished the current block. */
cdrom_log("CD-ROM %i: %i bytes total read, %i bytes all total\n", id, cdrom[id].total_read, cdrom[id].all_blocks_total);
if (cdrom[id].total_read >= cdrom[id].all_blocks_total)
{
cdrom_log("CD-ROM %i: %i bytes read, current block finished\n", id, cdrom[id].total_read);
/* Read the next block. */
ret = cdrom_read_blocks(id, &alloc_length, 0);
if (ret == -1)
{
/* Return value is -1 - there are no further blocks to read. */
cdrom_log("CD-ROM %i: %i bytes read, no further blocks to read\n", id, cdrom[id].total_read);
cdrom[id].status = BUSY_STAT;
cdrom_buf_free(id);
return 1;
}
else if (ret == 0)
{
/* Return value is 0 - an error has occurred. */
cdrom_log("CD-ROM %i: %i bytes read, error while reading blocks\n", id, cdrom[id].total_read);
cdrom[id].status = BUSY_STAT | (cdrom[id].status & ERR_STAT);
cdrom_buf_free(id);
return 0;
}
else
{
/* Return value is 1 - sectors have been read successfully. */
cdrom[id].pos = 0;
cdrom[id].all_blocks_total += cdrom[id].block_total;
cdrom_log("CD-ROM %i: %i bytes read, next block(s) read successfully, %i bytes are still left\n", id, cdrom[id].total_read, cdrom[id].all_blocks_total - cdrom[id].total_read);
return 1;
}
}
else
{
/* Blocks not exhausted, tell the host to check for buffer length. */
cdrom_log("CD-ROM %i: Blocks not yet finished\n", id);
return 1;
}
}
else
{
/* Not a media access command, ALWAYS do the callback. */
cdrom_log("CD-ROM %i: Not a media access command\n", id);
return 1;
}
}
/* This is the general ATAPI callback. */
void cdrom_callback(uint8_t id) /* Callback for non-Read CD commands */
{
@@ -3831,7 +3742,6 @@ uint32_t cdrom_read(uint8_t channel, int length)
uint8_t id = atapi_cdrom_drives[channel];
uint32_t temp = 0;
int ret = 0;
if (id > CDROM_NUM)
{
@@ -3844,20 +3754,23 @@ uint32_t cdrom_read(uint8_t channel, int length)
if (!cdbufferb)
return 0;
/* Make sure we return a 0 and don't attempt to read from the buffer if we're transferring bytes beyond it,
which can happen when issuing media access commands with an allocated length below minimum request length
(which is 1 sector = 2048 bytes). */
switch(length)
{
case 1:
temp = cdbufferb[cdrom[id].pos];
temp = (cdrom[id].pos < cdrom[id].packet_len) ? cdbufferb[cdrom[id].pos] : 0;
cdrom[id].pos++;
cdrom[id].request_pos++;
break;
case 2:
temp = cdbufferw[cdrom[id].pos >> 1];
temp = (cdrom[id].pos < cdrom[id].packet_len) ? cdbufferw[cdrom[id].pos >> 1] : 0;
cdrom[id].pos += 2;
cdrom[id].request_pos += 2;
break;
case 4:
temp = cdbufferl[cdrom[id].pos >> 2];
temp = (cdrom[id].pos < cdrom[id].packet_len) ? cdbufferl[cdrom[id].pos >> 2] : 0;
cdrom[id].pos += 4;
cdrom[id].request_pos += 4;
break;
@@ -3867,26 +3780,12 @@ uint32_t cdrom_read(uint8_t channel, int length)
if (cdrom[id].packet_status == CDROM_PHASE_DATA_IN)
{
cdrom[id].total_read += length;
ret = cdrom_block_check(id);
/* If the block check has returned 0, this means all the requested blocks have been read, therefore the command has finished. */
if (ret)
if (cdrom[id].request_pos >= cdrom[id].request_length)
{
cdrom_log("CD-ROM %i: Return value is 1 (request length: %i)\n", id, cdrom[id].request_length);
if (cdrom[id].request_pos >= cdrom[id].request_length)
{
/* Time for a DRQ. */
cdrom_log("CD-ROM %i: Issuing read callback\n", id);
cdrom_callback(id);
}
else
{
cdrom_log("CD-ROM %i: Doing nothing\n", id);
}
}
else
{
cdrom_log("CD-ROM %i: Return value is 0\n", id);
/* Time for a DRQ. */
cdrom_log("CD-ROM %i: Issuing read callback\n", id);
cdrom[id].total_read += cdrom[id].request_length;
cdrom_callback(id);
}
cdrom_log("CD-ROM %i: Returning: %02X (buffer position: %i, request position: %i, total: %i)\n", id, temp, cdrom[id].pos, cdrom[id].request_pos, cdrom[id].total_read);
return temp;

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -21,6 +21,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "cdrom.h"

View File

@@ -8,7 +8,7 @@
*
* Configuration file handler.
*
* Version: @(#)config.c 1.0.21 2017/10/13
* Version: @(#)config.c 1.0.25 2017/10/21
*
* Authors: Sarah Walker,
* Miran Grca, <mgrca8@gmail.com>
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <wchar.h>
#include <inttypes.h>
#include "86box.h"
#include "ibm.h"
#include "cpu/cpu.h"
#include "nvr.h"
@@ -102,6 +103,7 @@ typedef struct {
wchar_t config_file_default[256];
static list_t config_head;
@@ -326,8 +328,9 @@ config_read(wchar_t *fn)
}
(void)fclose(f);
config_dump();
if (do_dump_config)
config_dump();
return(1);
}
@@ -415,23 +418,8 @@ load_general(void)
vid_resize = !!config_get_int(cat, "vid_resize", 0);
memset(temp, '\0', sizeof(temp));
p = config_get_string(cat, "vid_renderer", "d3d9");
if (p != NULL)
strcpy(temp, p);
if (! strcmp(temp, "ddraw"))
vid_api = 0;
else if (! strcmp(temp, "d3d9"))
vid_api = 1;
#ifdef USE_VNC
else if (! strcmp(temp, "vnc"))
vid_api = 2;
#endif
#ifdef USE_RDP
else if (! strcmp(temp, "rdp"))
vid_api = 3;
#endif
else
vid_api = 1; /* default to d3d9 on invalid values */
p = config_get_string(cat, "vid_renderer", "default");
vid_api = plat_vidapi(p);
config_delete_var(cat, "vid_api");
video_fullscreen_scale = config_get_int(cat, "video_fullscreen_scale", 0);
@@ -705,7 +693,10 @@ load_other_peripherals(void)
else
scsi_card_current = 0;
memset(hdc_name, '\0', sizeof(hdc_name));
if (hdc_name) {
free(hdc_name);
hdc_name = NULL;
}
p = config_get_string(cat, "hdc", NULL);
if (p == NULL) {
p = config_get_string(cat, "hdd_controller", NULL);
@@ -713,12 +704,17 @@ load_other_peripherals(void)
config_delete_var(cat, "hdd_controller");
}
if (p == NULL) {
if (machines[machine].flags & MACHINE_HAS_HDC)
if (machines[machine].flags & MACHINE_HAS_HDC) {
hdc_name = (char *) malloc((strlen("internal") + 1) * sizeof(char));
strcpy(hdc_name, "internal");
else
} else {
hdc_name = (char *) malloc((strlen("none") + 1) * sizeof(char));
strcpy(hdc_name, "none");
} else
}
} else {
hdc_name = (char *) malloc((strlen(p) + 1) * sizeof(char));
strcpy(hdc_name, p);
}
config_set_string(cat, "hdc", hdc_name);
memset(temp, '\0', sizeof(temp));
@@ -1133,6 +1129,11 @@ config_load(wchar_t *fn)
vid_api = 1;
enable_sync = 1;
joystick_type = 7;
if (hdc_name) {
free(hdc_name);
hdc_name = NULL;
}
hdc_name = (char *) malloc((strlen("none") + 1) * sizeof(char));
strcpy(hdc_name, "none");
serial_enabled[0] = 0;
serial_enabled[1] = 0;
@@ -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]);
}

View File

@@ -8,7 +8,7 @@
*
* Configuration file handler header.
*
* Version: @(#)config.h 1.0.3 2017/10/13
* Version: @(#)config.h 1.0.5 2017/10/18
*
* Authors: Sarah Walker,
* Miran Grca, <mgrca8@gmail.com>
@@ -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

View File

@@ -7,6 +7,7 @@
#ifndef INFINITY
# define INFINITY (__builtin_inff())
#endif
#include "../86box.h"
#include "../ibm.h"
#include "cpu.h"
#include "x86.h"

View File

@@ -7,6 +7,7 @@
#ifndef INFINITY
# define INFINITY (__builtin_inff())
#endif
#include "../86box.h"
#include "../ibm.h"
#include "cpu.h"
#include "x86.h"

View File

@@ -6,6 +6,7 @@
#ifndef INFINITY
# define INFINITY (__builtin_inff())
#endif
#include "../86box.h"
#include "../ibm.h"
#include "cpu.h"
#include "x86.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -30,6 +30,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "cpu.h"
#include "x86.h"

View File

@@ -2,6 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../mem.h"
#include "x86_ops.h"

View File

@@ -2,6 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../mem.h"
#include "x86.h"

View File

@@ -2,6 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../mem.h"
#include "cpu.h"

View File

@@ -12,6 +12,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../mem.h"
#include "cpu.h"

View File

@@ -2,6 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "codegen_timing_common.h"

View File

@@ -13,6 +13,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../mem.h"
#include "cpu.h"

View File

@@ -2,6 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "cpu.h"
#include "x86.h"

View File

@@ -5,6 +5,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../mem.h"
#include "cpu.h"

View File

@@ -5,6 +5,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../mem.h"
#include "cpu.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* leilei,
@@ -22,6 +22,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "cpu.h"
#include "../device.h"

View File

@@ -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);

View File

@@ -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;

View File

@@ -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))
{

View File

@@ -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))
{

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <stdarg.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../mem.h"
#include "../nvr.h"

View File

@@ -4,6 +4,7 @@
#include <wchar.h>
#define fplog 0
#include <math.h>
#include "../86box.h"
#include "../ibm.h"
#include "../pic.h"
#include "x86.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2016 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
@@ -20,6 +21,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "cpu/cpu.h"
#include "config.h"
@@ -43,7 +45,7 @@ device_init(void)
}
void
void *
device_add(device_t *d)
{
void *priv = NULL;
@@ -63,7 +65,9 @@ device_add(device_t *d)
}
devices[c] = d;
device_priv[c] = priv;
device_priv[c] = priv;
return priv;
}

View File

@@ -98,7 +98,7 @@ extern "C" {
#endif
extern void device_init(void);
extern void device_add(device_t *d);
extern void *device_add(device_t *d);
extern void device_close_all(void);
extern void device_reset_all(void);
extern void *device_get_priv(device_t *d);

View File

@@ -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, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2016,2017 Miran Grca.
* Copyright 2017 Fred N. van Kempen.
*/
@@ -19,6 +20,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../device.h"
@@ -26,7 +28,7 @@
#include "hdc.h"
char hdc_name[16]; /* configured HDC name */
char *hdc_name; /* configured HDC name */
int hdc_current;
@@ -71,8 +73,8 @@ static device_t inthdc_device = {
static struct {
char name[50];
char internal_name[16];
char *name;
char *internal_name;
device_t *device;
int is_mfm;
} controllers[] = {

View File

@@ -27,7 +27,7 @@
* least 7 devices, with each device being
* able to support 8 units, but hey... */
extern char hdc_name[16];
extern char *hdc_name;
extern int hdc_current;

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -26,6 +26,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../io.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -65,6 +65,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../dma.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -28,6 +28,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../io.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -57,6 +57,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../dma.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -36,6 +36,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../mem.h"

View File

@@ -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, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../ui.h"
#include "hdd.h"

View File

@@ -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.6 2017/10/19
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -28,6 +28,7 @@
#include <stdarg.h>
#include <wchar.h>
#include <errno.h>
#include "../86box.h"
#include "../ibm.h"
#include "../plat.h"
#include "hdd.h"
@@ -49,11 +50,13 @@ static char empty_sector[512];
static char *empty_sector_1mb;
int hdd_image_do_log = 0;
#ifdef ENABLE_HDD_LOG
int hdd_image_do_log = ENABLE_HDD_LOG;
#endif
void hdd_image_log(const char *format, ...)
{
#ifdef ENABLE_HDD_IMAGE_LOG
#ifdef ENABLE_HDD_LOG
if (hdd_image_do_log)
{
va_list ap;

View File

@@ -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, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
@@ -19,6 +20,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "cpu/x86.h"
#include "mem.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
@@ -21,6 +22,7 @@
#include <string.h>
#include <stdarg.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../mem.h"
@@ -166,7 +168,9 @@ int floppyrate[4];
int floppyint;
int fdc_do_log = 0;
#ifdef ENABLE_FDC_LOG
int fdc_do_log = ENABLE_FDC_LOG;
#endif
void fdc_log(const char *format, ...)
{

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
@@ -19,6 +20,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "floppy.h"
#include "fdc.h"

View File

@@ -30,6 +30,7 @@
#include "zfile.h"*/
/* ELSE */
#define xmalloc malloc
#include "../86box.h"
#include "../ibm.h"
#include "fdi2raw.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -21,6 +21,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#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;

View File

@@ -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.9 2017/10/19
*
* Author: Miran Grca, <mgrca8@gmail.com>
* Copyright 2016,2017 Miran Grca.
@@ -23,6 +23,7 @@
#include <assert.h>
#include <wchar.h>
#include "../lzf/lzf.h"
#include "../86box.h"
#include "../ibm.h"
#include "../config.h"
#include "../dma.h"
@@ -112,36 +113,24 @@ enum
static uint16_t CRCTable[256];
#ifdef __MSC__
# pragma pack(push,1)
#pragma pack(push,1)
typedef struct
#else
typedef struct __attribute__((__packed__))
#endif
{
uint8_t buffer[10];
uint32_t pos;
uint32_t len;
} sliding_buffer_t;
#ifdef __MSC__
# pragma pack(pop)
#endif
#pragma pack(pop)
#ifdef __MSC__
# pragma pack(push,1)
#pragma pack(push,1)
typedef struct
#else
typedef struct __attribute__((__packed__))
#endif
{
uint32_t sync_marks;
uint32_t bits_obtained;
uint32_t bytes_obtained;
uint32_t sync_pos;
} find_t;
#ifdef __MSC__
# pragma pack(pop)
#endif
#pragma pack(pop)
uint8_t encoded_fm[64] = { 0xAA, 0xAB, 0xAE, 0xAF, 0xBA, 0xBB, 0xBE, 0xBF, 0xEA, 0xEB, 0xEE, 0xEF, 0xFA, 0xFB, 0xFE, 0xFF,
0xAA, 0xAB, 0xAE, 0xAF, 0xBA, 0xBB, 0xBE, 0xBF, 0xEA, 0xEB, 0xEE, 0xEF, 0xFA, 0xFB, 0xFE, 0xFF,
@@ -175,19 +164,13 @@ enum
FMT_POSTTRK_GAP4
};
#ifdef __MSC__
# pragma pack(push,1)
#pragma pack(push,1)
typedef struct
#else
typedef struct __attribute__((__packed__))
#endif
{
unsigned nibble0 :4;
unsigned nibble1 :4;
} split_byte_t;
#ifdef __MSC__
# pragma pack(pop)
#endif
#pragma pack(pop)
typedef union {
uint8_t byte;
@@ -205,12 +188,8 @@ typedef union {
Bits 10, 9 Zone type (3 = Commodore 64 zoned, 2 = Apple zoned, 1 = Pre-Apple zoned #2, 0 = Pre-Apple zoned #1)
Bit 11 Data and surface bits are stored in reverse byte endianness */
#ifdef __MSC__
# pragma pack(push,1)
#pragma pack(push,1)
struct
#else
struct __attribute__((__packed__))
#endif
{
FILE *f;
uint16_t version;
@@ -255,11 +234,11 @@ struct __attribute__((__packed__))
int turbo_pos;
uint16_t sector_id_bit_field[2][256][256][256];
} d86f[FDD_NUM];
#ifdef __MSC__
# pragma pack(pop)
#endif
#pragma pack(pop)
int d86f_do_log = 0;
#ifdef ENABLE_D86F_LOG
int d86f_do_log = ENABLE_D86F_LOG;
#endif
void d86f_log(const char *format, ...)
{

View File

@@ -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, <decwiz@yahoo.com>
* Copyright 2017 Fred N. van Kempen.
@@ -18,6 +18,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../floppy/floppy.h"
#include "floppy_common.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -21,6 +21,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../plat.h"
#include "floppy.h"

View File

@@ -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, <mgrca8@gmail.com>
* Copyright 2016,2017 Miran Grca.
@@ -18,6 +18,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../plat.h"
#include "floppy.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -22,6 +22,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#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);

View File

@@ -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, <decwiz@yahoo.com>
*
@@ -19,6 +19,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../plat.h"
#include "floppy.h"

View File

@@ -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 <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../plat.h"
#include "floppy.h"

View File

@@ -6,6 +6,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../device.h"

View File

@@ -3,6 +3,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../timer.h"

View File

@@ -3,6 +3,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../timer.h"

View File

@@ -24,6 +24,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../timer.h"

View File

@@ -3,6 +3,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../timer.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -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_TANDY || 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,14 @@ 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);
@@ -657,9 +606,4 @@ extern void x87_reset(void);
#endif
/* Configuration values. */
#define SERIAL_MAX 2
#define PARALLEL_MAX 1
#endif /*EMU_IBM_H*/

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -21,6 +21,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "cpu/cpu.h"
#include "device.h"

View File

@@ -5,6 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "io.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "plat_keyboard.h"
#include "keyboard.h"

View File

@@ -5,6 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "io.h"
#include "mem.h"

View File

@@ -8,17 +8,21 @@
*
* Intel 8042 (AT keyboard controller) emulation.
*
* Version: @(#)keyboard_at.c 1.0.3 2017/09/24
* Version: @(#)keyboard_at.c 1.0.5 2017/10/19
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "io.h"
#include "pic.h"
@@ -127,7 +131,9 @@ static uint8_t nont_to_t[256] = { 0xFF, 0x43, 0x41, 0x3F, 0x3D, 0x3B, 0x3C, 0x58
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF };
int keyboard_at_do_log = 0;
#ifdef ENABLE_KEYBOARD_AT_LOG
int keyboard_at_do_log = ENABLE_KEYBOARD_AT_LOG;
#endif
void keyboard_at_log(const char *format, ...)
{

View File

@@ -3,6 +3,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "io.h"
#include "mem.h"

View File

@@ -5,6 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "io.h"
#include "mem.h"

View File

@@ -5,6 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "io.h"
#include "mem.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -22,6 +22,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../mem.h"

View File

@@ -3,6 +3,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../nmi.h"

View File

@@ -2,6 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../pic.h"
#include "../pit.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../mem.h"
#include "../memregs.h"
@@ -132,6 +133,10 @@ static void i430fx_write(int func, int addr, uint8_t val, void *priv)
i430fx_map(0xec000, 0x04000, val >> 4);
pclog("i430fx_write : PAM6 write %02X\n", val);
break;
case 0x72: /*SMRAM*/
if ((card_i430fx[0x72] ^ val) & 0x48)
i430fx_map(0xa0000, 0x20000, ((val & 0x48) == 0x48) ? 3 : 0);
break;
}
card_i430fx[addr] = val;
@@ -184,6 +189,7 @@ static void i430fx_reset(void)
static void i430fx_pci_reset(void)
{
i430fx_write(0, 0x59, 0x00, NULL);
i430fx_write(0, 0x72, 0x02, NULL);
}

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../mem.h"
@@ -130,6 +131,10 @@ static void i430hx_write(int func, int addr, uint8_t val, void *priv)
if ((card_i430hx[0x5f] ^ val) & 0xf0)
i430hx_map(0xec000, 0x04000, val >> 4);
break;
case 0x72: /*SMRAM*/
if ((card_i430hx[0x72] ^ val) & 0x48)
i430hx_map(0xa0000, 0x20000, ((val & 0x48) == 0x48) ? 3 : 0);
break;
}
card_i430hx[addr] = val;
@@ -171,6 +176,7 @@ static void i430hx_reset(void)
static void i430hx_pci_reset(void)
{
i430hx_write(0, 0x59, 0x00, NULL);
i430hx_write(0, 0x72, 0x02, NULL);
}

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../mem.h"
#include "../memregs.h"

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pci.h"
@@ -133,6 +134,10 @@ static void i430vx_write(int func, int addr, uint8_t val, void *priv)
i430vx_map(0xec000, 0x04000, val >> 4);
/* pclog("i430vx_write : PAM6 write %02X\n", val); */
break;
case 0x72: /*SMRAM*/
if ((card_i430vx[0x72] ^ val) & 0x48)
i430vx_map(0xa0000, 0x20000, ((val & 0x48) == 0x48) ? 3 : 0);
break;
}
card_i430vx[addr] = val;
@@ -174,6 +179,7 @@ static void i430vx_reset(void)
static void i430vx_pci_reset(void)
{
i430vx_write(0, 0x59, 0x00, NULL);
i430vx_write(0, 0x72, 0x02, NULL);
}

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pci.h"
@@ -130,6 +131,10 @@ static void i440fx_write(int func, int addr, uint8_t val, void *priv)
if ((card_i440fx[0x5f] ^ val) & 0xf0)
i440fx_map(0xec000, 0x04000, val >> 4);
break;
case 0x72: /*SMRAM*/
if ((card_i440fx[0x72] ^ val) & 0x48)
i440fx_map(0xa0000, 0x20000, ((val & 0x48) == 0x48) ? 3 : 0);
break;
}
card_i440fx[addr] = val;
@@ -175,6 +180,7 @@ static void i440fx_reset(void)
static void i440fx_pci_reset(void)
{
i440fx_write(0, 0x59, 0x00, NULL);
i440fx_write(0, 0x72, 0x02, NULL);
}

View File

@@ -5,6 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../io.h"

View File

@@ -2,6 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../lpt.h"

View File

@@ -5,6 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../mem.h"

View File

@@ -5,6 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../io.h"

View File

@@ -6,6 +6,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "machine.h"

View File

@@ -255,6 +255,7 @@ SeeAlso: #P0178,#P0187
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../io.h"

View File

@@ -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.4 2017/10/18
*
* Authors: Original by GreatPsycho for PCem.
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -21,6 +21,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../cpu/x86.h"
@@ -29,7 +30,7 @@
#include "machine.h"
#define SCAT_DEBUG 2
#define SCAT_DEBUG 1
#define SCAT_DMA_WS_CTL 0x01
#define SCAT_VERSION 0x40
@@ -176,12 +177,10 @@ set_xms_bound(uint8_t val)
0x160000 - scat_xms_bound,
MEM_READ_EXTERNAL | MEM_WRITE_EXTERNAL);
} else {
#if 0
for (i=0; i<6; i++)
mem_mapping_disable(&scat_shadowram_mapping[i]);
if (mem_size > 1024)
mem_mapping_enable(&ram_high_mapping);
#endif
if (scat_xms_bound > max_xms)
scat_xms_bound = max_xms;
@@ -279,10 +278,8 @@ ems_state(int state)
} else {
mem_mapping_set_exec(&scat_mapping[i], ram+base_addr);
mem_mapping_disable(&scat_mapping[i]);
#if 0
if (i < 24)
mem_mapping_enable(&scat_top_mapping[i]);
#endif
}
}
}
@@ -490,7 +487,6 @@ ics_write(uint8_t idx, uint8_t val)
break;
case SCAT_EMS_CTL:
pclog("SCAT: EMSctrl(%02x)\n", val);
if (val & 0x40) {
if (val & 1) {
io_sethandler(0x0218, 3,
@@ -526,24 +522,18 @@ pclog("SCAT: EMSctrl(%02x)\n", val);
case SCAT_DRAM_CONFIG:
if ((scat_regs[SCAT_EXT_BOUNDARY] & 0x40) == 0) {
pclog("SCAT: 0\n");
if ((val & 0x0f) == 3) {
pclog("SCAT: 3\n");
if (mem_size > 1024)
mem_mapping_disable(&ram_high_mapping);
for (idx=0; idx<6; idx++)
mem_mapping_enable(&scat_shadowram_mapping[idx]);
} else {
pclog("SCAT: 0\n");
for (idx=0; idx<6; idx++)
mem_mapping_disable(&scat_shadowram_mapping[idx]);
#if 0
if (mem_size > 1024)
mem_mapping_enable(&ram_high_mapping);
#endif
}
} else {
pclog("SCAT: 1\n");
for (idx=0; idx<6; idx++)
mem_mapping_disable(&scat_shadowram_mapping[idx]);
if (mem_size > 1024)
@@ -687,8 +677,6 @@ scat_init(void)
*/
pclog("SCAT: mem_size=%d\n", mem_size);
#if 0
/* Create the 32 EMS page frame mappings for 256-640K. */
for (i=0; i<24; i++) {
mem_mapping_add(&scat_top_mapping[i],
@@ -697,12 +685,9 @@ scat_init(void)
ems_pgwr, NULL, NULL,
mem_size > 256+(i<<4) ? ram+0x40000+(i<<14) : NULL,
MEM_MAPPING_INTERNAL, NULL);
// mem_mapping_enable(&scat_top_mapping[i]);
mem_mapping_disable(&scat_top_mapping[i]);
mem_mapping_enable(&scat_top_mapping[i]);
}
#endif
#if 0
/* Re-map the 128K at A0000 (video BIOS) to above 16MB+top. */
mem_mapping_add(&scat_A000_mapping,
0xA0000, 0x20000,
@@ -711,9 +696,7 @@ scat_init(void)
ram+0xA0000,
MEM_MAPPING_INTERNAL, NULL);
mem_mapping_disable(&scat_A000_mapping);
#endif
#if 0
/* Create 32 page frames for EMS, each 16K. */
for (i=0; i<32; i++) {
scat_ems[i].regs_2x8 = 0xff;
@@ -726,9 +709,8 @@ scat_init(void)
0, &scat_ems[i]);
mem_mapping_disable(&scat_mapping[i]);
}
#endif
// for (i=4; i<10; i++) isram[i] = 0;
for (i=4; i<10; i++) isram[i] = 0;
/* Re-map the BIOS ROM (C0000-FFFFF) area. */
for (i=12; i<16; i++) {
@@ -740,7 +722,6 @@ scat_init(void)
0, NULL);
}
#if 0
for (i=0; i<6; i++) {
mem_mapping_add(&scat_shadowram_mapping[i],
0x100000 + (i<<16), 0x10000,
@@ -749,7 +730,6 @@ scat_init(void)
mem_size >= 1024 ? ram+get_addr(0x100000+(i<<16), NULL) : NULL,
MEM_MAPPING_INTERNAL, NULL);
}
#endif
set_xms_bound(0);
shadow_state_update();

View File

@@ -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, <mgrca8@gmail.com>
*
@@ -19,6 +19,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../memregs.h"

View File

@@ -6,6 +6,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../io.h"

View File

@@ -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, <mgrca8@gmail.com>
*
@@ -17,6 +17,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pci.h"

View File

@@ -5,6 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../mem.h"

View File

@@ -2,6 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../dma.h"
#include "../pic.h"

View File

@@ -5,6 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../nmi.h"

View File

@@ -5,6 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../nmi.h"

View File

@@ -2,6 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../nmi.h"
#include "../pic.h"

View File

@@ -5,6 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../io.h"

View File

@@ -2,6 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../io.h"

View File

@@ -2,6 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../cpu/x86.h"

View File

@@ -2,6 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../nmi.h"
#include "../mem.h"

View File

@@ -2,6 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../nmi.h"
#include "../pit.h"

View File

@@ -3,6 +3,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../io.h"

View File

@@ -5,6 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"

View File

@@ -6,6 +6,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "cpu/cpu.h"
#include "cpu/x86_ops.h"

View File

@@ -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, <mgrca8@gmail.com>
* Copyright 2016-2017 Miran Grca.
@@ -18,6 +18,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "io.h"
#include "memregs.h"

View File

@@ -8,7 +8,7 @@
*
* Common driver module for MOUSE devices.
*
* Version: @(#)mouse.c 1.0.9 2017/10/09
* Version: @(#)mouse.c 1.0.10 2017/10/17
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -26,6 +26,7 @@
#include "device.h"
#include "mouse.h"
#include "machine/machine.h"
#include "plat_mouse.h"
static mouse_t mouse_none = {
@@ -81,6 +82,24 @@ mouse_emu_close(void)
}
void
mouse_process(void)
{
static int poll_delay = 2;
int x, y, z;
if (--poll_delay) return;
mouse_poll_host();
mouse_get_mickeys(&x, &y, &z);
mouse_poll(x, y, z, mouse_buttons);
poll_delay = 2;
}
void
mouse_poll(int x, int y, int z, int b)
{

Some files were not shown because too many files have changed in this diff Show More