mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 01:25:33 -07:00
Merge branch 'master' of ssh://github.com/86Box/86Box
This commit is contained in:
40
src/86box.c
40
src/86box.c
@@ -403,10 +403,12 @@ pc_init(int argc, char *argv[])
|
||||
{
|
||||
char *ppath = NULL, *rpath = NULL;
|
||||
char *cfg = NULL, *p;
|
||||
char temp[2048];
|
||||
char temp[2048], *fn[FDD_NUM] = { NULL };
|
||||
char drive = 0, *temp2 = NULL;
|
||||
struct tm *info;
|
||||
time_t now;
|
||||
int c, lvmp = 0;
|
||||
int i;
|
||||
#ifdef ENABLE_NG
|
||||
int ng = 0;
|
||||
#endif
|
||||
@@ -456,6 +458,13 @@ pc_init(int argc, char *argv[])
|
||||
|
||||
if (!strcasecmp(argv[c], "--help") || !strcasecmp(argv[c], "-?")) {
|
||||
usage:
|
||||
for (i = 0; i < FDD_NUM; i++) {
|
||||
if (fn[i] != NULL) {
|
||||
free(fn[i]);
|
||||
fn[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
printf("\nUsage: 86box [options] [cfg-file]\n\n");
|
||||
printf("Valid options are:\n\n");
|
||||
printf("-? or --help - show this information\n");
|
||||
@@ -471,6 +480,7 @@ usage:
|
||||
#ifdef _WIN32
|
||||
printf("-H or --hwnd id,hwnd - sends back the main dialog's hwnd\n");
|
||||
#endif
|
||||
printf("-I or --image d:path - load 'path' as floppy image on drive d\n");
|
||||
printf("-L or --logfile path - set 'path' to be the logfile\n");
|
||||
printf("-N or --noconfirm - do not ask for confirmation on quit\n");
|
||||
printf("-O or --dumpcfg - dump config file after loading\n");
|
||||
@@ -519,6 +529,25 @@ usage:
|
||||
goto usage;
|
||||
|
||||
cfg = argv[++c];
|
||||
} else if (!strcasecmp(argv[c], "--image") || !strcasecmp(argv[c], "-I")) {
|
||||
if ((c + 1) == argc)
|
||||
goto usage;
|
||||
|
||||
temp2 = (char *) calloc(2048, 1);
|
||||
sscanf(argv[++c], "%c:%s", &drive, temp2);
|
||||
if (drive > 0x40)
|
||||
drive = (drive & 0x1f) - 1;
|
||||
else
|
||||
drive = drive & 0x1f;
|
||||
if (drive < 0)
|
||||
drive = 0;
|
||||
if (drive >= FDD_NUM)
|
||||
drive = FDD_NUM - 1;
|
||||
fn[(int) drive] = (char *) calloc(2048, 1);
|
||||
strcpy(fn[(int) drive], temp2);
|
||||
pclog("Drive %c: %s\n", drive + 0x41, fn[(int) drive]);
|
||||
free(temp2);
|
||||
temp2 = NULL;
|
||||
} else if (!strcasecmp(argv[c], "--vmname") || !strcasecmp(argv[c], "-V")) {
|
||||
if ((c + 1) == argc)
|
||||
goto usage;
|
||||
@@ -738,6 +767,15 @@ usage:
|
||||
/* Load the configuration file. */
|
||||
config_load();
|
||||
|
||||
for (i = 0; i < FDD_NUM; i++) {
|
||||
if (fn[i] != NULL) {
|
||||
if (strlen(fn[i]) <= 511)
|
||||
strncpy(floppyfns[i], fn[i], 511);
|
||||
free(fn[i]);
|
||||
fn[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Load the desired language */
|
||||
if (lang_init)
|
||||
lang_id = lang_init;
|
||||
|
||||
@@ -321,6 +321,34 @@ cdrom_audio_callback(cdrom_t *dev, int16_t *output, int len)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static __inline int
|
||||
bin2bcd (int x)
|
||||
{
|
||||
return (x % 10) | ((x / 10) << 4);
|
||||
}
|
||||
|
||||
static __inline int
|
||||
bcd2bin (int x)
|
||||
{
|
||||
return (x >> 4) * 10 + (x & 0x0f);
|
||||
}
|
||||
|
||||
static void
|
||||
msf_from_bcd(int *m, int *s, int *f)
|
||||
{
|
||||
*m = bcd2bin(*m);
|
||||
*s = bcd2bin(*s);
|
||||
*f = bcd2bin(*f);
|
||||
}
|
||||
|
||||
static void
|
||||
msf_to_bcd(int *m, int *s, int *f)
|
||||
{
|
||||
*m = bin2bcd(*m);
|
||||
*s = bin2bcd(*s);
|
||||
*f = bin2bcd(*f);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
cdrom_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len, int ismsf)
|
||||
{
|
||||
@@ -347,6 +375,10 @@ cdrom_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len, int ismsf)
|
||||
s = (pos >> 8) & 0xff;
|
||||
f = pos & 0xff;
|
||||
|
||||
/* NEC CDR-260 speaks BCD. */
|
||||
if ((dev->bus_type == CDROM_BUS_ATAPI) && dev->early)
|
||||
msf_from_bcd(&m, &s, &f);
|
||||
|
||||
if (pos == 0xffffff) {
|
||||
cdrom_log("CD-ROM %i: Playing from current position (MSF)\n", dev->id);
|
||||
pos = dev->seek_pos;
|
||||
@@ -356,6 +388,11 @@ cdrom_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len, int ismsf)
|
||||
m = (len >> 16) & 0xff;
|
||||
s = (len >> 8) & 0xff;
|
||||
f = len & 0xff;
|
||||
|
||||
/* NEC CDR-260 speaks BCD. */
|
||||
if ((dev->bus_type == CDROM_BUS_ATAPI) && dev->early)
|
||||
msf_from_bcd(&m, &s, &f);
|
||||
|
||||
len = MSFtoLBA(m, s, f) - 150;
|
||||
|
||||
cdrom_log("CD-ROM %i: MSF - pos = %08X len = %08X\n", dev->id, pos, len);
|
||||
@@ -462,7 +499,7 @@ cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf)
|
||||
{
|
||||
uint8_t ret;
|
||||
subchannel_t subc;
|
||||
int pos = 1;
|
||||
int pos = 1, m, s, f;
|
||||
uint32_t dat;
|
||||
|
||||
dev->ops->get_subchannel(dev, dev->seek_pos, &subc);
|
||||
@@ -488,14 +525,41 @@ cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf)
|
||||
|
||||
if (msf) {
|
||||
b[pos] = 0;
|
||||
b[pos + 1] = subc.abs_m;
|
||||
b[pos + 2] = subc.abs_s;
|
||||
b[pos + 3] = subc.abs_f;
|
||||
|
||||
/* NEC CDR-260 speaks BCD. */
|
||||
if ((dev->bus_type == CDROM_BUS_ATAPI) && dev->early) {
|
||||
m = subc.abs_m;
|
||||
s = subc.abs_s;
|
||||
f = subc.abs_f;
|
||||
msf_to_bcd(&m, &s, &f);
|
||||
b[pos + 1] = m;
|
||||
b[pos + 2] = s;
|
||||
b[pos + 3] = f;
|
||||
} else {
|
||||
b[pos + 1] = subc.abs_m;
|
||||
b[pos + 2] = subc.abs_s;
|
||||
b[pos + 3] = subc.abs_f;
|
||||
}
|
||||
|
||||
pos += 4;
|
||||
|
||||
b[pos] = 0;
|
||||
b[pos + 1] = subc.rel_m;
|
||||
b[pos + 2] = subc.rel_s;
|
||||
b[pos + 3] = subc.rel_f;
|
||||
|
||||
/* NEC CDR-260 speaks BCD. */
|
||||
if ((dev->bus_type == CDROM_BUS_ATAPI) && dev->early) {
|
||||
m = subc.rel_m;
|
||||
s = subc.rel_s;
|
||||
f = subc.rel_f;
|
||||
msf_to_bcd(&m, &s, &f);
|
||||
b[pos + 1] = m;
|
||||
b[pos + 2] = s;
|
||||
b[pos + 3] = f;
|
||||
} else {
|
||||
b[pos + 1] = subc.rel_m;
|
||||
b[pos + 2] = subc.rel_s;
|
||||
b[pos + 3] = subc.rel_f;
|
||||
}
|
||||
|
||||
pos += 4;
|
||||
} else {
|
||||
dat = MSFtoLBA(subc.abs_m, subc.abs_s, subc.abs_f) - 150;
|
||||
@@ -550,6 +614,7 @@ read_toc_normal(cdrom_t *dev, unsigned char *b, unsigned char start_track, int m
|
||||
{
|
||||
track_info_t ti;
|
||||
int i, len = 4;
|
||||
int m, s, f;
|
||||
int first_track, last_track;
|
||||
uint32_t temp;
|
||||
|
||||
@@ -600,9 +665,21 @@ read_toc_normal(cdrom_t *dev, unsigned char *b, unsigned char start_track, int m
|
||||
|
||||
if (msf) {
|
||||
b[len++] = 0;
|
||||
b[len++] = ti.m;
|
||||
b[len++] = ti.s;
|
||||
b[len++] = ti.f;
|
||||
|
||||
/* NEC CDR-260 speaks BCD. */
|
||||
if ((dev->bus_type == CDROM_BUS_ATAPI) && dev->early) {
|
||||
m = ti.m;
|
||||
s = ti.s;
|
||||
f = ti.f;
|
||||
msf_to_bcd(&m, &s, &f);
|
||||
b[len++] = m;
|
||||
b[len++] = s;
|
||||
b[len++] = f;
|
||||
} else {
|
||||
b[len++] = ti.m;
|
||||
b[len++] = ti.s;
|
||||
b[len++] = ti.f;
|
||||
}
|
||||
} else {
|
||||
temp = MSFtoLBA(ti.m, ti.s, ti.f) - 150;
|
||||
b[len++] = temp >> 24;
|
||||
@@ -619,7 +696,7 @@ static int
|
||||
read_toc_session(cdrom_t *dev, unsigned char *b, int msf)
|
||||
{
|
||||
track_info_t ti;
|
||||
int len = 4;
|
||||
int len = 4, m, s, f;
|
||||
uint32_t temp;
|
||||
|
||||
cdrom_log("read_toc_session(%08X, %08X, %i)\n", dev, b, msf);
|
||||
@@ -638,9 +715,21 @@ read_toc_session(cdrom_t *dev, unsigned char *b, int msf)
|
||||
|
||||
if (msf) {
|
||||
b[len++] = 0;
|
||||
b[len++] = ti.m;
|
||||
b[len++] = ti.s;
|
||||
b[len++] = ti.f;
|
||||
|
||||
/* NEC CDR-260 speaks BCD. */
|
||||
if ((dev->bus_type == CDROM_BUS_ATAPI) && dev->early) {
|
||||
m = ti.m;
|
||||
s = ti.s;
|
||||
f = ti.f;
|
||||
msf_to_bcd(&m, &s, &f);
|
||||
b[len++] = m;
|
||||
b[len++] = s;
|
||||
b[len++] = f;
|
||||
} else {
|
||||
b[len++] = ti.m;
|
||||
b[len++] = ti.s;
|
||||
b[len++] = ti.f;
|
||||
}
|
||||
} else {
|
||||
temp = MSFtoLBA(ti.m, ti.s, ti.f) - 150;
|
||||
b[len++] = temp >> 24;
|
||||
|
||||
@@ -104,7 +104,7 @@ intel_82335_write(uint16_t addr, uint16_t val, void *priv)
|
||||
shadowbios_write = !!(dev->regs[0x22] & 0x01);
|
||||
|
||||
/* Base System 512/640KB set */
|
||||
mem_set_mem_state_both(0x80000, 0x20000, (dev->regs[0x22] & 0x08) ? ENABLE_TOP_128KB : DISABLE_TOP_128KB);
|
||||
// mem_set_mem_state_both(0x80000, 0x20000, (dev->regs[0x22] & 0x08) ? ENABLE_TOP_128KB : DISABLE_TOP_128KB);
|
||||
|
||||
/* Video RAM shadow*/
|
||||
mem_set_mem_state_both(0xa0000, 0x20000, (dev->regs[0x22] & (0x04 << 8)) ? DETERMINE_VIDEO_RAM_WRITE_ACCESS : DISABLED_SHADOW);
|
||||
@@ -167,6 +167,7 @@ intel_82335_init(const device_t *info)
|
||||
|
||||
memset(dev->regs, 0, sizeof(dev->regs));
|
||||
|
||||
dev->regs[0x22] = 0x08;
|
||||
dev->regs[0x28] = 0xf9;
|
||||
|
||||
dev->cfg_locked = 0;
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t idx, regs[16];
|
||||
uint8_t idx, is_pci,
|
||||
regs[16];
|
||||
} opti5x7_t;
|
||||
|
||||
#ifdef ENABLE_OPTI5X7_LOG
|
||||
@@ -75,11 +76,20 @@ opti5x7_shadow_map(int cur_reg, opti5x7_t *dev)
|
||||
0 1 Read from DRAM (write protected)
|
||||
*/
|
||||
if (cur_reg == 0x06) {
|
||||
mem_set_mem_state_both(0xe0000, 0x10000, ((dev->regs[6] & 1) ? MEM_READ_INTERNAL : MEM_READ_EXTANY) | ((dev->regs[6] & 2) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state_both(0xf0000, 0x10000, ((dev->regs[6] & 4) ? MEM_READ_INTERNAL : MEM_READ_EXTANY) | ((dev->regs[6] & 8) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY));
|
||||
if (dev->is_pci) {
|
||||
mem_set_mem_state_cpu_both(0xe0000, 0x10000, ((dev->regs[6] & 1) ? MEM_READ_INTERNAL : MEM_READ_EXTANY) | ((dev->regs[6] & 2) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state_cpu_both(0xf0000, 0x10000, ((dev->regs[6] & 4) ? MEM_READ_INTERNAL : MEM_READ_EXTANY) | ((dev->regs[6] & 8) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY));
|
||||
} else {
|
||||
mem_set_mem_state_both(0xe0000, 0x10000, ((dev->regs[6] & 1) ? MEM_READ_INTERNAL : MEM_READ_EXTANY) | ((dev->regs[6] & 2) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state_both(0xf0000, 0x10000, ((dev->regs[6] & 4) ? MEM_READ_INTERNAL : MEM_READ_EXTANY) | ((dev->regs[6] & 8) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY));
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < 4; i++)
|
||||
mem_set_mem_state_both(0xc0000 + ((cur_reg & 1) << 16) + (i << 14), 0x4000, ((dev->regs[cur_reg] & (1 << (2 * i))) ? MEM_READ_INTERNAL : MEM_READ_EXTANY) | ((dev->regs[cur_reg] & (2 << (2 * i))) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY));
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (dev->is_pci)
|
||||
mem_set_mem_state_cpu_both(0xc0000 + ((cur_reg & 1) << 16) + (i << 14), 0x4000, ((dev->regs[cur_reg] & (1 << (2 * i))) ? MEM_READ_INTERNAL : MEM_READ_EXTANY) | ((dev->regs[cur_reg] & (2 << (2 * i))) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY));
|
||||
else
|
||||
mem_set_mem_state_both(0xc0000 + ((cur_reg & 1) << 16) + (i << 14), 0x4000, ((dev->regs[cur_reg] & (1 << (2 * i))) ? MEM_READ_INTERNAL : MEM_READ_EXTANY) | ((dev->regs[cur_reg] & (2 << (2 * i))) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY));
|
||||
}
|
||||
}
|
||||
|
||||
flushmmucache_nopc();
|
||||
@@ -161,6 +171,8 @@ opti5x7_init(const device_t *info)
|
||||
opti5x7_t *dev = (opti5x7_t *) malloc(sizeof(opti5x7_t));
|
||||
memset(dev, 0, sizeof(opti5x7_t));
|
||||
|
||||
dev->is_pci = info->local;
|
||||
|
||||
io_sethandler(0x0022, 0x0001, opti5x7_read, NULL, NULL, opti5x7_write, NULL, NULL, dev);
|
||||
io_sethandler(0x0024, 0x0001, opti5x7_read, NULL, NULL, opti5x7_write, NULL, NULL, dev);
|
||||
|
||||
@@ -182,3 +194,17 @@ const device_t opti5x7_device = {
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t opti5x7_pci_device = {
|
||||
.name = "OPTi 82C5x6/82C5x7 (PCI)",
|
||||
.internal_name = "opti5x7_pci",
|
||||
.flags = 0,
|
||||
.local = 1,
|
||||
.init = opti5x7_init,
|
||||
.close = opti5x7_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of the OPTi 82C822 VESA Local Bus to PCI Bridge Interface.
|
||||
* Implementation of the OPTi 82C822 VESA Local Bus to PCI
|
||||
* Bridge Interface.
|
||||
*
|
||||
*
|
||||
* Authors: Tiseno100,
|
||||
*
|
||||
* Copyright 2021 Tiseno100.
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2022 Miran Grca.
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
@@ -22,22 +23,30 @@
|
||||
#include <wchar.h>
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/timer.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/device.h>
|
||||
|
||||
#include <86box/io.h>
|
||||
#include <86box/apm.h>
|
||||
#include <86box/dma.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/smram.h>
|
||||
#include <86box/pci.h>
|
||||
|
||||
#include <86box/timer.h>
|
||||
#include <86box/pic.h>
|
||||
#include <86box/pit.h>
|
||||
#include <86box/port_92.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/chipset.h>
|
||||
#include <86box/spd.h>
|
||||
|
||||
/* Shadow RAM */
|
||||
#define SYSTEM_READ ((dev->pci_conf[0x44] & 2) ? MEM_READ_INTERNAL : MEM_READ_EXTANY)
|
||||
#define SYSTEM_WRITE ((dev->pci_conf[0x44] & 1) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY)
|
||||
#define SHADOW_READ ((dev->pci_conf[cur_reg] & (1 << (4 + i))) ? MEM_READ_INTERNAL : MEM_READ_EXTANY)
|
||||
#define SHADOW_WRITE ((dev->pci_conf[cur_reg] & (1 << i)) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY)
|
||||
typedef struct
|
||||
{
|
||||
uint8_t irq_convert,
|
||||
pci_regs[256];
|
||||
} opti822_t;
|
||||
|
||||
#define ENABLE_OPTI822_LOG 1
|
||||
#ifdef ENABLE_OPTI822_LOG
|
||||
int opti822_do_log = ENABLE_OPTI822_LOG;
|
||||
|
||||
@@ -47,220 +56,279 @@ opti822_log(const char *fmt, ...)
|
||||
va_list ap;
|
||||
|
||||
if (opti822_do_log) {
|
||||
va_start(ap, fmt);
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
va_start(ap, fmt);
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
#else
|
||||
# define opti822_log(fmt, ...)
|
||||
#define opti822_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
typedef struct opti822_t {
|
||||
uint8_t pci_conf[256];
|
||||
} opti822_t;
|
||||
|
||||
int opti822_irq_routing[7] = { 5, 9, 0x0a, 0x0b, 0x0c, 0x0e, 0x0f };
|
||||
|
||||
void
|
||||
opti822_shadow(int cur_reg, opti822_t *dev)
|
||||
/* NOTE: We currently cheat and pass all PCI shadow RAM accesses to ISA as well.
|
||||
This is because we currently do not have separate access mappings for
|
||||
PCI and ISA at all. */
|
||||
static void
|
||||
opti822_recalc(opti822_t *dev)
|
||||
{
|
||||
if (cur_reg == 0x44)
|
||||
mem_set_mem_state_both(0xf0000, 0x10000, SYSTEM_READ | SYSTEM_WRITE);
|
||||
else
|
||||
for (int i = 0; i < 4; i++)
|
||||
mem_set_mem_state_both(0xe0000 - (((cur_reg & 3) - 1) << 16) + (i << 14), 0x4000, SHADOW_READ | SHADOW_WRITE);
|
||||
int i, reg, bit_r, bit_w;
|
||||
int state;
|
||||
uint32_t base;
|
||||
|
||||
flushmmucache_nopc();
|
||||
for (i = 0; i < 12; i++) {
|
||||
base = 0x000c0000 + (i << 14);
|
||||
reg = 0x44 + ((i >> 2) ^ 3);
|
||||
bit_w = (i & 3);
|
||||
bit_r = bit_w + 4;
|
||||
bit_w = 1 << bit_w;
|
||||
bit_r = 1 << bit_r;
|
||||
state = (dev->pci_regs[reg] & bit_w) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY;
|
||||
state |= (dev->pci_regs[reg] & bit_r) ? MEM_READ_INTERNAL : MEM_READ_EXTANY;
|
||||
mem_set_mem_state_bus_both(base, 0x00004000, state);
|
||||
}
|
||||
|
||||
state = (dev->pci_regs[0x44] & 0x01) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY;
|
||||
state |= (dev->pci_regs[0x44] & 0x02) ? MEM_READ_INTERNAL : MEM_READ_EXTANY;
|
||||
mem_set_mem_state_bus_both(0x000f0000, 0x00010000, state);
|
||||
}
|
||||
|
||||
/* NOTE: We cheat here. The real ALi M1435 uses a level to edge triggered IRQ converter
|
||||
when the most siginificant bit is set. We work around that by manipulating the
|
||||
emulated PIC's ELCR register. */
|
||||
static void
|
||||
opti822_update_irqs(opti822_t *dev, int set)
|
||||
{
|
||||
uint8_t val;
|
||||
int i, reg;
|
||||
int shift, irq;
|
||||
int irq_map[8] = { -1, 5, 9, 10, 11, 12, 14, 15 };
|
||||
pic_t *temp_pic;
|
||||
|
||||
dev->irq_convert = (dev->pci_regs[0x53] & 0x08);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
reg = 0x80 + (i >> 1);
|
||||
shift = (i & 1) << 2;
|
||||
val = (dev->pci_regs[reg] >> shift) & 0x0f;
|
||||
irq = irq_map[val & 0x07];
|
||||
if (irq == -1)
|
||||
continue;
|
||||
temp_pic = (irq >= 8) ? &pic2 : &pic;
|
||||
irq &= 7;
|
||||
if (dev->irq_convert && set && (val & 0x08))
|
||||
temp_pic->elcr |= (1 << irq);
|
||||
else
|
||||
temp_pic->elcr &= ~(1 << irq);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
opti822_write(int func, int addr, uint8_t val, void *priv)
|
||||
opti822_pci_write(int func, int addr, uint8_t val, void *priv)
|
||||
{
|
||||
|
||||
opti822_t *dev = (opti822_t *) priv;
|
||||
int irq, irq_map[8] = { -1, 5, 9, 10, 11, 12, 14, 15 };
|
||||
|
||||
switch (func) {
|
||||
case 0x04: /* Command Register */
|
||||
dev->pci_conf[addr] = val & 0x40;
|
||||
opti822_log("opti822_write(%02X, %02X, %02X)\n", func, addr, val);
|
||||
|
||||
if (func > 0)
|
||||
return;
|
||||
|
||||
switch (addr) {
|
||||
/* Command Register */
|
||||
case 0x04:
|
||||
dev->pci_regs[addr] = (val & 0x40) | 0x07;
|
||||
break;
|
||||
|
||||
case 0x05: /* Command Register */
|
||||
dev->pci_conf[addr] = val & 1;
|
||||
/* Status Register */
|
||||
case 0x06:
|
||||
if (!(dev->pci_regs[0x52] & 0x04))
|
||||
dev->pci_regs[addr] = (val & 0x80);
|
||||
break;
|
||||
case 0x07:
|
||||
dev->pci_regs[addr] &= ~(val & 0xf9);
|
||||
break;
|
||||
|
||||
case 0x06: /* Status Register */
|
||||
dev->pci_conf[addr] |= val & 0xc0;
|
||||
break;
|
||||
|
||||
case 0x07: /* Status Register */
|
||||
dev->pci_conf[addr] = val & 0xa9;
|
||||
/* Master Latency Timer Register */
|
||||
case 0x0d:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x40:
|
||||
dev->pci_conf[addr] = val & 0xc0;
|
||||
dev->pci_regs[addr] = (val & 0xc0) | 0x01;
|
||||
break;
|
||||
|
||||
case 0x41:
|
||||
dev->pci_conf[addr] = val & 0xcf;
|
||||
/* TODO: Bit 15th enable the PCI Bridge when 1. */
|
||||
dev->pci_regs[addr] = val & 0xcf;
|
||||
break;
|
||||
|
||||
case 0x42:
|
||||
dev->pci_conf[addr] = val & 0xf8;
|
||||
dev->pci_regs[addr] = val & 0xf8;
|
||||
break;
|
||||
|
||||
case 0x43:
|
||||
dev->pci_conf[addr] = val;
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x44: /* Shadow RAM */
|
||||
case 0x45:
|
||||
case 0x46:
|
||||
case 0x47:
|
||||
dev->pci_conf[addr] = (addr == 0x44) ? (val & 0xcb) : val;
|
||||
opti822_shadow(addr, dev);
|
||||
case 0x44:
|
||||
dev->pci_regs[addr] = val & 0xcb;
|
||||
opti822_recalc(dev);
|
||||
break;
|
||||
case 0x45 ... 0x47:
|
||||
dev->pci_regs[addr] = val;
|
||||
opti822_recalc(dev);
|
||||
break;
|
||||
|
||||
/* Memory hole stuff. */
|
||||
case 0x48 ... 0x51:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x48:
|
||||
case 0x49:
|
||||
case 0x4a:
|
||||
case 0x4b:
|
||||
case 0x4c:
|
||||
case 0x4d:
|
||||
case 0x4e:
|
||||
case 0x4f:
|
||||
case 0x50:
|
||||
case 0x51:
|
||||
case 0x52:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x53:
|
||||
case 0x54:
|
||||
case 0x55:
|
||||
case 0x56:
|
||||
case 0x57:
|
||||
dev->pci_conf[addr] = val;
|
||||
dev->pci_regs[addr] = val;
|
||||
opti822_update_irqs(dev, 0);
|
||||
opti822_update_irqs(dev, 1);
|
||||
break;
|
||||
|
||||
case 0x54 ... 0x57:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x58:
|
||||
dev->pci_conf[addr] = val & 0xfc;
|
||||
dev->pci_regs[addr] = val & 0xfc;
|
||||
break;
|
||||
case 0x59 ... 0x5b:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x59:
|
||||
case 0x5a:
|
||||
case 0x5b:
|
||||
case 0x5c:
|
||||
case 0x5d:
|
||||
case 0x5e:
|
||||
case 0x5f:
|
||||
dev->pci_conf[addr] = val;
|
||||
case 0x5c ... 0x5f:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x60:
|
||||
dev->pci_conf[addr] = val & 0xfc;
|
||||
dev->pci_regs[addr] = val & 0xfc;
|
||||
break;
|
||||
case 0x61 ... 0x63:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x61:
|
||||
case 0x62:
|
||||
case 0x63:
|
||||
case 0x64:
|
||||
case 0x65:
|
||||
case 0x66:
|
||||
case 0x67:
|
||||
dev->pci_conf[addr] = val;
|
||||
case 0x64 ... 0x67:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x68:
|
||||
dev->pci_conf[addr] = val & 0xfc;
|
||||
dev->pci_regs[addr] = val & 0xfc;
|
||||
break;
|
||||
case 0x69 ... 0x6b:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x69:
|
||||
case 0x6a:
|
||||
case 0x6b:
|
||||
case 0x6c:
|
||||
case 0x6d:
|
||||
case 0x6e:
|
||||
case 0x6f:
|
||||
dev->pci_conf[addr] = val;
|
||||
case 0x6c ... 0x6f:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x70:
|
||||
dev->pci_conf[addr] = val & 0xfc;
|
||||
dev->pci_regs[addr] = val & 0xfc;
|
||||
break;
|
||||
|
||||
case 0x71:
|
||||
case 0x72:
|
||||
case 0x73:
|
||||
dev->pci_conf[addr] = val;
|
||||
case 0x71 ... 0x73:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x74:
|
||||
dev->pci_conf[addr] = val & 0xfc;
|
||||
dev->pci_regs[addr] = val & 0xf8;
|
||||
break;
|
||||
|
||||
/* ROMCS# and NVMCS# stuff. */
|
||||
case 0x75:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x76:
|
||||
dev->pci_conf[addr] = val;
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x77:
|
||||
dev->pci_conf[addr] = val & 0xe7;
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
/* Enabling of memory blocks at ISA bus. */
|
||||
case 0x78:
|
||||
dev->pci_conf[addr] = val;
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x79:
|
||||
dev->pci_conf[addr] = val & 0xfc;
|
||||
dev->pci_regs[addr] = val & 0xfc;
|
||||
break;
|
||||
|
||||
case 0x7a:
|
||||
case 0x7b:
|
||||
case 0x7c:
|
||||
case 0x7d:
|
||||
case 0x7e:
|
||||
dev->pci_conf[addr] = val;
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x7b ... 0x7c:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x7d ... 0x7e:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x7f:
|
||||
dev->pci_conf[addr] = val & 3;
|
||||
dev->pci_regs[addr] = val & 0x03;
|
||||
break;
|
||||
|
||||
case 0x80:
|
||||
case 0x81:
|
||||
case 0x80 ... 0x81:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
case 0x82:
|
||||
case 0x84:
|
||||
case 0x85:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x84 ... 0x85:
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
case 0x86:
|
||||
dev->pci_conf[addr] = val;
|
||||
dev->pci_regs[addr] = val;
|
||||
break;
|
||||
|
||||
case 0x88: /* PCI IRQ Routing */
|
||||
case 0x89: /* Very hacky implementation. Needs surely a rewrite after */
|
||||
case 0x8a: /* a PCI rework happens. */
|
||||
case 0x8b:
|
||||
case 0x8c:
|
||||
case 0x8d:
|
||||
case 0x8e:
|
||||
case 0x8f:
|
||||
dev->pci_conf[addr] = val;
|
||||
if (addr % 2) {
|
||||
pci_set_irq_routing(PCI_INTB, ((val & 0x0f) != 0) ? opti822_irq_routing[(val & 7) - 1] : PCI_IRQ_DISABLED);
|
||||
pci_set_irq_routing(PCI_INTA, (((val >> 4) & 0x0f) != 0) ? opti822_irq_routing[((val >> 4) & 7) - 1] : PCI_IRQ_DISABLED);
|
||||
} else {
|
||||
pci_set_irq_routing(PCI_INTD, ((val & 0x0f) != 0) ? opti822_irq_routing[(val & 7) - 1] : PCI_IRQ_DISABLED);
|
||||
pci_set_irq_routing(PCI_INTC, (((val >> 4) & 0x0f) != 0) ? opti822_irq_routing[((val >> 4) & 7) - 1] : PCI_IRQ_DISABLED);
|
||||
}
|
||||
break;
|
||||
case 0x88 ... 0x8f:
|
||||
dev->pci_regs[addr] = val;
|
||||
opti822_update_irqs(dev, 0);
|
||||
irq = irq_map[val & 0x07];
|
||||
if (irq >= 0) {
|
||||
opti822_log("Set IRQ routing: INT %c%c -> %02X\n", 0x41 + ((addr & 0x01) << 1), ((addr & 0x06) >> 1) + 1, irq);
|
||||
pci_set_irq_routing(PCI_INTA + ((addr & 0x07) << 1), irq);
|
||||
} else {
|
||||
opti822_log("Set IRQ routing: INT %c%c -> FF\n", 0x41 + ((addr & 0x01) << 1), ((addr & 0x06) >> 1) + 1);
|
||||
pci_set_irq_routing(PCI_INTA + ((addr & 0x07) << 1), PCI_IRQ_DISABLED);
|
||||
}
|
||||
irq = irq_map[(val >> 4) & 0x07];
|
||||
if (irq >= 0) {
|
||||
opti822_log("Set IRQ routing: INT %c%c -> %02X\n", 0x42 + ((addr & 0x01) << 1), ((addr & 0x06) >> 1) + 1, irq);
|
||||
pci_set_irq_routing(PCI_INTB + ((addr & 0x07) << 1), irq);
|
||||
} else {
|
||||
opti822_log("Set IRQ routing: INT %c%c -> FF\n", 0x42 + ((addr & 0x01) << 1), ((addr & 0x06) >> 1) + 1);
|
||||
pci_set_irq_routing(PCI_INTB + ((addr & 0x07) << 1), PCI_IRQ_DISABLED);
|
||||
}
|
||||
opti822_update_irqs(dev, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
opti822_log("OPTI822: dev->pci_conf[%02x] = %02x\n", addr, dev->pci_conf[addr]);
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
opti822_read(int func, int addr, void *priv)
|
||||
opti822_pci_read(int func, int addr, void *priv)
|
||||
{
|
||||
opti822_t *dev = (opti822_t *) priv;
|
||||
return dev->pci_conf[addr];
|
||||
uint8_t ret;
|
||||
|
||||
ret = 0xff;
|
||||
|
||||
if (func == 0)
|
||||
ret = dev->pci_regs[addr];
|
||||
|
||||
opti822_log("opti822_read(%02X, %02X) = %02X\n", func, addr, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -268,26 +336,36 @@ opti822_reset(void *priv)
|
||||
{
|
||||
opti822_t *dev = (opti822_t *) priv;
|
||||
|
||||
dev->pci_conf[0x00] = 0x45;
|
||||
dev->pci_conf[0x01] = 0x10;
|
||||
dev->pci_conf[0x02] = 0x22;
|
||||
dev->pci_conf[0x03] = 0xc8;
|
||||
dev->pci_conf[0x04] = 7;
|
||||
dev->pci_conf[0x06] = 0x40;
|
||||
dev->pci_conf[0x07] = 1;
|
||||
dev->pci_conf[0x08] = 1;
|
||||
dev->pci_conf[0x0b] = 6;
|
||||
dev->pci_conf[0x0d] = 0x20;
|
||||
dev->pci_conf[0x40] = 1;
|
||||
dev->pci_conf[0x43] = 0x20;
|
||||
dev->pci_conf[0x52] = 6;
|
||||
dev->pci_conf[0x53] = 0x90;
|
||||
pci_set_pmc(0);
|
||||
|
||||
memset(dev->pci_regs, 0, 256);
|
||||
|
||||
dev->pci_regs[0x00] = 0x45; dev->pci_regs[0x01] = 0x10; /*OPTi*/
|
||||
dev->pci_regs[0x02] = 0x22; dev->pci_regs[0x03] = 0xc8; /*82C822 PCIB*/
|
||||
dev->pci_regs[0x04] = 0x07;
|
||||
dev->pci_regs[0x06] = 0x80;
|
||||
dev->pci_regs[0x07] = 0x02;
|
||||
dev->pci_regs[0x08] = 0x01;
|
||||
dev->pci_regs[0x0b] = 0x06;
|
||||
dev->pci_regs[0x0d] = 0x20;
|
||||
|
||||
dev->pci_regs[0x40] = 0x01; dev->pci_regs[0x41] = 0x0c;
|
||||
dev->pci_regs[0x43] = 0x02;
|
||||
dev->pci_regs[0x52] = 0x06;
|
||||
dev->pci_regs[0x53] = 0x90;
|
||||
|
||||
dev->irq_convert = 0;
|
||||
|
||||
pci_set_irq_routing(PCI_INTA, PCI_IRQ_DISABLED);
|
||||
pci_set_irq_routing(PCI_INTB, PCI_IRQ_DISABLED);
|
||||
pci_set_irq_routing(PCI_INTC, PCI_IRQ_DISABLED);
|
||||
pci_set_irq_routing(PCI_INTD, PCI_IRQ_DISABLED);
|
||||
}
|
||||
|
||||
static void
|
||||
opti822_close(void *priv)
|
||||
opti822_close(void *p)
|
||||
{
|
||||
opti822_t *dev = (opti822_t *) priv;
|
||||
opti822_t *dev = (opti822_t *)p;
|
||||
|
||||
free(dev);
|
||||
}
|
||||
@@ -298,7 +376,7 @@ opti822_init(const device_t *info)
|
||||
opti822_t *dev = (opti822_t *) malloc(sizeof(opti822_t));
|
||||
memset(dev, 0, sizeof(opti822_t));
|
||||
|
||||
pci_add_card(PCI_ADD_NORTHBRIDGE, opti822_read, opti822_write, dev);
|
||||
pci_add_card(PCI_ADD_NORTHBRIDGE, opti822_pci_read, opti822_pci_write, dev);
|
||||
|
||||
opti822_reset(dev);
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
typedef struct
|
||||
{
|
||||
uint8_t idx, forced_green,
|
||||
is_pci,
|
||||
regs[256],
|
||||
scratch[2];
|
||||
|
||||
@@ -78,7 +79,10 @@ opti895_recalc(opti895_t *dev)
|
||||
shflags = MEM_READ_INTERNAL | MEM_WRITE_DISABLED;
|
||||
}
|
||||
|
||||
mem_set_mem_state_both(0xf0000, 0x10000, shflags);
|
||||
if (dev->is_pci)
|
||||
mem_set_mem_state_cpu_both(0xf0000, 0x10000, shflags);
|
||||
else
|
||||
mem_set_mem_state_both(0xf0000, 0x10000, shflags);
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
base = 0xd0000 + (i << 14);
|
||||
@@ -98,7 +102,10 @@ opti895_recalc(opti895_t *dev)
|
||||
}
|
||||
}
|
||||
|
||||
mem_set_mem_state_both(base, 0x4000, shflags);
|
||||
if (dev->is_pci)
|
||||
mem_set_mem_state_cpu_both(base, 0x4000, shflags);
|
||||
else
|
||||
mem_set_mem_state_both(base, 0x4000, shflags);
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
@@ -119,7 +126,10 @@ opti895_recalc(opti895_t *dev)
|
||||
}
|
||||
}
|
||||
|
||||
mem_set_mem_state_both(base, 0x4000, shflags);
|
||||
if (dev->is_pci)
|
||||
mem_set_mem_state_cpu_both(base, 0x4000, shflags);
|
||||
else
|
||||
mem_set_mem_state_both(base, 0x4000, shflags);
|
||||
}
|
||||
|
||||
flushmmucache_nopc();
|
||||
@@ -232,6 +242,8 @@ opti895_init(const device_t *info)
|
||||
|
||||
io_sethandler(0x0022, 0x0003, opti895_read, NULL, NULL, opti895_write, NULL, NULL, dev);
|
||||
|
||||
dev->is_pci = info->local;
|
||||
|
||||
dev->scratch[0] = dev->scratch[1] = 0xff;
|
||||
|
||||
dev->regs[0x01] = 0xc0;
|
||||
@@ -276,6 +288,20 @@ const device_t opti802g_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t opti802g_pci_device = {
|
||||
.name = "OPTi 82C802G (PCI)",
|
||||
.internal_name = "opti802g_pci",
|
||||
.flags = 0,
|
||||
.local = 1,
|
||||
.init = opti895_init,
|
||||
.close = opti895_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t opti895_device = {
|
||||
.name = "OPTi 82C895",
|
||||
.internal_name = "opti895",
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the code generator.
|
||||
* Definitions for the code generator.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -92,7 +92,7 @@ typedef struct codeblock_t
|
||||
int pnt;
|
||||
int ins;
|
||||
|
||||
int valid;
|
||||
int valid;
|
||||
|
||||
int was_recompiled;
|
||||
int TOP;
|
||||
@@ -353,7 +353,7 @@ static inline void addbyte(uint8_t val)
|
||||
|
||||
static inline void addword(uint16_t val)
|
||||
{
|
||||
uint16_t *p = (uint16_t *) &codeblock[block_current].data[block_pos];
|
||||
uint16_t *p = (uint16_t *) &codeblock[block_current].data[block_pos];
|
||||
*p = val;
|
||||
block_pos += 2;
|
||||
if (block_pos >= BLOCK_MAX)
|
||||
@@ -364,7 +364,7 @@ static inline void addword(uint16_t val)
|
||||
|
||||
static inline void addlong(uint32_t val)
|
||||
{
|
||||
uint32_t *p = (uint32_t *) &codeblock[block_current].data[block_pos];
|
||||
uint32_t *p = (uint32_t *) &codeblock[block_current].data[block_pos];
|
||||
*p = val;
|
||||
block_pos += 4;
|
||||
if (block_pos >= BLOCK_MAX)
|
||||
@@ -375,7 +375,7 @@ static inline void addlong(uint32_t val)
|
||||
|
||||
static inline void addquad(uint64_t val)
|
||||
{
|
||||
uint64_t *p = (uint64_t *) &codeblock[block_current].data[block_pos];
|
||||
uint64_t *p = (uint64_t *) &codeblock[block_current].data[block_pos];
|
||||
*p = val;
|
||||
block_pos += 8;
|
||||
if (block_pos >= BLOCK_MAX)
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Dynamic Recompiler for Intel 32-bit systems.
|
||||
* Dynamic Recompiler for Intel 32-bit systems.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -1402,7 +1402,7 @@ void codegen_block_init(uint32_t phys_addr)
|
||||
block_num = HASH(phys_addr);
|
||||
codeblock_hash[block_num] = &codeblock[block_current];
|
||||
|
||||
block->valid = 1;
|
||||
block->valid = 1;
|
||||
block->ins = 0;
|
||||
block->pc = cs + cpu_state.pc;
|
||||
block->_cs = cs;
|
||||
@@ -1452,14 +1452,14 @@ void codegen_block_start_recompile(codeblock_t *block)
|
||||
addbyte(0xe8); /*CALL x86gpf*/
|
||||
addlong((uint32_t)x86gpf - (uint32_t)(&codeblock[block_current].data[block_pos + 4]));
|
||||
#else
|
||||
addbyte(0xc6); /* mov byte ptr[&(cpu_state.abrt)],ABRT_GPF */
|
||||
addbyte(0x05);
|
||||
addlong((uint32_t) (uintptr_t) &(cpu_state.abrt));
|
||||
addbyte(ABRT_GPF);
|
||||
addbyte(0x31); /* xor eax,eax */
|
||||
addbyte(0xc0);
|
||||
addbyte(0xa3); /* mov [&(abrt_error)],eax */
|
||||
addlong((uint32_t) (uintptr_t) &(abrt_error));
|
||||
addbyte(0xc6); /* mov byte ptr[&(cpu_state.abrt)],ABRT_GPF */
|
||||
addbyte(0x05);
|
||||
addlong((uint32_t) (uintptr_t) &(cpu_state.abrt));
|
||||
addbyte(ABRT_GPF);
|
||||
addbyte(0x31); /* xor eax,eax */
|
||||
addbyte(0xc0);
|
||||
addbyte(0xa3); /* mov [&(abrt_error)],eax */
|
||||
addlong((uint32_t) (uintptr_t) &(abrt_error));
|
||||
#endif
|
||||
block_pos = BLOCK_EXIT_OFFSET; /*Exit code*/
|
||||
addbyte(0x83); /*ADDL $16,%esp*/
|
||||
@@ -2036,8 +2036,8 @@ generate_call:
|
||||
then reverse it for subsequent instructions if the jump is not taken*/
|
||||
int jump_cycles = 0;
|
||||
|
||||
if (codegen_timing_jump_cycles != NULL)
|
||||
jump_cycles = codegen_timing_jump_cycles();
|
||||
if (codegen_timing_jump_cycles != NULL)
|
||||
jump_cycles = codegen_timing_jump_cycles();
|
||||
|
||||
if (jump_cycles)
|
||||
codegen_accumulate(ACCREG_cycles, -jump_cycles);
|
||||
@@ -2066,13 +2066,13 @@ generate_call:
|
||||
codegen_endpc = (cs + cpu_state.pc) + 8;
|
||||
|
||||
#ifdef CHECK_INT
|
||||
/* Check for interrupts. */
|
||||
addbyte(0xf6); /* test byte ptr[&pic_pending],1 */
|
||||
addbyte(0x05);
|
||||
addlong((uint32_t) (uintptr_t) &pic_pending);
|
||||
addbyte(0x01);
|
||||
addbyte(0x0F); addbyte(0x85); /*JNZ 0*/
|
||||
addlong((uint32_t)&block->data[BLOCK_EXIT_OFFSET] - (uint32_t)(&block->data[block_pos + 4]));
|
||||
/* Check for interrupts. */
|
||||
addbyte(0xf6); /* test byte ptr[&pic_pending],1 */
|
||||
addbyte(0x05);
|
||||
addlong((uint32_t) (uintptr_t) &pic_pending);
|
||||
addbyte(0x01);
|
||||
addbyte(0x0F); addbyte(0x85); /*JNZ 0*/
|
||||
addlong((uint32_t)&block->data[BLOCK_EXIT_OFFSET] - (uint32_t)(&block->data[block_pos + 4]));
|
||||
#endif
|
||||
|
||||
return;
|
||||
@@ -2087,7 +2087,7 @@ generate_call:
|
||||
addbyte(0xC6); /*MOVB [ssegs],op_ssegs*/
|
||||
addbyte(0x45);
|
||||
addbyte((uint8_t)cpu_state_offset(ssegs));
|
||||
addbyte(op_pc + pc_off);
|
||||
addbyte(op_pc + pc_off);
|
||||
}
|
||||
|
||||
if (!test_modrm ||
|
||||
@@ -2130,7 +2130,7 @@ generate_call:
|
||||
addbyte(0xC7); /*MOVL pc,new_pc*/
|
||||
addbyte(0x45);
|
||||
addbyte((uint8_t)cpu_state_offset(pc));
|
||||
addlong(op_pc + pc_off);
|
||||
addlong(op_pc + pc_off);
|
||||
|
||||
addbyte(0xC7); /*MOVL $old_pc,(oldpc)*/
|
||||
addbyte(0x45);
|
||||
@@ -2159,10 +2159,10 @@ generate_call:
|
||||
block->ins++;
|
||||
|
||||
#ifdef CHECK_INT
|
||||
/* Check for interrupts. */
|
||||
addbyte(0x0a); /* or al,byte ptr[&pic_pending] */
|
||||
addbyte(0x05);
|
||||
addlong((uint32_t) (uintptr_t) &pic_pending);
|
||||
/* Check for interrupts. */
|
||||
addbyte(0x0a); /* or al,byte ptr[&pic_pending] */
|
||||
addbyte(0x05);
|
||||
addlong((uint32_t) (uintptr_t) &pic_pending);
|
||||
#endif
|
||||
|
||||
addbyte(0x09); /*OR %eax, %eax*/
|
||||
|
||||
30
src/config.c
30
src/config.c
@@ -115,7 +115,7 @@ load_general(void)
|
||||
vid_api = plat_vidapi(p);
|
||||
ini_section_delete_var(cat, "vid_api");
|
||||
|
||||
video_fullscreen_scale = ini_section_get_int(cat, "video_fullscreen_scale", 0);
|
||||
video_fullscreen_scale = ini_section_get_int(cat, "video_fullscreen_scale", 1);
|
||||
|
||||
video_fullscreen_first = ini_section_get_int(cat, "video_fullscreen_first", 1);
|
||||
|
||||
@@ -196,7 +196,7 @@ load_general(void)
|
||||
|
||||
video_framerate = ini_section_get_int(cat, "video_gl_framerate", -1);
|
||||
video_vsync = ini_section_get_int(cat, "video_gl_vsync", 0);
|
||||
strncpy(video_shader, ini_section_get_string(cat, "video_gl_shader", ""), sizeof(video_shader));
|
||||
strncpy(video_shader, ini_section_get_string(cat, "video_gl_shader", ""), sizeof(video_shader) - 1);
|
||||
|
||||
window_remember = ini_section_get_int(cat, "window_remember", 0);
|
||||
if (window_remember) {
|
||||
@@ -692,7 +692,7 @@ load_sound(void)
|
||||
if (strlen(p) > 511)
|
||||
fatal("load_sound(): strlen(p) > 511\n");
|
||||
else
|
||||
strncpy(temp, p, strlen(p) + 1);
|
||||
strncpy(temp, p, 511);
|
||||
if (!strcmp(temp, "float") || !strcmp(temp, "1"))
|
||||
sound_is_float = 1;
|
||||
else
|
||||
@@ -913,12 +913,12 @@ load_storage_controllers(void)
|
||||
if (strlen(p) > 511)
|
||||
fatal("load_storage_controllers(): strlen(p) > 511\n");
|
||||
else
|
||||
strncpy(cassette_fname, p, MIN(512, strlen(p) + 1));
|
||||
strncpy(cassette_fname, p, 511);
|
||||
p = ini_section_get_string(cat, "cassette_mode", "");
|
||||
if (strlen(p) > 511)
|
||||
fatal("load_storage_controllers(): strlen(p) > 511\n");
|
||||
else
|
||||
strncpy(cassette_mode, p, MIN(512, strlen(p) + 1));
|
||||
strncpy(cassette_mode, p, 511);
|
||||
cassette_pos = ini_section_get_int(cat, "cassette_position", 0);
|
||||
cassette_srate = ini_section_get_int(cat, "cassette_srate", 44100);
|
||||
cassette_append = !!ini_section_get_int(cat, "cassette_append", 0);
|
||||
@@ -949,7 +949,7 @@ load_storage_controllers(void)
|
||||
if (strlen(p) > 511)
|
||||
fatal("load_storage_controllers(): strlen(p) > 511\n");
|
||||
else
|
||||
strncpy(cart_fns[c], p, strlen(p) + 1);
|
||||
strncpy(cart_fns[c], p, 511);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1197,7 +1197,7 @@ load_floppy_drives(void)
|
||||
if (strlen(p) > 511)
|
||||
fatal("load_floppy_drives(): strlen(p) > 511\n");
|
||||
else
|
||||
strncpy(floppyfns[c], p, strlen(p) + 1);
|
||||
strncpy(floppyfns[c], p, 511);
|
||||
|
||||
/* if (*wp != L'\0')
|
||||
config_log("Floppy%d: %ls\n", c, floppyfns[c]); */
|
||||
@@ -1259,7 +1259,7 @@ load_floppy_and_cdrom_drives(void)
|
||||
if (strlen(p) > 511)
|
||||
fatal("load_floppy_and_cdrom_drives(): strlen(p) > 511\n");
|
||||
else
|
||||
strncpy(floppyfns[c], p, strlen(p) + 1);
|
||||
strncpy(floppyfns[c], p, 511);
|
||||
|
||||
/* if (*wp != L'\0')
|
||||
config_log("Floppy%d: %ls\n", c, floppyfns[c]); */
|
||||
@@ -1321,6 +1321,8 @@ load_floppy_and_cdrom_drives(void)
|
||||
|
||||
sprintf(temp, "cdrom_%02i_speed", c + 1);
|
||||
cdrom[c].speed = ini_section_get_int(cat, temp, 8);
|
||||
sprintf(temp, "cdrom_%02i_early", c + 1);
|
||||
cdrom[c].early = ini_section_get_int(cat, temp, 0);
|
||||
|
||||
/* Default values, needed for proper operation of the Settings dialog. */
|
||||
cdrom[c].ide_channel = cdrom[c].scsi_device_id = c + 2;
|
||||
@@ -1815,6 +1817,7 @@ config_load(void)
|
||||
vid_api = plat_vidapi("default");
|
||||
vid_resize = 0;
|
||||
video_fullscreen_first = 1;
|
||||
video_fullscreen_scale = 1;
|
||||
time_sync = TIME_SYNC_ENABLED;
|
||||
hdc_current = hdc_get_from_internal_name("none");
|
||||
|
||||
@@ -1902,7 +1905,7 @@ save_general(void)
|
||||
else
|
||||
ini_section_set_string(cat, "vid_renderer", va_name);
|
||||
|
||||
if (video_fullscreen_scale == 0)
|
||||
if (video_fullscreen_scale == 1)
|
||||
ini_section_delete_var(cat, "video_fullscreen_scale");
|
||||
else
|
||||
ini_section_set_int(cat, "video_fullscreen_scale", video_fullscreen_scale);
|
||||
@@ -2637,7 +2640,7 @@ save_hard_disks(void)
|
||||
if (!hdd_is_valid(c) || (hdd[c].bus != HDD_BUS_IDE && hdd[c].bus != HDD_BUS_ESDI))
|
||||
ini_section_delete_var(cat, temp);
|
||||
else
|
||||
ini_section_set_string(cat, temp, hdd_preset_get_internal_name(hdd[c].speed_preset));
|
||||
ini_section_set_string(cat, temp, (char *) hdd_preset_get_internal_name(hdd[c].speed_preset));
|
||||
}
|
||||
|
||||
ini_delete_section_if_empty(config, cat);
|
||||
@@ -2714,6 +2717,13 @@ save_floppy_and_cdrom_drives(void)
|
||||
ini_section_set_int(cat, temp, cdrom[c].speed);
|
||||
}
|
||||
|
||||
sprintf(temp, "cdrom_%02i_early", c + 1);
|
||||
if ((cdrom[c].bus_type == 0) || (cdrom[c].early == 0)) {
|
||||
ini_section_delete_var(cat, temp);
|
||||
} else {
|
||||
ini_section_set_int(cat, temp, cdrom[c].early);
|
||||
}
|
||||
|
||||
sprintf(temp, "cdrom_%02i_parameters", c + 1);
|
||||
if (cdrom[c].bus_type == 0) {
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the code generator.
|
||||
* Definitions for the code generator.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2020 Miran Grca.
|
||||
* Copyright 2020 Miran Grca.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -50,15 +50,15 @@
|
||||
#endif
|
||||
|
||||
|
||||
extern void codegen_init();
|
||||
extern void codegen_init();
|
||||
#ifdef USE_NEW_DYNAREC
|
||||
extern void codegen_close();
|
||||
extern void codegen_close();
|
||||
#endif
|
||||
extern void codegen_flush();
|
||||
extern void codegen_flush();
|
||||
|
||||
|
||||
/*Current physical page of block being recompiled. -1 if no recompilation taking place */
|
||||
extern uint32_t recomp_page;
|
||||
extern uint32_t recomp_page;
|
||||
extern int codegen_in_recompile;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Miscellaneous x86 CPU Instructions.
|
||||
* Miscellaneous x86 CPU Instructions.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -40,15 +40,15 @@
|
||||
#define _X86_OPS_H
|
||||
|
||||
|
||||
#define UN_USED(x) (void)(x)
|
||||
#define UN_USED(x) (void)(x)
|
||||
|
||||
|
||||
typedef int (*OpFn)(uint32_t fetchdat);
|
||||
|
||||
#ifdef USE_DYNAREC
|
||||
void x86_setopcodes(const OpFn *opcodes, const OpFn *opcodes_0f,
|
||||
const OpFn *dynarec_opcodes,
|
||||
const OpFn *dynarec_opcodes_0f);
|
||||
const OpFn *dynarec_opcodes,
|
||||
const OpFn *dynarec_opcodes_0f);
|
||||
|
||||
extern const OpFn *x86_dynarec_opcodes;
|
||||
extern const OpFn *x86_dynarec_opcodes_0f;
|
||||
|
||||
@@ -293,11 +293,11 @@ static int opPOPFD(uint32_t fetchdat)
|
||||
else if (IOPLp) cpu_state.flags = (cpu_state.flags & 0x3000) | (templ & 0x4fd5) | 2;
|
||||
else cpu_state.flags = (cpu_state.flags & 0x3200) | (templ & 0x4dd5) | 2;
|
||||
|
||||
templ &= (is486) ? 0x3c0000 : 0;
|
||||
templ &= (is486 || isibm486) ? 0x3c0000 : 0;
|
||||
templ |= ((cpu_state.eflags&3) << 16);
|
||||
if (cpu_CR4_mask & CR4_VME) cpu_state.eflags = (templ >> 16) & 0x3f;
|
||||
else if (CPUID) cpu_state.eflags = (templ >> 16) & 0x27;
|
||||
else if (is486) cpu_state.eflags = (templ >> 16) & 7;
|
||||
else if (is486 || isibm486) cpu_state.eflags = (templ >> 16) & 7;
|
||||
else cpu_state.eflags = (templ >> 16) & 3;
|
||||
|
||||
flags_extract();
|
||||
|
||||
26
src/device.c
26
src/device.c
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of the generic device interface to handle
|
||||
* all devices attached to the emulator.
|
||||
* Implementation of the generic device interface to handle
|
||||
* all devices attached to the emulator.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,60 +1,58 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* Implementation of a memory expansion board for the ISA Bus.
|
||||
*
|
||||
* Implementation of a memory expansion board for the ISA Bus.
|
||||
* Although modern systems use direct-connect local buses to
|
||||
* connect the CPU with its memory, originally the main system
|
||||
* bus(es) were used for that. Memory expension cards could add
|
||||
* memory to the system through the ISA bus, using a variety of
|
||||
* techniques.
|
||||
*
|
||||
* Although modern systems use direct-connect local buses to
|
||||
* connect the CPU with its memory, originally the main system
|
||||
* bus(es) were used for that. Memory expension cards could add
|
||||
* memory to the system through the ISA bus, using a variety of
|
||||
* techniques.
|
||||
* The majority of these boards could provide some (additional)
|
||||
* conventional (low) memory, extended (high) memory on 80286
|
||||
* and higher systems, as well as EMS bank-switched memory.
|
||||
*
|
||||
* The majority of these boards could provide some (additional)
|
||||
* conventional (low) memory, extended (high) memory on 80286
|
||||
* and higher systems, as well as EMS bank-switched memory.
|
||||
* This implementation uses the LIM 3.2 specifications for EMS.
|
||||
*
|
||||
* This implementation uses the LIM 3.2 specifications for EMS.
|
||||
* With the EMS method, the system's standard memory is expanded
|
||||
* by means of bank-switching. One or more 'frames' in the upper
|
||||
* memory area (640K-1024K) are used as viewports into an array
|
||||
* of RAM pages numbered 0 to N. Each page is defined to be 16KB
|
||||
* in size, so, for a 1024KB board, 64 such pages are available.
|
||||
* I/O control registers are used to set up the mappings. More
|
||||
* modern boards even have multiple 'copies' of those registers,
|
||||
* which can be switched very fast, to allow for multitasking.
|
||||
*
|
||||
* With the EMS method, the system's standard memory is expanded
|
||||
* by means of bank-switching. One or more 'frames' in the upper
|
||||
* memory area (640K-1024K) are used as viewports into an array
|
||||
* of RAM pages numbered 0 to N. Each page is defined to be 16KB
|
||||
* in size, so, for a 1024KB board, 64 such pages are available.
|
||||
* I/O control registers are used to set up the mappings. More
|
||||
* modern boards even have multiple 'copies' of those registers,
|
||||
* which can be switched very fast, to allow for multitasking.
|
||||
*
|
||||
* TODO: The EV159 is supposed to support 16b EMS transfers, but the
|
||||
* EMM.sys driver for it doesn't seem to want to do that..
|
||||
* TODO: The EV159 is supposed to support 16b EMS transfers, but the
|
||||
* EMM.sys driver for it doesn't seem to want to do that..
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
@@ -1,56 +1,54 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* Implementation of a Clock/RTC Card for the ISA PC/XT.
|
||||
*
|
||||
* Implementation of a Clock/RTC Card for the ISA PC/XT.
|
||||
* Systems starting with the PC/XT had, by default, a realtime
|
||||
* clock and NVR chip on the mainboard. The BIOS stored config
|
||||
* data in the NVR, and the system could maintain time and date
|
||||
* using the RTC.
|
||||
*
|
||||
* Systems starting with the PC/XT had, by default, a realtime
|
||||
* clock and NVR chip on the mainboard. The BIOS stored config
|
||||
* data in the NVR, and the system could maintain time and date
|
||||
* using the RTC.
|
||||
* Originally, PC systems did not have this, and they first did
|
||||
* show up in non-IBM clone systems. Shortly after, expansion
|
||||
* cards with this function became available for the PC's (ISA)
|
||||
* bus, and they came in many forms and designs.
|
||||
*
|
||||
* Originally, PC systems did not have this, and they first did
|
||||
* show up in non-IBM clone systems. Shortly after, expansion
|
||||
* cards with this function became available for the PC's (ISA)
|
||||
* bus, and they came in many forms and designs.
|
||||
* This implementation offers some of those boards:
|
||||
*
|
||||
* This implementation offers some of those boards:
|
||||
* Everex EV-170 (using NatSemi MM58167 chip)
|
||||
* DTK PII-147 Hexa I/O Plus (using UMC 82C8167 chip)
|
||||
*
|
||||
* Everex EV-170 (using NatSemi MM58167 chip)
|
||||
* DTK PII-147 Hexa I/O Plus (using UMC 82C8167 chip)
|
||||
* and more will follow as time permits.
|
||||
*
|
||||
* and more will follow as time permits.
|
||||
*
|
||||
* NOTE: The IRQ functionalities have been implemented, but not yet
|
||||
* tested, as I need to write test software for them first :)
|
||||
* NOTE: The IRQ functionalities have been implemented, but not yet
|
||||
* tested, as I need to write test software for them first :)
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
@@ -113,9 +111,9 @@ typedef struct {
|
||||
} rtcdev_t;
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Driver for the NatSemi MM58167 chip. *
|
||||
* *
|
||||
* *
|
||||
* Driver for the NatSemi MM58167 chip. *
|
||||
* *
|
||||
************************************************************************/
|
||||
#define MM67_REGS 32
|
||||
|
||||
@@ -482,9 +480,9 @@ mm67_write(uint16_t port, uint8_t val, void *priv)
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Generic code for all supported chips. *
|
||||
* *
|
||||
* *
|
||||
* Generic code for all supported chips. *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/* Initialize the device for use. */
|
||||
|
||||
@@ -140,10 +140,10 @@ keyboard_input(int down, uint16_t scan)
|
||||
if (recv_key[scan & 0x1ff] ^ down) {
|
||||
if (down) {
|
||||
switch (scan & 0x1ff) {
|
||||
case 0x01c: /* Left Ctrl */
|
||||
case 0x01d: /* Left Ctrl */
|
||||
shift |= 0x01;
|
||||
break;
|
||||
case 0x11c: /* Right Ctrl */
|
||||
case 0x11d: /* Right Ctrl */
|
||||
shift |= 0x10;
|
||||
break;
|
||||
case 0x02a: /* Left Shift */
|
||||
@@ -161,10 +161,10 @@ keyboard_input(int down, uint16_t scan)
|
||||
}
|
||||
} else {
|
||||
switch (scan & 0x1ff) {
|
||||
case 0x01c: /* Left Ctrl */
|
||||
case 0x01d: /* Left Ctrl */
|
||||
shift &= ~0x01;
|
||||
break;
|
||||
case 0x11c: /* Right Ctrl */
|
||||
case 0x11d: /* Right Ctrl */
|
||||
shift &= ~0x10;
|
||||
break;
|
||||
case 0x02a: /* Left Shift */
|
||||
|
||||
@@ -866,7 +866,7 @@ add_data_kbd(uint16_t val)
|
||||
}
|
||||
|
||||
/* Test for T3100E 'Fn' key (Right Alt / Right Ctrl) */
|
||||
if ((dev != NULL) && (kbc_ven == KBC_VEN_TOSHIBA) && (keyboard_recv(0xb8) || keyboard_recv(0x9d)))
|
||||
if ((dev != NULL) && (kbc_ven == KBC_VEN_TOSHIBA) && (keyboard_recv(0x138) || keyboard_recv(0x11d)))
|
||||
switch (val) {
|
||||
case 0x4f:
|
||||
t3100e_notify_set(0x01);
|
||||
|
||||
@@ -429,7 +429,7 @@ kbd_adddata(uint16_t val)
|
||||
{
|
||||
/* Test for T1000 'Fn' key (Right Alt / Right Ctrl) */
|
||||
if (is_t1x00) {
|
||||
if (keyboard_recv(0xb8) || keyboard_recv(0x9d)) { /* 'Fn' pressed */
|
||||
if (keyboard_recv(0x138) || keyboard_recv(0x11d)) { /* 'Fn' pressed */
|
||||
t1000_syskey(0x00, 0x04, 0x00); /* Set 'Fn' indicator */
|
||||
switch (val) {
|
||||
case 0x45: /* Num Lock => toggle numpad */
|
||||
|
||||
@@ -81,6 +81,57 @@ mouse_clear_data(void *priv)
|
||||
dev->flags &= ~FLAG_CTRLDAT;
|
||||
}
|
||||
|
||||
static void
|
||||
ps2_report_coordinates(mouse_t *dev)
|
||||
{
|
||||
uint8_t buff[3] = {0x08, 0x00, 0x00};
|
||||
|
||||
if (dev->x > 255)
|
||||
dev->x = 255;
|
||||
if (dev->x < -256)
|
||||
dev->x = -256;
|
||||
if (dev->y > 255)
|
||||
dev->y = 255;
|
||||
if (dev->y < -256)
|
||||
dev->y = -256;
|
||||
if (dev->z < -8)
|
||||
dev->z = -8;
|
||||
if (dev->z > 7)
|
||||
dev->z = 7;
|
||||
|
||||
if (dev->x < 0)
|
||||
buff[0] |= 0x10;
|
||||
if (dev->y < 0)
|
||||
buff[0] |= 0x20;
|
||||
if (mouse_buttons & 0x01)
|
||||
buff[0] |= 0x01;
|
||||
if (mouse_buttons & 0x02)
|
||||
buff[0] |= 0x02;
|
||||
if (dev->flags & FLAG_INTELLI) {
|
||||
if (mouse_buttons & 0x04)
|
||||
buff[0] |= 0x04;
|
||||
}
|
||||
buff[1] = (dev->x & 0xff);
|
||||
buff[2] = (dev->y & 0xff);
|
||||
|
||||
keyboard_at_adddata_mouse(buff[0]);
|
||||
keyboard_at_adddata_mouse(buff[1]);
|
||||
keyboard_at_adddata_mouse(buff[2]);
|
||||
if (dev->flags & FLAG_INTMODE) {
|
||||
int temp_z = dev->z;
|
||||
if ((dev->flags & FLAG_5BTN)) {
|
||||
temp_z &= 0xF;
|
||||
if (mouse_buttons & 8)
|
||||
temp_z |= 0x10;
|
||||
if (mouse_buttons & 16)
|
||||
temp_z |= 0x20;
|
||||
}
|
||||
keyboard_at_adddata_mouse(temp_z);
|
||||
}
|
||||
|
||||
dev->x = dev->y = dev->z = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
ps2_write(uint8_t val, void *priv)
|
||||
{
|
||||
@@ -143,32 +194,7 @@ ps2_write(uint8_t val, void *priv)
|
||||
case 0xeb: /* Get mouse data */
|
||||
keyboard_at_adddata_mouse(0xfa);
|
||||
|
||||
temp = 0;
|
||||
if (dev->x < 0)
|
||||
temp |= 0x10;
|
||||
if (dev->y < 0)
|
||||
temp |= 0x20;
|
||||
if (mouse_buttons & 1)
|
||||
temp |= 1;
|
||||
if (mouse_buttons & 2)
|
||||
temp |= 2;
|
||||
if ((mouse_buttons & 4) && (dev->flags & FLAG_INTELLI))
|
||||
temp |= 4;
|
||||
keyboard_at_adddata_mouse(temp);
|
||||
keyboard_at_adddata_mouse(dev->x & 0xff);
|
||||
keyboard_at_adddata_mouse(dev->y & 0xff);
|
||||
|
||||
if (dev->flags & FLAG_INTMODE) {
|
||||
int temp_z = dev->z;
|
||||
if ((dev->flags & FLAG_5BTN)) {
|
||||
temp_z &= 0xF;
|
||||
if (mouse_buttons & 8)
|
||||
temp_z |= 0x10;
|
||||
if (mouse_buttons & 16)
|
||||
temp_z |= 0x20;
|
||||
}
|
||||
keyboard_at_adddata_mouse(temp_z);
|
||||
}
|
||||
ps2_report_coordinates(dev);
|
||||
break;
|
||||
|
||||
case 0xf2: /* read ID */
|
||||
@@ -239,7 +265,6 @@ static int
|
||||
ps2_poll(int x, int y, int z, int b, void *priv)
|
||||
{
|
||||
mouse_t *dev = (mouse_t *) priv;
|
||||
uint8_t buff[3] = { 0x08, 0x00, 0x00 };
|
||||
|
||||
if (!x && !y && !z && (b == dev->b))
|
||||
return (0xff);
|
||||
@@ -258,50 +283,7 @@ ps2_poll(int x, int y, int z, int b, void *priv)
|
||||
if ((dev->mode == MODE_STREAM) && (dev->flags & FLAG_ENABLED) && (keyboard_at_mouse_pos() < 13)) {
|
||||
dev->b = b;
|
||||
|
||||
if (dev->x > 255)
|
||||
dev->x = 255;
|
||||
if (dev->x < -256)
|
||||
dev->x = -256;
|
||||
if (dev->y > 255)
|
||||
dev->y = 255;
|
||||
if (dev->y < -256)
|
||||
dev->y = -256;
|
||||
if (dev->z < -8)
|
||||
dev->z = -8;
|
||||
if (dev->z > 7)
|
||||
dev->z = 7;
|
||||
|
||||
if (dev->x < 0)
|
||||
buff[0] |= 0x10;
|
||||
if (dev->y < 0)
|
||||
buff[0] |= 0x20;
|
||||
if (mouse_buttons & 0x01)
|
||||
buff[0] |= 0x01;
|
||||
if (mouse_buttons & 0x02)
|
||||
buff[0] |= 0x02;
|
||||
if (dev->flags & FLAG_INTELLI) {
|
||||
if (mouse_buttons & 0x04)
|
||||
buff[0] |= 0x04;
|
||||
}
|
||||
buff[1] = (dev->x & 0xff);
|
||||
buff[2] = (dev->y & 0xff);
|
||||
|
||||
keyboard_at_adddata_mouse(buff[0]);
|
||||
keyboard_at_adddata_mouse(buff[1]);
|
||||
keyboard_at_adddata_mouse(buff[2]);
|
||||
if (dev->flags & FLAG_INTMODE) {
|
||||
int temp_z = dev->z;
|
||||
if ((dev->flags & FLAG_5BTN)) {
|
||||
temp_z &= 0xF;
|
||||
if (mouse_buttons & 8)
|
||||
temp_z |= 0x10;
|
||||
if (mouse_buttons & 16)
|
||||
temp_z |= 0x20;
|
||||
}
|
||||
keyboard_at_adddata_mouse(temp_z);
|
||||
}
|
||||
|
||||
dev->x = dev->y = dev->z = 0;
|
||||
ps2_report_coordinates(dev);
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
||||
@@ -425,7 +425,7 @@ static int
|
||||
ide_get_max(ide_t *ide, int type)
|
||||
{
|
||||
if (ide->type == IDE_ATAPI)
|
||||
return ide->get_max(!ide_boards[ide->board]->force_ata3 && (ide_bm[ide->board] != NULL), type);
|
||||
return ide->get_max(!ide->sc->pad0 && !ide_boards[ide->board]->force_ata3 && (ide_bm[ide->board] != NULL), type);
|
||||
|
||||
switch (type) {
|
||||
case TYPE_PIO: /* PIO */
|
||||
@@ -458,7 +458,7 @@ static int
|
||||
ide_get_timings(ide_t *ide, int type)
|
||||
{
|
||||
if (ide->type == IDE_ATAPI)
|
||||
return ide->get_timings(!ide_boards[ide->board]->force_ata3 && (ide_bm[ide->board] != NULL), type);
|
||||
return ide->get_timings(!ide->sc->pad0 && !ide_boards[ide->board]->force_ata3 && (ide_bm[ide->board] != NULL), type);
|
||||
|
||||
switch (type) {
|
||||
case TIMINGS_DMA:
|
||||
@@ -584,7 +584,7 @@ ide_identify(ide_t *ide)
|
||||
memset(ide->buffer, 0, 512);
|
||||
|
||||
if (ide->type == IDE_ATAPI)
|
||||
ide->identify(ide, !ide_boards[ide->board]->force_ata3 && (ide_bm[ide->board] != NULL));
|
||||
ide->identify(ide, !ide->sc->pad0 && !ide_boards[ide->board]->force_ata3 && (ide_bm[ide->board] != NULL));
|
||||
else if (ide->type != IDE_NONE)
|
||||
ide_hd_identify(ide);
|
||||
else {
|
||||
@@ -884,7 +884,7 @@ ide_atapi_attach(ide_t *ide)
|
||||
ide->type = IDE_ATAPI;
|
||||
ide_allocate_buffer(ide);
|
||||
ide_set_signature(ide);
|
||||
ide->mdma_mode = (1 << ide->get_max(ide_boards[ide->board]->force_ata3 || !ide_bm[ide->board], TYPE_PIO));
|
||||
ide->mdma_mode = (1 << ide->get_max(!ide->sc->pad0 && !ide_boards[ide->board]->force_ata3 && (ide_bm[ide->board] != NULL), TYPE_PIO));
|
||||
ide->error = 1;
|
||||
ide->cfg_spt = ide->cfg_hpc = 0;
|
||||
#ifndef EARLY_ATAPI
|
||||
@@ -987,7 +987,7 @@ ide_atapi_callback(ide_t *ide)
|
||||
#endif
|
||||
out = (ide->sc->packet_status & 0x01);
|
||||
|
||||
if (!ide_boards[ide->board]->force_ata3 && ide_bm[ide->board] && ide_bm[ide->board]->dma) {
|
||||
if (!ide->sc->pad0 && !ide_boards[ide->board]->force_ata3 && ide_bm[ide->board] && ide_bm[ide->board]->dma) {
|
||||
ret = ide_bm[ide->board]->dma(ide->board,
|
||||
ide->sc->temp_buffer, ide->sc->packet_len,
|
||||
out, ide_bm[ide->board]->priv);
|
||||
@@ -2157,17 +2157,16 @@ ide_callback(void *priv)
|
||||
ide_set_signature(ide);
|
||||
|
||||
if (ide->type == IDE_ATAPI) {
|
||||
#ifdef EARLY_ATAPI
|
||||
ide->sc->status = DRDY_STAT | DSC_STAT;
|
||||
#else
|
||||
ide->sc->status = 0;
|
||||
#endif
|
||||
ide->sc->error = 1;
|
||||
if (ide->device_reset)
|
||||
ide->device_reset(ide->sc);
|
||||
if (ide->sc->pad0) /* pad0 = early */
|
||||
ide->sc->status = DRDY_STAT | DSC_STAT;
|
||||
else
|
||||
ide->sc->status = 0;
|
||||
}
|
||||
ide_irq_raise(ide);
|
||||
if (ide->type == IDE_ATAPI)
|
||||
if ((ide->type == IDE_ATAPI) && !ide->sc->pad0)
|
||||
ide->service = 0;
|
||||
return;
|
||||
|
||||
|
||||
@@ -1,76 +1,74 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* Implementation of a generic IDE-XTA disk controller.
|
||||
*
|
||||
* Implementation of a generic IDE-XTA disk controller.
|
||||
* XTA is the acronym for 'XT-Attached', which was basically
|
||||
* the XT-counterpart to what we know now as IDE (which is
|
||||
* also named ATA - AT Attachment.) The basic ideas was to
|
||||
* put the actual drive controller electronics onto the drive
|
||||
* itself, and have the host machine just talk to that using
|
||||
* a simpe, standardized I/O path- hence the name IDE, for
|
||||
* Integrated Drive Electronics.
|
||||
*
|
||||
* XTA is the acronym for 'XT-Attached', which was basically
|
||||
* the XT-counterpart to what we know now as IDE (which is
|
||||
* also named ATA - AT Attachment.) The basic ideas was to
|
||||
* put the actual drive controller electronics onto the drive
|
||||
* itself, and have the host machine just talk to that using
|
||||
* a simpe, standardized I/O path- hence the name IDE, for
|
||||
* Integrated Drive Electronics.
|
||||
* In the ATA version of IDE, the programming interface of
|
||||
* the IBM PC/AT (which used the Western Digitial 1002/1003
|
||||
* controllers) was kept, and, so, ATA-IDE assumes a 16bit
|
||||
* data path: it reads and writes 16bit words of data. The
|
||||
* disk drives for this bus commonly have an 'A' suffix to
|
||||
* identify them as 'ATBUS'.
|
||||
*
|
||||
* In the ATA version of IDE, the programming interface of
|
||||
* the IBM PC/AT (which used the Western Digitial 1002/1003
|
||||
* controllers) was kept, and, so, ATA-IDE assumes a 16bit
|
||||
* data path: it reads and writes 16bit words of data. The
|
||||
* disk drives for this bus commonly have an 'A' suffix to
|
||||
* identify them as 'ATBUS'.
|
||||
* In XTA-IDE, which is slightly older, the programming
|
||||
* interface of the IBM PC/XT (which used the MFM controller
|
||||
* from Xebec) was kept, and, so, it uses an 8bit data path.
|
||||
* Disk drives for this bus commonly have the 'X' suffix to
|
||||
* mark them as being for this XTBUS variant.
|
||||
*
|
||||
* In XTA-IDE, which is slightly older, the programming
|
||||
* interface of the IBM PC/XT (which used the MFM controller
|
||||
* from Xebec) was kept, and, so, it uses an 8bit data path.
|
||||
* Disk drives for this bus commonly have the 'X' suffix to
|
||||
* mark them as being for this XTBUS variant.
|
||||
* So, XTA and ATA try to do the same thing, but they use
|
||||
* different ways to achive their goal.
|
||||
*
|
||||
* So, XTA and ATA try to do the same thing, but they use
|
||||
* different ways to achive their goal.
|
||||
* Also, XTA is **not** the same as XTIDE. XTIDE is a modern
|
||||
* variant of ATA-IDE, but retro-fitted for use on 8bit XT
|
||||
* systems: an extra register is used to deal with the extra
|
||||
* data byte per transfer. XTIDE uses regular IDE drives,
|
||||
* and uses the regular ATA/IDE programming interface, just
|
||||
* with the extra register.
|
||||
*
|
||||
* Also, XTA is **not** the same as XTIDE. XTIDE is a modern
|
||||
* variant of ATA-IDE, but retro-fitted for use on 8bit XT
|
||||
* systems: an extra register is used to deal with the extra
|
||||
* data byte per transfer. XTIDE uses regular IDE drives,
|
||||
* and uses the regular ATA/IDE programming interface, just
|
||||
* with the extra register.
|
||||
* NOTE: This driver implements both the 'standard' XTA interface,
|
||||
* sold by Western Digital as the WDXT-140 (no BIOS) and the
|
||||
* WDXT-150 (with BIOS), as well as some variants customized
|
||||
* for specific machines.
|
||||
*
|
||||
* NOTE: This driver implements both the 'standard' XTA interface,
|
||||
* sold by Western Digital as the WDXT-140 (no BIOS) and the
|
||||
* WDXT-150 (with BIOS), as well as some variants customized
|
||||
* for specific machines.
|
||||
*
|
||||
* NOTE: The XTA interface is 0-based for sector numbers !!
|
||||
* NOTE: The XTA interface is 0-based for sector numbers !!
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Based on my earlier HD20 driver for the EuroPC.
|
||||
* Based on my earlier HD20 driver for the EuroPC.
|
||||
*
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
@@ -122,14 +120,14 @@ enum {
|
||||
/* Command values. */
|
||||
#define CMD_TEST_READY 0x00
|
||||
#define CMD_RECALIBRATE 0x01
|
||||
/* unused 0x02 */
|
||||
/* unused 0x02 */
|
||||
#define CMD_READ_SENSE 0x03
|
||||
#define CMD_FORMAT_DRIVE 0x04
|
||||
#define CMD_READ_VERIFY 0x05
|
||||
#define CMD_FORMAT_TRACK 0x06
|
||||
#define CMD_FORMAT_BAD_TRACK 0x07
|
||||
#define CMD_READ_SECTORS 0x08
|
||||
/* unused 0x09 */
|
||||
/* unused 0x09 */
|
||||
#define CMD_WRITE_SECTORS 0x0a
|
||||
#define CMD_SEEK 0x0b
|
||||
#define CMD_SET_DRIVE_PARAMS 0x0c
|
||||
@@ -137,8 +135,8 @@ enum {
|
||||
#define CMD_READ_SECTOR_BUFFER 0x0e
|
||||
#define CMD_WRITE_SECTOR_BUFFER 0x0f
|
||||
#define CMD_RAM_DIAGS 0xe0
|
||||
/* unused 0xe1 */
|
||||
/* unused 0xe2 */
|
||||
/* unused 0xe1 */
|
||||
/* unused 0xe2 */
|
||||
#define CMD_DRIVE_DIAGS 0xe3
|
||||
#define CMD_CTRL_DIAGS 0xe4
|
||||
#define CMD_READ_LONG 0xe5
|
||||
@@ -184,20 +182,20 @@ enum {
|
||||
/* The device control block (6 bytes) */
|
||||
#pragma pack(push, 1)
|
||||
typedef struct {
|
||||
uint8_t cmd; /* [7:5] class, [4:0] opcode */
|
||||
uint8_t cmd; /* [7:5] class, [4:0] opcode */
|
||||
|
||||
uint8_t head : 5, /* [4:0] head number */
|
||||
drvsel : 1, /* [5] drive select */
|
||||
mbz : 2; /* [7:6] 00 */
|
||||
uint8_t head : 5, /* [4:0] head number */
|
||||
drvsel : 1, /* [5] drive select */
|
||||
mbz : 2; /* [7:6] 00 */
|
||||
|
||||
uint8_t sector : 6, /* [5:0] sector number 0-63 */
|
||||
cyl_high : 2; /* [7:6] cylinder [9:8] bits */
|
||||
uint8_t sector : 6, /* [5:0] sector number 0-63 */
|
||||
cyl_high : 2; /* [7:6] cylinder [9:8] bits */
|
||||
|
||||
uint8_t cyl_low; /* [7:0] cylinder [7:0] bits */
|
||||
uint8_t cyl_low; /* [7:0] cylinder [7:0] bits */
|
||||
|
||||
uint8_t count; /* [7:0] blk count / interleave */
|
||||
uint8_t count; /* [7:0] blk count / interleave */
|
||||
|
||||
uint8_t ctrl; /* [7:0] control field */
|
||||
uint8_t ctrl; /* [7:0] control field */
|
||||
} dcb_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
@@ -246,8 +244,8 @@ typedef struct {
|
||||
|
||||
/* Controller state. */
|
||||
int8_t state; /* controller state */
|
||||
uint8_t sense; /* current SENSE ERROR value */
|
||||
uint8_t status; /* current operational status */
|
||||
uint8_t sense; /* current SENSE ERROR value */
|
||||
uint8_t status; /* current operational status */
|
||||
uint8_t intr;
|
||||
uint64_t callback;
|
||||
pc_timer_t timer;
|
||||
|
||||
@@ -1,48 +1,46 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* Implementation of the DTK MiniMicro series of Floppy Disk Controllers.
|
||||
* Original code from VARCem. Fully rewritten, fixed and improved for 86Box.
|
||||
*
|
||||
* Implementation of the DTK MiniMicro series of Floppy Disk Controllers.
|
||||
* Original code from VARCem. Fully rewritten, fixed and improved for 86Box.
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>,
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>,
|
||||
* Tiseno100
|
||||
*
|
||||
* Copyright 2019 Fred N. van Kempen.
|
||||
* Copyright 2021 Tiseno100
|
||||
* Copyright 2019 Fred N. van Kempen.
|
||||
* Copyright 2021 Tiseno100
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,36 +1,34 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
*
|
||||
* Implementation of the PCjs JSON floppy image format.
|
||||
* Implementation of the PCjs JSON floppy image format.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
@@ -88,7 +86,7 @@ typedef struct {
|
||||
uint8_t dmf; /* disk is DMF format */
|
||||
uint8_t interleave;
|
||||
#if 0
|
||||
uint8_t skew;
|
||||
uint8_t skew;
|
||||
#endif
|
||||
uint8_t gap2_len;
|
||||
uint8_t gap3_len;
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of the Flight Stick Pro.
|
||||
* Implementation of the Flight Stick Pro.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of a standard joystick.
|
||||
* Implementation of a standard joystick.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of a Side Winder GamePad.
|
||||
* Implementation of a Side Winder GamePad.
|
||||
*
|
||||
* Notes: - Write to 0x201 starts packet transfer (5*N or 15*N bits)
|
||||
* - Currently alternates between Mode A and Mode B (is there
|
||||
* any way of actually controlling which is used?)
|
||||
* - Windows 9x drivers require Mode B when more than 1 pad
|
||||
* connected
|
||||
* - Packet preceeded by high data (currently 50us), and
|
||||
* followed by low data (currently 160us) - timings are
|
||||
* probably wrong, but good enough for everything I've tried
|
||||
* - Analog inputs are only used to time ID packet request.
|
||||
* If A0 timing out is followed after ~64us by another 0x201
|
||||
* write then an ID packet is triggered
|
||||
* - Sidewinder game pad ID is 'H0003'
|
||||
* - ID is sent in Mode A (1 bit per clock), but data bit 2
|
||||
* must change during ID packet transfer, or Windows 9x
|
||||
* drivers won't use Mode B. I don't know if it oscillates,
|
||||
* mirrors the data transfer, or something else - the drivers
|
||||
* only check that it changes at least 10 times during the
|
||||
* transfer
|
||||
* - Some DOS stuff will write to 0x201 while a packet is
|
||||
* being transferred. This seems to be ignored.
|
||||
* Notes: - Write to 0x201 starts packet transfer (5*N or 15*N bits)
|
||||
* - Currently alternates between Mode A and Mode B (is there
|
||||
* any way of actually controlling which is used?)
|
||||
* - Windows 9x drivers require Mode B when more than 1 pad
|
||||
* connected
|
||||
* - Packet preceeded by high data (currently 50us), and
|
||||
* followed by low data (currently 160us) - timings are
|
||||
* probably wrong, but good enough for everything I've tried
|
||||
* - Analog inputs are only used to time ID packet request.
|
||||
* If A0 timing out is followed after ~64us by another 0x201
|
||||
* write then an ID packet is triggered
|
||||
* - Sidewinder game pad ID is 'H0003'
|
||||
* - ID is sent in Mode A (1 bit per clock), but data bit 2
|
||||
* must change during ID packet transfer, or Windows 9x
|
||||
* drivers won't use Mode B. I don't know if it oscillates,
|
||||
* mirrors the data transfer, or something else - the drivers
|
||||
* only check that it changes at least 10 times during the
|
||||
* transfer
|
||||
* - Some DOS stuff will write to 0x201 while a packet is
|
||||
* being transferred. This seems to be ignored.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of Thrust Master Flight Control System.
|
||||
* Implementation of Thrust Master Flight Control System.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Various definitions for portable byte-swapping.
|
||||
* Various definitions for portable byte-swapping.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* neozeed,
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* neozeed,
|
||||
*
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2018 neozeed.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2018 neozeed.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -44,34 +44,34 @@
|
||||
#include <byteswap.h>
|
||||
#else
|
||||
# define bswap_16(x) \
|
||||
( \
|
||||
((uint16_t)( \
|
||||
(((uint16_t)(x) & (uint16_t)0x00ffU) << 8) | \
|
||||
(((uint16_t)(x) & (uint16_t)0xff00U) >> 8) )) \
|
||||
)
|
||||
( \
|
||||
((uint16_t)( \
|
||||
(((uint16_t)(x) & (uint16_t)0x00ffU) << 8) | \
|
||||
(((uint16_t)(x) & (uint16_t)0xff00U) >> 8) )) \
|
||||
)
|
||||
|
||||
# define bswap_32(x) \
|
||||
( \
|
||||
((uint32_t)( \
|
||||
(((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
|
||||
(((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
|
||||
(((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
|
||||
(((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24) )) \
|
||||
)
|
||||
( \
|
||||
((uint32_t)( \
|
||||
(((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
|
||||
(((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
|
||||
(((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
|
||||
(((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24) )) \
|
||||
)
|
||||
|
||||
# define bswap_64(x) \
|
||||
( \
|
||||
((uint64_t)( \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56) )) \
|
||||
)
|
||||
#endif /*HAVE_BYTESWAP_H*/
|
||||
( \
|
||||
((uint64_t)( \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
|
||||
(uint64_t)(((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56) )) \
|
||||
)
|
||||
#endif /*HAVE_BYTESWAP_H*/
|
||||
|
||||
#if defined __has_builtin && __has_builtin(__builtin_bswap16)
|
||||
#define bswap16(x) __builtin_bswap16(x)
|
||||
|
||||
@@ -111,7 +111,7 @@ typedef struct cdrom {
|
||||
char *image_history[CD_IMAGE_HISTORY];
|
||||
|
||||
uint32_t sound_on, cdrom_capacity,
|
||||
pad, seek_pos,
|
||||
early, seek_pos,
|
||||
seek_diff, cd_end;
|
||||
|
||||
int host_drive, prev_host_drive,
|
||||
|
||||
@@ -108,10 +108,12 @@ extern const device_t opti291_device;
|
||||
extern const device_t opti493_device;
|
||||
extern const device_t opti495_device;
|
||||
extern const device_t opti802g_device;
|
||||
extern const device_t opti802g_pci_device;
|
||||
extern const device_t opti822_device;
|
||||
extern const device_t opti895_device;
|
||||
|
||||
extern const device_t opti5x7_device;
|
||||
extern const device_t opti5x7_pci_device;
|
||||
|
||||
/* SiS */
|
||||
extern const device_t rabbit_device;
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the device handler.
|
||||
* Definitions for the device handler.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the Intel DMA controller.
|
||||
* Definitions for the Intel DMA controller.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2017-2020 Fred N. van Kempen.
|
||||
* Copyright 2016-2020 Miran Grca.
|
||||
* Copyright 2008-2020 Sarah Walker.
|
||||
* Copyright 2017-2020 Fred N. van Kempen.
|
||||
* Copyright 2016-2020 Miran Grca.
|
||||
* Copyright 2008-2020 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,36 +1,34 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
*
|
||||
* Definitions for the PCjs JSON floppy image format.
|
||||
* Definitions for the PCjs JSON floppy image format.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
@@ -1,36 +1,34 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
*
|
||||
* Definitions for the ISAMEM cards.
|
||||
* Definitions for the ISAMEM cards.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
@@ -1,36 +1,34 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
*
|
||||
* Definitions for the ISARTC cards.
|
||||
* Definitions for the ISARTC cards.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the joystick driver.
|
||||
* Definitions for the joystick driver.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the Sidewinder Pro driver.
|
||||
* Definitions for the Sidewinder Pro driver.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the Flight Control System driver.
|
||||
* Definitions for the Flight Control System driver.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the keyboard interface.
|
||||
* Definitions for the keyboard interface.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
*/
|
||||
|
||||
#ifndef EMU_KEYBOARD_H
|
||||
@@ -150,6 +150,7 @@ extern const device_t keyboard_pravetz_device;
|
||||
extern const device_t keyboard_xt_device;
|
||||
extern const device_t keyboard_xt86_device;
|
||||
extern const device_t keyboard_xt_compaq_device;
|
||||
extern const device_t keyboard_xt_t1x00_device;
|
||||
extern const device_t keyboard_tandy_device;
|
||||
# if defined(DEV_BRANCH) && defined(USE_LASERXT)
|
||||
extern const device_t keyboard_xt_lxt3_device;
|
||||
|
||||
@@ -134,6 +134,7 @@
|
||||
#define IDS_2158 2158 // "Hard reset"
|
||||
#define IDS_2159 2159 // "ACPI shutdown"
|
||||
#define IDS_2160 2160 // "Settings"
|
||||
#define IDS_2161 2161 // "Early drive"
|
||||
|
||||
#define IDS_4096 4096 // "Hard disk (%s)"
|
||||
#define IDS_4097 4097 // "%01i:%01i"
|
||||
@@ -242,8 +243,8 @@
|
||||
|
||||
#define IDS_LANG_ENUS IDS_7168
|
||||
|
||||
#define STR_NUM_2048 106
|
||||
#define STR_NUM_3072 11
|
||||
#define STR_NUM_2048 114
|
||||
// UNUSED: #define STR_NUM_3072 11
|
||||
#define STR_NUM_4096 40
|
||||
#define STR_NUM_4352 6
|
||||
#define STR_NUM_4608 6
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the Toshiba T3100e system.
|
||||
* Definitions for the Toshiba T3100e system.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the Toshiba T1000/T1200 machines.
|
||||
* Definitions for the Toshiba T1000/T1200 machines.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -786,6 +786,7 @@ extern int machine_xt_top88_init(const machine_t *);
|
||||
extern int machine_xt_kaypropc_init(const machine_t *);
|
||||
extern int machine_xt_sansx16_init(const machine_t *);
|
||||
extern int machine_xt_bw230_init(const machine_t *);
|
||||
extern int machine_xt_pb8810_init(const machine_t *);
|
||||
|
||||
extern int machine_xt_v20xt_init(const machine_t *);
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the NE2000 ethernet controller.
|
||||
* Definitions for the NE2000 ethernet controller.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,36 +1,34 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
*
|
||||
* Definitions for the network module.
|
||||
* Definitions for the network module.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
@@ -1,38 +1,36 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
*
|
||||
* Definitions for the generic NVRAM/CMOS driver.
|
||||
* Definitions for the generic NVRAM/CMOS driver.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>,
|
||||
* David Hrdlička, <hrdlickadavid@outlook.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>,
|
||||
* David Hrdlička, <hrdlickadavid@outlook.com>
|
||||
*
|
||||
* Copyright 2017-2020 Fred N. van Kempen.
|
||||
* Copyright 2018-2020 David Hrdlička.
|
||||
* Copyright 2017-2020 Fred N. van Kempen.
|
||||
* Copyright 2018-2020 David Hrdlička.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
@@ -88,6 +86,7 @@ extern const device_t at_nvr_old_device;
|
||||
extern const device_t at_nvr_device;
|
||||
extern const device_t ps_nvr_device;
|
||||
extern const device_t amstrad_nvr_device;
|
||||
extern const device_t amstrad_megapc_nvr_device;
|
||||
extern const device_t ibmat_nvr_device;
|
||||
extern const device_t piix4_nvr_device;
|
||||
extern const device_t ps_no_nmi_nvr_device;
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the PS/2 cmos/nvr device.
|
||||
* Definitions for the PS/2 cmos/nvr device.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,36 +1,34 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
*
|
||||
* Definitions for the centralized PNG image handler.
|
||||
* Definitions for the centralized PNG image handler.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
@@ -1,36 +1,34 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
*
|
||||
* Definitions for the printers module.
|
||||
* Definitions for the printers module.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
@@ -130,9 +130,8 @@
|
||||
#define IDT_CD_DRIVES 1754 /* CD-ROM drives: */
|
||||
#define IDT_CD_BUS 1755 /* Bus: */
|
||||
#define IDT_CD_ID 1756 /* ID: */
|
||||
#define IDT_CD_LUN 1757 /* LUN: */
|
||||
#define IDT_CD_CHANNEL 1758 /* Channel: */
|
||||
#define IDT_CD_SPEED 1759 /* Speed: */
|
||||
#define IDT_CD_CHANNEL 1757 /* Channel: */
|
||||
#define IDT_CD_SPEED 1758 /* Speed: */
|
||||
|
||||
/* DLG_CFG_OTHER_REMOVABLE_DEVICES */
|
||||
#define IDT_MO_DRIVES 1760 /* MO drives: */
|
||||
@@ -277,38 +276,39 @@
|
||||
#define IDC_COMBO_CD_ID 1127
|
||||
#define IDC_COMBO_CD_LUN 1128
|
||||
#define IDC_COMBO_CD_CHANNEL_IDE 1129
|
||||
#define IDC_CHECKEARLY 1130
|
||||
|
||||
#define IDC_LIST_ZIP_DRIVES 1130 /* other removable devices config */
|
||||
#define IDC_COMBO_ZIP_BUS 1131
|
||||
#define IDC_COMBO_ZIP_ID 1132
|
||||
#define IDC_COMBO_ZIP_LUN 1133
|
||||
#define IDC_COMBO_ZIP_CHANNEL_IDE 1134
|
||||
#define IDC_CHECK250 1135
|
||||
#define IDC_COMBO_CD_SPEED 1136
|
||||
#define IDC_LIST_MO_DRIVES 1137
|
||||
#define IDC_COMBO_MO_BUS 1138
|
||||
#define IDC_COMBO_MO_ID 1139
|
||||
#define IDC_COMBO_MO_LUN 1140
|
||||
#define IDC_COMBO_MO_CHANNEL_IDE 1141
|
||||
#define IDC_COMBO_MO_TYPE 1142
|
||||
#define IDC_LIST_ZIP_DRIVES 1140 /* other removable devices config */
|
||||
#define IDC_COMBO_ZIP_BUS 1141
|
||||
#define IDC_COMBO_ZIP_ID 1142
|
||||
#define IDC_COMBO_ZIP_LUN 1143
|
||||
#define IDC_COMBO_ZIP_CHANNEL_IDE 1144
|
||||
#define IDC_CHECK250 1145
|
||||
#define IDC_COMBO_CD_SPEED 1146
|
||||
#define IDC_LIST_MO_DRIVES 1147
|
||||
#define IDC_COMBO_MO_BUS 1148
|
||||
#define IDC_COMBO_MO_ID 1149
|
||||
#define IDC_COMBO_MO_LUN 1150
|
||||
#define IDC_COMBO_MO_CHANNEL_IDE 1151
|
||||
#define IDC_COMBO_MO_TYPE 1152
|
||||
|
||||
#define IDC_CHECK_BUGGER 1150 /* other periph config */
|
||||
#define IDC_CHECK_POSTCARD 1151
|
||||
#define IDC_COMBO_ISARTC 1152
|
||||
#define IDC_CONFIGURE_ISARTC 1153
|
||||
#define IDC_COMBO_FDC 1154
|
||||
#define IDC_CONFIGURE_FDC 1155
|
||||
#define IDC_GROUP_ISAMEM 1156
|
||||
#define IDC_COMBO_ISAMEM_1 1157
|
||||
#define IDC_COMBO_ISAMEM_2 1158
|
||||
#define IDC_COMBO_ISAMEM_3 1159
|
||||
#define IDC_COMBO_ISAMEM_4 1160
|
||||
#define IDC_CONFIGURE_ISAMEM_1 1161
|
||||
#define IDC_CONFIGURE_ISAMEM_2 1162
|
||||
#define IDC_CONFIGURE_ISAMEM_3 1163
|
||||
#define IDC_CONFIGURE_ISAMEM_4 1164
|
||||
#define IDC_CHECK_BUGGER 1160 /* other periph config */
|
||||
#define IDC_CHECK_POSTCARD 1161
|
||||
#define IDC_COMBO_ISARTC 1162
|
||||
#define IDC_CONFIGURE_ISARTC 1163
|
||||
#define IDC_COMBO_FDC 1164
|
||||
#define IDC_CONFIGURE_FDC 1165
|
||||
#define IDC_GROUP_ISAMEM 1166
|
||||
#define IDC_COMBO_ISAMEM_1 1167
|
||||
#define IDC_COMBO_ISAMEM_2 1168
|
||||
#define IDC_COMBO_ISAMEM_3 1169
|
||||
#define IDC_COMBO_ISAMEM_4 1170
|
||||
#define IDC_CONFIGURE_ISAMEM_1 1171
|
||||
#define IDC_CONFIGURE_ISAMEM_2 1172
|
||||
#define IDC_CONFIGURE_ISAMEM_3 1173
|
||||
#define IDC_CONFIGURE_ISAMEM_4 1174
|
||||
|
||||
#define IDC_SLIDER_GAIN 1170 /* sound gain dialog */
|
||||
#define IDC_SLIDER_GAIN 1180 /* sound gain dialog */
|
||||
|
||||
#define IDC_EDIT_FILE_NAME 1200 /* new floppy image dialog */
|
||||
#define IDC_COMBO_DISK_SIZE 1201
|
||||
|
||||
@@ -36,7 +36,7 @@ typedef struct {
|
||||
uint8_t status, phase,
|
||||
error, id,
|
||||
features, cur_lun,
|
||||
pad0, pad1;
|
||||
early, pad1;
|
||||
|
||||
uint16_t request_length, max_transfer_len;
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#define GPCMD_PREVENT_REMOVAL 0x1e
|
||||
#define GPCMD_READ_FORMAT_CAPACITIES 0x23
|
||||
#define GPCMD_READ_CDROM_CAPACITY 0x25
|
||||
#define GPCMD_CHINON_UNKNOWN 0x26
|
||||
#define GPCMD_READ_10 0x28
|
||||
#define GPCMD_READ_GENERATION 0x29
|
||||
#define GPCMD_WRITE_10 0x2a
|
||||
@@ -105,11 +106,13 @@
|
||||
#define GPCMD_MECHANISM_STATUS 0xbd
|
||||
#define GPCMD_READ_CD 0xbe
|
||||
#define GPCMD_SEND_DVD_STRUCTURE 0xbf /* This is for writing only, irrelevant to 86Box. */
|
||||
#define GPCMD_CHINON_EJECT 0xc0 /* Chinon Vendor Unique command */
|
||||
#define GPCMD_AUDIO_TRACK_SEARCH 0xc0 /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_TOSHIBA_PLAY_AUDIO 0xc1 /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_PAUSE_RESUME_ALT 0xc2
|
||||
#define GPCMD_STILL 0xc2 /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_CADDY_EJECT 0xc4 /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_CHINON_STOP 0xc6 /* Chinon Vendor Unique command */
|
||||
#define GPCMD_READ_SUBCODEQ_PLAYING_STATUS 0xc6 /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_READ_DISC_INFORMATION_TOSHIBA 0xc7 /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_SCAN_ALT 0xcd /* Should be equivalent to 0xba */
|
||||
@@ -249,6 +252,7 @@
|
||||
#define MMC_PROFILE_HDDVD_RW_DL 0x005A
|
||||
#define MMC_PROFILE_INVALID 0xFFFF
|
||||
|
||||
#define EARLY_ONLY 64
|
||||
#define SCSI_ONLY 32
|
||||
#define ATAPI_ONLY 16
|
||||
#define IMPLEMENTED 8
|
||||
|
||||
@@ -80,6 +80,7 @@ extern const device_t adgold_device;
|
||||
|
||||
/* Aztech Sound Galaxy 16 */
|
||||
extern const device_t azt2316a_device;
|
||||
extern const device_t acermagic_s20_device;
|
||||
extern const device_t azt1605_device;
|
||||
|
||||
/* Ensoniq AudioPCI */
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Definitions for the video controller module.
|
||||
* Definitions for the video controller module.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
*/
|
||||
|
||||
#ifndef EMU_VIDEO_H
|
||||
@@ -227,7 +227,7 @@ extern void video_setblit(void (*blit)(int, int, int, int, int));
|
||||
extern void video_blend(int x, int y);
|
||||
extern void video_blit_memtoscreen_8(int x, int y, int w, int h);
|
||||
extern void video_blend_monitor(int x, int y, int monitor_index);
|
||||
extern void video_blit_memtoscreen_8_monitor(int x, int y, int w, int h, int monitor_index);
|
||||
extern void video_process_8_monitor(int x, int y, int monitor_index);
|
||||
extern void video_blit_memtoscreen_monitor(int x, int y, int w, int h, int monitor_index);
|
||||
extern void video_blit_complete_monitor(int monitor_index);
|
||||
extern void video_wait_for_blit_monitor(int monitor_index);
|
||||
@@ -262,7 +262,7 @@ extern uint32_t video_color_transform(uint32_t color);
|
||||
#define video_get_type() video_get_type_monitor(0)
|
||||
#define video_blend(x, y) video_blend_monitor(x, y, monitor_index_global)
|
||||
#define video_blit_memtoscreen(x, y, w, h) video_blit_memtoscreen_monitor(x, y, w, h, monitor_index_global)
|
||||
#define video_blit_memtoscreen_8(x, y, w, h) video_blit_memtoscreen_8_monitor(x, y, w, h, monitor_index_global)
|
||||
#define video_process_8(x, y) video_process_8_monitor(x, y, monitor_index_global)
|
||||
#define video_blit_complete() video_blit_complete_monitor(monitor_index_global)
|
||||
#define video_wait_for_blit() video_wait_for_blit_monitor(monitor_index_global)
|
||||
#define video_wait_for_buffer() video_wait_for_buffer_monitor(monitor_index_global)
|
||||
|
||||
@@ -469,6 +469,14 @@ vid_poll_1512(void *priv)
|
||||
}
|
||||
}
|
||||
|
||||
if (vid->cgamode & 1)
|
||||
x = (vid->crtc[1] << 3) + 16;
|
||||
else
|
||||
x = (vid->crtc[1] << 4) + 16;
|
||||
|
||||
video_process_8(x, vid->displine << 1);
|
||||
video_process_8(x, (vid->displine << 1) + 1);
|
||||
|
||||
vid->sc = oldsc;
|
||||
if (vid->vsynctime)
|
||||
vid->stat |= 8;
|
||||
@@ -548,11 +556,11 @@ vid_poll_1512(void *priv)
|
||||
}
|
||||
|
||||
if (enable_overscan) {
|
||||
video_blit_memtoscreen_8(0, (vid->firstline - 4) << 1,
|
||||
xsize, ((vid->lastline - vid->firstline) + 8) << 1);
|
||||
video_blit_memtoscreen(0, (vid->firstline - 4) << 1,
|
||||
xsize, ((vid->lastline - vid->firstline) + 8) << 1);
|
||||
} else {
|
||||
video_blit_memtoscreen_8(8, vid->firstline << 1,
|
||||
xsize, (vid->lastline - vid->firstline) << 1);
|
||||
video_blit_memtoscreen(8, vid->firstline << 1,
|
||||
xsize, (vid->lastline - vid->firstline) << 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Standard PC/AT implementation.
|
||||
* Standard PC/AT implementation.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2017-2020 Fred N. van Kempen.
|
||||
* Copyright 2016-2020 Miran Grca.
|
||||
* Copyright 2008-2020 Sarah Walker.
|
||||
* Copyright 2017-2020 Fred N. van Kempen.
|
||||
* Copyright 2016-2020 Miran Grca.
|
||||
* Copyright 2008-2020 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/port_6x.h>
|
||||
#include <86box/sio.h>
|
||||
#include <86box/serial.h>
|
||||
@@ -493,7 +494,8 @@ machine_at_adi386sx_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
machine_at_common_init_ex(model, 2);
|
||||
device_add(&amstrad_megapc_nvr_device); /* NVR that is initialized to all 0x00's. */
|
||||
|
||||
device_add(&intel_82335_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
@@ -637,7 +637,7 @@ machine_at_pc330_6573_init(const machine_t *model) /* doesn't like every CPU oth
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
|
||||
device_add(&opti802g_device);
|
||||
device_add(&opti802g_pci_device);
|
||||
device_add(&opti822_device);
|
||||
device_add(&keyboard_ps2_device);
|
||||
device_add(&fdc37c665_device);
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of the Commodore PC3 system.
|
||||
* Implementation of the Commodore PC3 system.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -390,7 +390,7 @@ machine_at_p5vl_init(const machine_t *model)
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
device_add(&opti5x7_device);
|
||||
device_add(&opti5x7_pci_device);
|
||||
device_add(&opti822_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
@@ -340,7 +340,7 @@ machine_at_hot543_init(const machine_t *model)
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
device_add(&opti5x7_device);
|
||||
device_add(&opti5x7_pci_device);
|
||||
device_add(&opti822_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
@@ -1,131 +1,131 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of the Toshiba T3100e.
|
||||
* Implementation of the Toshiba T3100e.
|
||||
*
|
||||
* The Toshiba 3100e is a 286-based portable.
|
||||
* The Toshiba 3100e is a 286-based portable.
|
||||
*
|
||||
* To bring up the BIOS setup screen hold down the 'Fn' key
|
||||
* on booting.
|
||||
* To bring up the BIOS setup screen hold down the 'Fn' key
|
||||
* on booting.
|
||||
*
|
||||
* Memory management
|
||||
* ~~~~~~~~~~~~~~~~~
|
||||
* Memory management
|
||||
* ~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* Motherboard memory is divided into:
|
||||
* - Conventional memory: Either 512k or 640k
|
||||
* - Upper memory: Either 512k or 384k, depending on
|
||||
* amount of conventional memory.
|
||||
* Upper memory can be used as EMS or XMS.
|
||||
* - High memory: 0-4Mb, depending on RAM installed.
|
||||
* The BIOS setup screen allows some or
|
||||
* all of this to be used as EMS; the
|
||||
* remainder is XMS.
|
||||
* Motherboard memory is divided into:
|
||||
* - Conventional memory: Either 512k or 640k
|
||||
* - Upper memory: Either 512k or 384k, depending on
|
||||
* amount of conventional memory.
|
||||
* Upper memory can be used as EMS or XMS.
|
||||
* - High memory: 0-4Mb, depending on RAM installed.
|
||||
* The BIOS setup screen allows some or
|
||||
* all of this to be used as EMS; the
|
||||
* remainder is XMS.
|
||||
*
|
||||
* Additional memory (either EMS or XMS) can also be provided
|
||||
* by ISA expansion cards.
|
||||
* Additional memory (either EMS or XMS) can also be provided
|
||||
* by ISA expansion cards.
|
||||
*
|
||||
* Under test in PCem, the BIOS will boot with up to 65368Kb
|
||||
* of memory in total (16Mb less 16k). However it will give
|
||||
* an error with RAM sizes above 8Mb, if any of the high
|
||||
* memory is allocated as EMS, because the builtin EMS page
|
||||
* registers can only access up to 8Mb.
|
||||
* Under test in PCem, the BIOS will boot with up to 65368Kb
|
||||
* of memory in total (16Mb less 16k). However it will give
|
||||
* an error with RAM sizes above 8Mb, if any of the high
|
||||
* memory is allocated as EMS, because the builtin EMS page
|
||||
* registers can only access up to 8Mb.
|
||||
*
|
||||
* Memory is controlled by writes to I/O port 8084h:
|
||||
* Bit 7: Always 0 }
|
||||
* Bit 6: Always 1 } These bits select which motherboard
|
||||
* Bit 5: Always 0 } function to access.
|
||||
* Bit 4: Set to treat upper RAM as XMS
|
||||
* Bit 3: Enable external RAM boards?
|
||||
* Bit 2: Set for 640k conventional memory, clear for 512k
|
||||
* Bit 1: Enable RAM beyond 1Mb.
|
||||
* Bit 0: Enable EMS.
|
||||
* Memory is controlled by writes to I/O port 8084h:
|
||||
* Bit 7: Always 0 }
|
||||
* Bit 6: Always 1 } These bits select which motherboard
|
||||
* Bit 5: Always 0 } function to access.
|
||||
* Bit 4: Set to treat upper RAM as XMS
|
||||
* Bit 3: Enable external RAM boards?
|
||||
* Bit 2: Set for 640k conventional memory, clear for 512k
|
||||
* Bit 1: Enable RAM beyond 1Mb.
|
||||
* Bit 0: Enable EMS.
|
||||
*
|
||||
* The last value written to this port is saved at 0040:0093h,
|
||||
* and in CMOS memory at offset 0x37. If the top bit of the
|
||||
* CMOS byte is set, then high memory is being provided by
|
||||
* an add-on card rather than the mainboard; accordingly,
|
||||
* the BIOS will not allow high memory to be used as EMS.
|
||||
* The last value written to this port is saved at 0040:0093h,
|
||||
* and in CMOS memory at offset 0x37. If the top bit of the
|
||||
* CMOS byte is set, then high memory is being provided by
|
||||
* an add-on card rather than the mainboard; accordingly,
|
||||
* the BIOS will not allow high memory to be used as EMS.
|
||||
*
|
||||
* EMS is controlled by 16 page registers:
|
||||
* EMS is controlled by 16 page registers:
|
||||
*
|
||||
* Page mapped at 0xD000 0xD400 0xD800 0xDC00
|
||||
* ------------------------------------------------------
|
||||
* Pages 0x00-0x7F 0x208 0x4208 0x8208 0xc208
|
||||
* Pages 0x80-0xFF 0x218 0x4218 0x8218 0xc218
|
||||
* Pages 0x100-0x17F 0x258 0x4258 0x8258 0xc258
|
||||
* Pages 0x180-0x1FF 0x268 0x4268 0x8268 0xc268
|
||||
* Page mapped at 0xD000 0xD400 0xD800 0xDC00
|
||||
* ------------------------------------------------------
|
||||
* Pages 0x00-0x7F 0x208 0x4208 0x8208 0xc208
|
||||
* Pages 0x80-0xFF 0x218 0x4218 0x8218 0xc218
|
||||
* Pages 0x100-0x17F 0x258 0x4258 0x8258 0xc258
|
||||
* Pages 0x180-0x1FF 0x268 0x4268 0x8268 0xc268
|
||||
*
|
||||
* The value written has bit 7 set to enable EMS, reset to
|
||||
* disable it.
|
||||
* The value written has bit 7 set to enable EMS, reset to
|
||||
* disable it.
|
||||
*
|
||||
* So:
|
||||
* OUT 0x208, 0x80 will page in the first 16k page at 0xD0000.
|
||||
* OUT 0x208, 0x00 will page out EMS, leaving nothing at 0xD0000.
|
||||
* OUT 0x4208, 0x80 will page in the first 16k page at 0xD4000.
|
||||
* OUT 0x218, 0x80 will page in the 129th 16k page at 0xD0000.
|
||||
* etc.
|
||||
* So:
|
||||
* OUT 0x208, 0x80 will page in the first 16k page at 0xD0000.
|
||||
* OUT 0x208, 0x00 will page out EMS, leaving nothing at 0xD0000.
|
||||
* OUT 0x4208, 0x80 will page in the first 16k page at 0xD4000.
|
||||
* OUT 0x218, 0x80 will page in the 129th 16k page at 0xD0000.
|
||||
* etc.
|
||||
*
|
||||
* To use EMS from DOS, you will need the Toshiba EMS driver
|
||||
* (TOSHEMM.ZIP). This supports the above system, plus further
|
||||
* ranges of ports at 0x_2A8, 0x_2B8, 0x_2C8.
|
||||
* To use EMS from DOS, you will need the Toshiba EMS driver
|
||||
* (TOSHEMM.ZIP). This supports the above system, plus further
|
||||
* ranges of ports at 0x_2A8, 0x_2B8, 0x_2C8.
|
||||
*
|
||||
* Features not implemented:
|
||||
* > Four video fonts.
|
||||
* > BIOS-controlled mapping of serial ports to IRQs.
|
||||
* > Custom keyboard controller. This has a number of extra
|
||||
* commands in the 0xB0-0xBC range, for such things as turbo
|
||||
* on/off, and switching the keyboard between AT and PS/2
|
||||
* modes. Currently I have only implemented command 0xBB,
|
||||
* so that self-test completes successfully. Commands include:
|
||||
* Features not implemented:
|
||||
* > Four video fonts.
|
||||
* > BIOS-controlled mapping of serial ports to IRQs.
|
||||
* > Custom keyboard controller. This has a number of extra
|
||||
* commands in the 0xB0-0xBC range, for such things as turbo
|
||||
* on/off, and switching the keyboard between AT and PS/2
|
||||
* modes. Currently I have only implemented command 0xBB,
|
||||
* so that self-test completes successfully. Commands include:
|
||||
*
|
||||
* 0xB0: Turbo on
|
||||
* 0xB1: Turbo off
|
||||
* 0xB2: Internal display on?
|
||||
* 0xB3: Internal display off?
|
||||
* 0xB5: Get settings byte (bottom bit is color/mono setting)
|
||||
* 0xB6: Set settings byte
|
||||
* 0xB7: Behave as 101-key PS/2 keyboard
|
||||
* 0xB8: Behave as 84-key AT keyboard
|
||||
* 0xBB: Return a byte, bit 2 is Fn key state, other bits unknown.
|
||||
* 0xB0: Turbo on
|
||||
* 0xB1: Turbo off
|
||||
* 0xB2: Internal display on?
|
||||
* 0xB3: Internal display off?
|
||||
* 0xB5: Get settings byte (bottom bit is color/mono setting)
|
||||
* 0xB6: Set settings byte
|
||||
* 0xB7: Behave as 101-key PS/2 keyboard
|
||||
* 0xB8: Behave as 84-key AT keyboard
|
||||
* 0xBB: Return a byte, bit 2 is Fn key state, other bits unknown.
|
||||
*
|
||||
* The other main I/O port needed to POST is:
|
||||
* 0x8084: System control.
|
||||
* Top 3 bits give command, bottom 5 bits give parameters.
|
||||
* 000 => set serial port IRQ / addresses
|
||||
* bit 4: IRQ5 serial port base: 1 => 0x338, 0 => 0x3E8
|
||||
* bits 3, 2, 0 specify serial IRQs for COM1, COM2, COM3:
|
||||
* 00 0 => 4, 3, 5
|
||||
* The other main I/O port needed to POST is:
|
||||
* 0x8084: System control.
|
||||
* Top 3 bits give command, bottom 5 bits give parameters.
|
||||
* 000 => set serial port IRQ / addresses
|
||||
* bit 4: IRQ5 serial port base: 1 => 0x338, 0 => 0x3E8
|
||||
* bits 3, 2, 0 specify serial IRQs for COM1, COM2, COM3:
|
||||
* 00 0 => 4, 3, 5
|
||||
* 00 1 => 4, 5, 3
|
||||
* 01 0 => 3, 4, 5
|
||||
* 01 1 => 3, 5, 4
|
||||
* 10 0 => 4, -, 3
|
||||
* 10 1 => 3, -, 4
|
||||
* 010 => set memory mappings
|
||||
* bit 4 set if upper RAM is XMS
|
||||
* bit 3 enable add-on memory boards beyond 5Mb?
|
||||
* bit 2 set for 640k sysram, clear for 512k sysram
|
||||
* bit 1 enable mainboard XMS
|
||||
* bit 0 enable mainboard EMS
|
||||
* 100 => set parallel mode / LCD settings
|
||||
* bit 4 set for bidirectional parallel port
|
||||
* bit 3 set to disable internal CGA
|
||||
* bit 2 set for single-pixel LCD font
|
||||
* bits 0,1 for display font
|
||||
* 010 => set memory mappings
|
||||
* bit 4 set if upper RAM is XMS
|
||||
* bit 3 enable add-on memory boards beyond 5Mb?
|
||||
* bit 2 set for 640k sysram, clear for 512k sysram
|
||||
* bit 1 enable mainboard XMS
|
||||
* bit 0 enable mainboard EMS
|
||||
* 100 => set parallel mode / LCD settings
|
||||
* bit 4 set for bidirectional parallel port
|
||||
* bit 3 set to disable internal CGA
|
||||
* bit 2 set for single-pixel LCD font
|
||||
* bits 0,1 for display font
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -486,7 +486,7 @@ t3100e_sys_in(uint16_t addr, void *p)
|
||||
void
|
||||
t3100e_sys_out(uint16_t addr, uint8_t val, void *p)
|
||||
{
|
||||
// struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)p;
|
||||
// struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)p;
|
||||
|
||||
switch (val & 0xE0) {
|
||||
case 0x00: /* Set serial port IRQs. Not implemented */
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of the Toshiba 3100e plasma display.
|
||||
* This display has a fixed 640x400 resolution.
|
||||
* Implementation of the Toshiba 3100e plasma display.
|
||||
* This display has a fixed 640x400 resolution.
|
||||
*
|
||||
* T3100e CRTC regs (from the ROM):
|
||||
* T3100e CRTC regs (from the ROM):
|
||||
*
|
||||
* Selecting a character height of 3 seems to be sufficient to
|
||||
* convert the 640x200 graphics mode to 640x400 (and, by
|
||||
* analogy, 320x200 to 320x400).
|
||||
* Selecting a character height of 3 seems to be sufficient to
|
||||
* convert the 640x200 graphics mode to 640x400 (and, by
|
||||
* analogy, 320x200 to 320x400).
|
||||
*
|
||||
* Horiz-----> Vert------> I ch
|
||||
* 38 28 2D 0A 1F 06 19 1C 02 07 06 07 CO40
|
||||
* 71 50 5A 0A 1F 06 19 1C 02 07 06 07 CO80
|
||||
* 38 28 2D 0A 7F 06 64 70 02 01 06 07 Graphics
|
||||
* 61 50 52 0F 19 06 19 19 02 0D 0B 0C MONO
|
||||
* 2D 28 22 0A 67 00 64 67 02 03 06 07 640x400
|
||||
* Horiz-----> Vert------> I ch
|
||||
* 38 28 2D 0A 1F 06 19 1C 02 07 06 07 CO40
|
||||
* 71 50 5A 0A 1F 06 19 1C 02 07 06 07 CO80
|
||||
* 38 28 2D 0A 7F 06 64 70 02 01 06 07 Graphics
|
||||
* 61 50 52 0F 19 06 19 19 02 0D 0B 0C MONO
|
||||
* 2D 28 22 0A 67 00 64 67 02 03 06 07 640x400
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -561,9 +561,9 @@ t3100e_recalcattrs(t3100e_t *t3100e)
|
||||
* Bit 0: Attributes 01-06, 08-0E are inverse video
|
||||
* Bit 1: Attributes 01-06, 08-0E are bold
|
||||
* Bit 2: Attributes 11-16, 18-1F, 21-26, 28-2F ... F1-F6, F8-FF
|
||||
* are inverse video
|
||||
* are inverse video
|
||||
* Bit 3: Attributes 11-16, 18-1F, 21-26, 28-2F ... F1-F6, F8-FF
|
||||
* are bold */
|
||||
* are bold */
|
||||
|
||||
/* Set up colours */
|
||||
amber = makecol(0xf7, 0x7C, 0x34);
|
||||
|
||||
@@ -433,6 +433,9 @@ vid_poll(void *p)
|
||||
if (pcjr->composite) {
|
||||
Composite_Process(pcjr->array[0], 0, x >> 2, buffer32->line[(pcjr->displine << 1)]);
|
||||
Composite_Process(pcjr->array[0], 0, x >> 2, buffer32->line[(pcjr->displine << 1) + 1]);
|
||||
} else {
|
||||
video_process_8(x, pcjr->displine << 1);
|
||||
video_process_8(x, (pcjr->displine << 1) + 1);
|
||||
}
|
||||
pcjr->sc = oldsc;
|
||||
if (pcjr->vc == pcjr->crtc[7] && !pcjr->sc) {
|
||||
@@ -519,19 +522,11 @@ vid_poll(void *p)
|
||||
}
|
||||
|
||||
if (enable_overscan) {
|
||||
if (pcjr->composite)
|
||||
video_blit_memtoscreen(0, (pcjr->firstline - 4) << 1,
|
||||
xsize, ((pcjr->lastline - pcjr->firstline) + 8) << 1);
|
||||
else
|
||||
video_blit_memtoscreen_8(0, (pcjr->firstline - 4) << 1,
|
||||
xsize, ((pcjr->lastline - pcjr->firstline) + 8) << 1);
|
||||
video_blit_memtoscreen(0, (pcjr->firstline - 4) << 1,
|
||||
xsize, ((pcjr->lastline - pcjr->firstline) + 8) << 1);
|
||||
} else {
|
||||
if (pcjr->composite)
|
||||
video_blit_memtoscreen(8, pcjr->firstline << 1,
|
||||
xsize, (pcjr->lastline - pcjr->firstline) << 1);
|
||||
else
|
||||
video_blit_memtoscreen_8(8, pcjr->firstline << 1,
|
||||
xsize, (pcjr->lastline - pcjr->firstline) << 1);
|
||||
video_blit_memtoscreen(8, pcjr->firstline << 1,
|
||||
xsize, (pcjr->lastline - pcjr->firstline) << 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,74 +1,72 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* Implementation of the PS/1 Model 2011 disk controller.
|
||||
*
|
||||
* Implementation of the PS/1 Model 2011 disk controller.
|
||||
* XTA is the acronym for 'XT-Attached', which was basically
|
||||
* the XT-counterpart to what we know now as IDE (which is
|
||||
* also named ATA - AT Attachment.) The basic ideas was to
|
||||
* put the actual drive controller electronics onto the drive
|
||||
* itself, and have the host machine just talk to that using
|
||||
* a simpe, standardized I/O path- hence the name IDE, for
|
||||
* Integrated Drive Electronics.
|
||||
*
|
||||
* XTA is the acronym for 'XT-Attached', which was basically
|
||||
* the XT-counterpart to what we know now as IDE (which is
|
||||
* also named ATA - AT Attachment.) The basic ideas was to
|
||||
* put the actual drive controller electronics onto the drive
|
||||
* itself, and have the host machine just talk to that using
|
||||
* a simpe, standardized I/O path- hence the name IDE, for
|
||||
* Integrated Drive Electronics.
|
||||
* In the ATA version of IDE, the programming interface of
|
||||
* the IBM PC/AT (which used the Western Digitial 1002/1003
|
||||
* controllers) was kept, and, so, ATA-IDE assumes a 16bit
|
||||
* data path: it reads and writes 16bit words of data. The
|
||||
* disk drives for this bus commonly have an 'A' suffix to
|
||||
* identify them as 'ATBUS'.
|
||||
*
|
||||
* In the ATA version of IDE, the programming interface of
|
||||
* the IBM PC/AT (which used the Western Digitial 1002/1003
|
||||
* controllers) was kept, and, so, ATA-IDE assumes a 16bit
|
||||
* data path: it reads and writes 16bit words of data. The
|
||||
* disk drives for this bus commonly have an 'A' suffix to
|
||||
* identify them as 'ATBUS'.
|
||||
* In XTA-IDE, which is slightly older, the programming
|
||||
* interface of the IBM PC/XT (which used the MFM controller
|
||||
* from Xebec) was kept, and, so, it uses an 8bit data path.
|
||||
* Disk drives for this bus commonly have the 'X' suffix to
|
||||
* mark them as being for this XTBUS variant.
|
||||
*
|
||||
* In XTA-IDE, which is slightly older, the programming
|
||||
* interface of the IBM PC/XT (which used the MFM controller
|
||||
* from Xebec) was kept, and, so, it uses an 8bit data path.
|
||||
* Disk drives for this bus commonly have the 'X' suffix to
|
||||
* mark them as being for this XTBUS variant.
|
||||
* So, XTA and ATA try to do the same thing, but they use
|
||||
* different ways to achive their goal.
|
||||
*
|
||||
* So, XTA and ATA try to do the same thing, but they use
|
||||
* different ways to achive their goal.
|
||||
* Also, XTA is **not** the same as XTIDE. XTIDE is a modern
|
||||
* variant of ATA-IDE, but retro-fitted for use on 8bit XT
|
||||
* systems: an extra register is used to deal with the extra
|
||||
* data byte per transfer. XTIDE uses regular IDE drives,
|
||||
* and uses the regular ATA/IDE programming interface, just
|
||||
* with the extra register.
|
||||
*
|
||||
* Also, XTA is **not** the same as XTIDE. XTIDE is a modern
|
||||
* variant of ATA-IDE, but retro-fitted for use on 8bit XT
|
||||
* systems: an extra register is used to deal with the extra
|
||||
* data byte per transfer. XTIDE uses regular IDE drives,
|
||||
* and uses the regular ATA/IDE programming interface, just
|
||||
* with the extra register.
|
||||
*
|
||||
* NOTE: We should probably find a nicer way to integrate our Disk
|
||||
* Type table with the main code, so the user can only select
|
||||
* items from that list...
|
||||
* NOTE: We should probably find a nicer way to integrate our Disk
|
||||
* Type table with the main code, so the user can only select
|
||||
* items from that list...
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Based on my earlier HD20 driver for the EuroPC.
|
||||
* Thanks to Marco Bortolin for the help and feedback !!
|
||||
* Based on my earlier HD20 driver for the EuroPC.
|
||||
* Thanks to Marco Bortolin for the help and feedback !!
|
||||
*
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
@@ -165,56 +163,56 @@ enum {
|
||||
#pragma pack(push, 1)
|
||||
typedef struct {
|
||||
/* Status byte 0. */
|
||||
uint8_t track_0 : 1, /* T0 */
|
||||
mbz1 : 1, /* 0 */
|
||||
mbz2 : 1, /* 0 */
|
||||
cylinder_err : 1, /* CE */
|
||||
write_fault : 1, /* WF */
|
||||
mbz3 : 1, /* 0 */
|
||||
seek_end : 1, /* SE */
|
||||
not_ready : 1; /* NR */
|
||||
uint8_t track_0 : 1, /* T0 */
|
||||
mbz1 : 1, /* 0 */
|
||||
mbz2 : 1, /* 0 */
|
||||
cylinder_err : 1, /* CE */
|
||||
write_fault : 1, /* WF */
|
||||
mbz3 : 1, /* 0 */
|
||||
seek_end : 1, /* SE */
|
||||
not_ready : 1; /* NR */
|
||||
|
||||
/* Status byte 1. */
|
||||
uint8_t id_not_found : 1, /* ID */
|
||||
mbz4 : 1, /* 0 */
|
||||
mbz5 : 1, /* 0 */
|
||||
wrong_cyl : 1, /* WC */
|
||||
all_bit_set : 1, /* BT */
|
||||
mark_not_found : 1, /* AM */
|
||||
ecc_crc_err : 1, /* ET */
|
||||
ecc_crc_field : 1; /* EF */
|
||||
uint8_t id_not_found : 1, /* ID */
|
||||
mbz4 : 1, /* 0 */
|
||||
mbz5 : 1, /* 0 */
|
||||
wrong_cyl : 1, /* WC */
|
||||
all_bit_set : 1, /* BT */
|
||||
mark_not_found : 1, /* AM */
|
||||
ecc_crc_err : 1, /* ET */
|
||||
ecc_crc_field : 1; /* EF */
|
||||
|
||||
/* Status byte 2. */
|
||||
uint8_t headsel_state : 4, /* headsel state[4] */
|
||||
defective_sector : 1, /* DS */
|
||||
retried_ok : 1, /* RG */
|
||||
need_reset : 1, /* RR */
|
||||
uint8_t headsel_state : 4, /* headsel state[4] */
|
||||
defective_sector : 1, /* DS */
|
||||
retried_ok : 1, /* RG */
|
||||
need_reset : 1, /* RR */
|
||||
#if 1
|
||||
valid : 1; /* 0 (abused as VALID) */
|
||||
valid : 1; /* 0 (abused as VALID) */
|
||||
#else
|
||||
mbz6 : 1; /* 0 */
|
||||
mbz6 : 1; /* 0 */
|
||||
#endif
|
||||
|
||||
/* Most recent ID field seen. */
|
||||
uint8_t last_cyl_low; /* Cyl_Low[8] */
|
||||
uint8_t last_head : 4, /* HD[4] */
|
||||
mbz7 : 1, /* 0 */
|
||||
last_cyl_high : 2, /* Cyl_high[2] */
|
||||
last_def_sect : 1; /* DS */
|
||||
uint8_t last_sect; /* Sect[8] */
|
||||
uint8_t last_cyl_low; /* Cyl_Low[8] */
|
||||
uint8_t last_head : 4, /* HD[4] */
|
||||
mbz7 : 1, /* 0 */
|
||||
last_cyl_high : 2, /* Cyl_high[2] */
|
||||
last_def_sect : 1; /* DS */
|
||||
uint8_t last_sect; /* Sect[8] */
|
||||
|
||||
uint8_t sect_size; /* Size[8] = 02 */
|
||||
uint8_t sect_size; /* Size[8] = 02 */
|
||||
|
||||
/* Current position. */
|
||||
uint8_t curr_cyl_high : 2, /* Cyl_High_[2] */
|
||||
mbz8 : 1, /* 0 */
|
||||
mbz9 : 1, /* 0 */
|
||||
curr_head : 4; /* HD_2[4] */
|
||||
uint8_t curr_cyl_low; /* Cyl_Low_2[8] */
|
||||
uint8_t curr_cyl_high : 2, /* Cyl_High_[2] */
|
||||
mbz8 : 1, /* 0 */
|
||||
mbz9 : 1, /* 0 */
|
||||
curr_head : 4; /* HD_2[4] */
|
||||
uint8_t curr_cyl_low; /* Cyl_Low_2[8] */
|
||||
|
||||
uint8_t sect_corr; /* sectors corrected */
|
||||
uint8_t sect_corr; /* sectors corrected */
|
||||
|
||||
uint8_t retries; /* retries */
|
||||
uint8_t retries; /* retries */
|
||||
|
||||
/*
|
||||
* This byte shows the progress of the controller through the
|
||||
@@ -235,7 +233,7 @@ typedef struct {
|
||||
* transfer:
|
||||
*
|
||||
* Bit 7 A sector was transferred between the system
|
||||
* and the sector buffer.
|
||||
* and the sector buffer.
|
||||
*
|
||||
* Bit 6 A sector was transferred between the controller
|
||||
* and the sector buffer.
|
||||
@@ -249,11 +247,11 @@ typedef struct {
|
||||
* 4. When the transfer is complete, the low nibble equals hex 4
|
||||
* and the high nibble is unchanged.
|
||||
*/
|
||||
uint8_t cmd_syndrome; /* command syndrome */
|
||||
uint8_t cmd_syndrome; /* command syndrome */
|
||||
|
||||
uint8_t drive_type; /* drive type */
|
||||
uint8_t drive_type; /* drive type */
|
||||
|
||||
uint8_t rsvd; /* reserved byte */
|
||||
uint8_t rsvd; /* reserved byte */
|
||||
} ssb_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
@@ -293,20 +291,20 @@ typedef struct {
|
||||
*/
|
||||
#pragma pack(push, 1)
|
||||
typedef struct {
|
||||
uint8_t cyl_high : 2, /* cylinder [9:8] bits */
|
||||
defective_sector : 1, /* DS */
|
||||
mbz1 : 1, /* 0 */
|
||||
head : 4; /* head number */
|
||||
uint8_t cyl_high : 2, /* cylinder [9:8] bits */
|
||||
defective_sector : 1, /* DS */
|
||||
mbz1 : 1, /* 0 */
|
||||
head : 4; /* head number */
|
||||
|
||||
uint8_t cyl_low; /* cylinder [7:0] bits */
|
||||
uint8_t cyl_low; /* cylinder [7:0] bits */
|
||||
|
||||
uint8_t sector; /* sector number */
|
||||
uint8_t sector; /* sector number */
|
||||
|
||||
uint8_t mbz2 : 1, /* 0 */
|
||||
mbo : 1, /* 1 */
|
||||
mbz3 : 6; /* 000000 */
|
||||
uint8_t mbz2 : 1, /* 0 */
|
||||
mbo : 1, /* 1 */
|
||||
mbz3 : 6; /* 000000 */
|
||||
|
||||
uint8_t fill; /* filler byte */
|
||||
uint8_t fill; /* filler byte */
|
||||
} fcb_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
@@ -319,25 +317,25 @@ typedef struct {
|
||||
*/
|
||||
#pragma pack(push, 1)
|
||||
typedef struct {
|
||||
uint8_t ec_p : 1, /* EC/P (ecc/park) */
|
||||
mbz1 : 1, /* 0 */
|
||||
auto_seek : 1, /* AS (auto-seek) */
|
||||
no_data : 1, /* ND (no data) */
|
||||
cmd : 4; /* command code[4] */
|
||||
uint8_t ec_p : 1, /* EC/P (ecc/park) */
|
||||
mbz1 : 1, /* 0 */
|
||||
auto_seek : 1, /* AS (auto-seek) */
|
||||
no_data : 1, /* ND (no data) */
|
||||
cmd : 4; /* command code[4] */
|
||||
|
||||
uint8_t cyl_high : 2, /* cylinder [9:8] bits */
|
||||
mbz2 : 2, /* 00 */
|
||||
head : 4; /* head number */
|
||||
uint8_t cyl_high : 2, /* cylinder [9:8] bits */
|
||||
mbz2 : 2, /* 00 */
|
||||
head : 4; /* head number */
|
||||
|
||||
uint8_t cyl_low; /* cylinder [7:0] bits */
|
||||
uint8_t cyl_low; /* cylinder [7:0] bits */
|
||||
|
||||
uint8_t sector; /* sector number */
|
||||
uint8_t sector; /* sector number */
|
||||
|
||||
uint8_t mbz3 : 1, /* 0 */
|
||||
mbo1 : 1, /* 1 */
|
||||
mbz4 : 6; /* 000000 */
|
||||
uint8_t mbz3 : 1, /* 0 */
|
||||
mbo1 : 1, /* 1 */
|
||||
mbz4 : 6; /* 000000 */
|
||||
|
||||
uint8_t count; /* blk count/interleave */
|
||||
uint8_t count; /* blk count/interleave */
|
||||
} ccb_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
@@ -417,51 +415,51 @@ typedef struct {
|
||||
*/
|
||||
static const geom_t ibm_type_table[] = {
|
||||
// clang-format off
|
||||
{ 0, 0, 0, 0, 0 }, /* 0 (none) */
|
||||
{ 306, 4, 17, 128, 305 }, /* 1 10 MB */
|
||||
{ 615, 4, 17, 300, 615 }, /* 2 20 MB */
|
||||
{ 615, 6, 17, 300, 615 }, /* 3 31 MB */
|
||||
{ 940, 8, 17, 512, 940 }, /* 4 62 MB */
|
||||
{ 940, 6, 17, 512, 940 }, /* 5 47 MB */
|
||||
{ 615, 4, 17, -1, 615 }, /* 6 20 MB */
|
||||
{ 462, 8, 17, 256, 511 }, /* 7 31 MB */
|
||||
{ 733, 5, 17, -1, 733 }, /* 8 30 MB */
|
||||
{ 900, 15, 17, -1, 901 }, /* 9 112 MB */
|
||||
{ 820, 3, 17, -1, 820 }, /* 10 20 MB */
|
||||
{ 855, 5, 17, -1, 855 }, /* 11 35 MB */
|
||||
{ 855, 7, 17, -1, 855 }, /* 12 50 MB */
|
||||
{ 306, 8, 17, 128, 319 }, /* 13 20 MB */
|
||||
{ 733, 7, 17, -1, 733 }, /* 14 43 MB */
|
||||
{ 0, 0, 0, 0, 0 }, /* 15 (rsvd) */
|
||||
{ 612, 4, 17, 0, 663 }, /* 16 20 MB */
|
||||
{ 977, 5, 17, 300, 977 }, /* 17 41 MB */
|
||||
{ 977, 7, 17, -1, 977 }, /* 18 57 MB */
|
||||
{ 1024, 7, 17, 512, 1023 }, /* 19 59 MB */
|
||||
{ 733, 5, 17, 300, 732 }, /* 20 30 MB */
|
||||
{ 733, 7, 17, 300, 732 }, /* 21 43 MB */
|
||||
{ 733, 5, 17, 300, 733 }, /* 22 30 MB */
|
||||
{ 306, 4, 17, 0, 336 }, /* 23 10 MB */
|
||||
{ 612, 4, 17, 305, 663 }, /* 24 20 MB */
|
||||
{ 306, 4, 17, -1, 340 }, /* 25 10 MB */
|
||||
{ 612, 4, 17, -1, 670 }, /* 26 20 MB */
|
||||
{ 698, 7, 17, 300, 732 }, /* 27 41 MB */
|
||||
{ 976, 5, 17, 488, 977 }, /* 28 40 MB */
|
||||
{ 306, 4, 17, 0, 340 }, /* 29 10 MB */
|
||||
{ 611, 4, 17, 306, 663 }, /* 30 20 MB */
|
||||
{ 732, 7, 17, 300, 732 }, /* 31 43 MB */
|
||||
{ 1023, 5, 17, -1, 1023 }, /* 32 42 MB */
|
||||
{ 614, 4, 25, -1, 663 }, /* 33 30 MB */
|
||||
{ 775, 2, 27, -1, 900 }, /* 34 20 MB */
|
||||
{ 921, 2, 33, -1, 1000 }, /* 35 30 MB * */
|
||||
{ 402, 4, 26, -1, 460 }, /* 36 20 MB */
|
||||
{ 580, 6, 26, -1, 640 }, /* 37 44 MB */
|
||||
{ 845, 2, 36, -1, 1023 }, /* 38 30 MB * */
|
||||
{ 769, 3, 36, -1, 1023 }, /* 39 41 MB * */
|
||||
{ 531, 4, 39, -1, 532 }, /* 40 40 MB */
|
||||
{ 577, 2, 36, -1, 1023 }, /* 41 20 MB */
|
||||
{ 654, 2, 32, -1, 674 }, /* 42 20 MB */
|
||||
{ 923, 5, 36, -1, 1023 }, /* 43 81 MB */
|
||||
{ 531, 8, 39, -1, 532 } /* 44 81 MB */
|
||||
{ 0, 0, 0, 0, 0 }, /* 0 (none) */
|
||||
{ 306, 4, 17, 128, 305 }, /* 1 10 MB */
|
||||
{ 615, 4, 17, 300, 615 }, /* 2 20 MB */
|
||||
{ 615, 6, 17, 300, 615 }, /* 3 31 MB */
|
||||
{ 940, 8, 17, 512, 940 }, /* 4 62 MB */
|
||||
{ 940, 6, 17, 512, 940 }, /* 5 47 MB */
|
||||
{ 615, 4, 17, -1, 615 }, /* 6 20 MB */
|
||||
{ 462, 8, 17, 256, 511 }, /* 7 31 MB */
|
||||
{ 733, 5, 17, -1, 733 }, /* 8 30 MB */
|
||||
{ 900, 15, 17, -1, 901 }, /* 9 112 MB */
|
||||
{ 820, 3, 17, -1, 820 }, /* 10 20 MB */
|
||||
{ 855, 5, 17, -1, 855 }, /* 11 35 MB */
|
||||
{ 855, 7, 17, -1, 855 }, /* 12 50 MB */
|
||||
{ 306, 8, 17, 128, 319 }, /* 13 20 MB */
|
||||
{ 733, 7, 17, -1, 733 }, /* 14 43 MB */
|
||||
{ 0, 0, 0, 0, 0 }, /* 15 (rsvd) */
|
||||
{ 612, 4, 17, 0, 663 }, /* 16 20 MB */
|
||||
{ 977, 5, 17, 300, 977 }, /* 17 41 MB */
|
||||
{ 977, 7, 17, -1, 977 }, /* 18 57 MB */
|
||||
{ 1024, 7, 17, 512, 1023 }, /* 19 59 MB */
|
||||
{ 733, 5, 17, 300, 732 }, /* 20 30 MB */
|
||||
{ 733, 7, 17, 300, 732 }, /* 21 43 MB */
|
||||
{ 733, 5, 17, 300, 733 }, /* 22 30 MB */
|
||||
{ 306, 4, 17, 0, 336 }, /* 23 10 MB */
|
||||
{ 612, 4, 17, 305, 663 }, /* 24 20 MB */
|
||||
{ 306, 4, 17, -1, 340 }, /* 25 10 MB */
|
||||
{ 612, 4, 17, -1, 670 }, /* 26 20 MB */
|
||||
{ 698, 7, 17, 300, 732 }, /* 27 41 MB */
|
||||
{ 976, 5, 17, 488, 977 }, /* 28 40 MB */
|
||||
{ 306, 4, 17, 0, 340 }, /* 29 10 MB */
|
||||
{ 611, 4, 17, 306, 663 }, /* 30 20 MB */
|
||||
{ 732, 7, 17, 300, 732 }, /* 31 43 MB */
|
||||
{ 1023, 5, 17, -1, 1023 }, /* 32 42 MB */
|
||||
{ 614, 4, 25, -1, 663 }, /* 33 30 MB */
|
||||
{ 775, 2, 27, -1, 900 }, /* 34 20 MB */
|
||||
{ 921, 2, 33, -1, 1000 }, /* 35 30 MB * */
|
||||
{ 402, 4, 26, -1, 460 }, /* 36 20 MB */
|
||||
{ 580, 6, 26, -1, 640 }, /* 37 44 MB */
|
||||
{ 845, 2, 36, -1, 1023 }, /* 38 30 MB * */
|
||||
{ 769, 3, 36, -1, 1023 }, /* 39 41 MB * */
|
||||
{ 531, 4, 39, -1, 532 }, /* 40 40 MB */
|
||||
{ 577, 2, 36, -1, 1023 }, /* 41 20 MB */
|
||||
{ 654, 2, 32, -1, 674 }, /* 42 20 MB */
|
||||
{ 923, 5, 36, -1, 1023 }, /* 43 81 MB */
|
||||
{ 531, 8, 39, -1, 532 } /* 44 81 MB */
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
@@ -663,7 +661,7 @@ do_format(hdc_t *dev, drive_t *drive, ccb_t *ccb)
|
||||
|
||||
/* Point to the FCB we got. */
|
||||
#if 0
|
||||
fcb = (fcb_t *)dev->data;
|
||||
fcb = (fcb_t *)dev->data;
|
||||
#endif
|
||||
dev->state = STATE_FINIT;
|
||||
/*FALLTHROUGH*/
|
||||
@@ -693,7 +691,7 @@ do_fmt:
|
||||
* use it's "filler byte" value...
|
||||
*/
|
||||
#if 0
|
||||
hdd_image_zero_ex(drive->hdd_num, addr, fcb->fill, drive->spt);
|
||||
hdd_image_zero_ex(drive->hdd_num, addr, fcb->fill, drive->spt);
|
||||
#else
|
||||
hdd_image_zero(drive->hdd_num, addr, drive->spt);
|
||||
#endif
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of MCA-based PS/2 machines.
|
||||
* Implementation of MCA-based PS/2 machines.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -875,6 +875,9 @@ vid_poll(void *priv)
|
||||
if (!dev->is_sl2 && vid->composite) {
|
||||
Composite_Process(vid->mode, 0, x >> 2, buffer32->line[(vid->displine << 1)]);
|
||||
Composite_Process(vid->mode, 0, x >> 2, buffer32->line[(vid->displine << 1) + 1]);
|
||||
} else {
|
||||
video_process_8(x, vid->displine << 1);
|
||||
video_process_8(x, (vid->displine << 1) + 1);
|
||||
}
|
||||
vid->sc = oldsc;
|
||||
if (vid->vc == vid->crtc[7] && !vid->sc)
|
||||
@@ -968,19 +971,11 @@ vid_poll(void *priv)
|
||||
}
|
||||
|
||||
if (enable_overscan) {
|
||||
if (!dev->is_sl2 && vid->composite)
|
||||
video_blit_memtoscreen(0, (vid->firstline - 4) << 1,
|
||||
xsize, ((vid->lastline - vid->firstline) + 8) << 1);
|
||||
else
|
||||
video_blit_memtoscreen_8(0, (vid->firstline - 4) << 1,
|
||||
xsize, ((vid->lastline - vid->firstline) + 8) << 1);
|
||||
video_blit_memtoscreen(0, (vid->firstline - 4) << 1,
|
||||
xsize, ((vid->lastline - vid->firstline) + 8) << 1);
|
||||
} else {
|
||||
if (!dev->is_sl2 && vid->composite)
|
||||
video_blit_memtoscreen(8, vid->firstline << 1,
|
||||
xsize, (vid->lastline - vid->firstline) << 1);
|
||||
else
|
||||
video_blit_memtoscreen_8(8, vid->firstline << 1,
|
||||
xsize, (vid->lastline - vid->firstline) << 1);
|
||||
video_blit_memtoscreen(8, vid->firstline << 1,
|
||||
xsize, (vid->lastline - vid->firstline) << 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -597,3 +597,19 @@ machine_xt_v20xt_init(const machine_t *model)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_pb8810_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/pb8810/pb8088-8810-633acc631aba0345517682.bin",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
*
|
||||
* Emulation of the Olivetti XT-compatible machines.
|
||||
*
|
||||
* - Supports MM58174 real-time clock emulation
|
||||
* - Supports MM58174 real-time clock emulation (M24)
|
||||
* - Supports MM58274 real-time clock emulation (M240)
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -90,6 +91,26 @@ enum MM58174_ADDR {
|
||||
MM58174_IRQ /* Interrupt register, read / write */
|
||||
};
|
||||
|
||||
enum MM58274_ADDR {
|
||||
/* Registers */
|
||||
MM58274_CONTROL, /* Control register */
|
||||
MM58274_TENTHS, /* Tenths of second, read only */
|
||||
MM58274_SECOND1,
|
||||
MM58274_SECOND10,
|
||||
MM58274_MINUTE1,
|
||||
MM58274_MINUTE10,
|
||||
MM58274_HOUR1,
|
||||
MM58274_HOUR10,
|
||||
MM58274_DAY1,
|
||||
MM58274_DAY10,
|
||||
MM58274_MONTH1,
|
||||
MM58274_MONTH10,
|
||||
MM58274_YEAR1,
|
||||
MM58274_YEAR10,
|
||||
MM58274_WEEKDAY,
|
||||
MM58274_SETTINGS /* Settings register */
|
||||
};
|
||||
|
||||
static struct tm intclk;
|
||||
|
||||
typedef struct {
|
||||
@@ -151,15 +172,15 @@ mm58174_time_set(uint8_t *regs, struct tm *tm)
|
||||
regs[MM58174_SECOND10] = (tm->tm_sec / 10);
|
||||
regs[MM58174_MINUTE1] = (tm->tm_min % 10);
|
||||
regs[MM58174_MINUTE10] = (tm->tm_min / 10);
|
||||
regs[MM58174_HOUR1] = (tm->tm_hour % 10);
|
||||
regs[MM58174_HOUR10] = (tm->tm_hour / 10);
|
||||
regs[MM58174_WEEKDAY] = (tm->tm_wday + 1);
|
||||
regs[MM58174_DAY1] = (tm->tm_mday % 10);
|
||||
regs[MM58174_DAY10] = (tm->tm_mday / 10);
|
||||
regs[MM58174_MONTH1] = ((tm->tm_mon + 1) % 10);
|
||||
regs[MM58174_MONTH10] = ((tm->tm_mon + 1) / 10);
|
||||
/* MM87174 does not store the year, M24 uses the IRQ register to count 8 years from leap year */
|
||||
regs[MM58174_IRQ] = ((tm->tm_year + 1900) % 8);
|
||||
regs[MM58174_HOUR1] = (tm->tm_hour % 10);
|
||||
regs[MM58174_HOUR10] = (tm->tm_hour / 10);
|
||||
regs[MM58174_WEEKDAY] = (tm->tm_wday + 1);
|
||||
regs[MM58174_DAY1] = (tm->tm_mday % 10);
|
||||
regs[MM58174_DAY10] = (tm->tm_mday / 10);
|
||||
regs[MM58174_MONTH1] = ((tm->tm_mon + 1) % 10);
|
||||
regs[MM58174_MONTH10] = ((tm->tm_mon + 1) / 10);
|
||||
/* MM58174 does not store the year, M24 uses the IRQ register to count 8 years from leap year */
|
||||
regs[MM58174_IRQ] = ((tm->tm_year + 1900) % 8);
|
||||
regs[MM58174_LEAPYEAR] = 8 >> ((regs[MM58174_IRQ] & 0x07) & 0x03);
|
||||
}
|
||||
|
||||
@@ -168,19 +189,19 @@ mm58174_time_set(uint8_t *regs, struct tm *tm)
|
||||
static void
|
||||
mm58174_time_get(uint8_t *regs, struct tm *tm)
|
||||
{
|
||||
tm->tm_sec = nibbles(MM58174_SECOND);
|
||||
tm->tm_min = nibbles(MM58174_MINUTE);
|
||||
tm->tm_sec = nibbles(MM58174_SECOND);
|
||||
tm->tm_min = nibbles(MM58174_MINUTE);
|
||||
tm->tm_hour = nibbles(MM58174_HOUR);
|
||||
tm->tm_wday = (regs[MM58174_WEEKDAY] - 1);
|
||||
tm->tm_mday = nibbles(MM58174_DAY);
|
||||
tm->tm_mon = (nibbles(MM58174_MONTH) - 1);
|
||||
/* MM87174AN does not store the year */
|
||||
/* MM58174 does not store the year */
|
||||
tm->tm_year = (1984 + (regs[MM58174_IRQ] & 0x07) - 1900);
|
||||
}
|
||||
|
||||
/* One more second has passed, update the internal clock. */
|
||||
static void
|
||||
mm58174_recalc()
|
||||
mm58x74_recalc()
|
||||
{
|
||||
/* Ping the internal clock. */
|
||||
if (++intclk.tm_sec == 60) {
|
||||
@@ -205,7 +226,7 @@ mm58174_recalc()
|
||||
static void
|
||||
mm58174_tick(nvr_t *nvr)
|
||||
{
|
||||
mm58174_recalc();
|
||||
mm58x74_recalc();
|
||||
mm58174_time_set(nvr->regs, &intclk);
|
||||
}
|
||||
|
||||
@@ -307,6 +328,157 @@ mm58174_init(nvr_t *nvr, int size)
|
||||
mm58174_read, NULL, NULL, mm58174_write, NULL, NULL, nvr);
|
||||
}
|
||||
|
||||
/* Set the chip time. */
|
||||
static void
|
||||
mm58274_time_set(uint8_t *regs, struct tm *tm)
|
||||
{
|
||||
regs[MM58274_SECOND1] = (tm->tm_sec % 10);
|
||||
regs[MM58274_SECOND10] = (tm->tm_sec / 10);
|
||||
regs[MM58274_MINUTE1] = (tm->tm_min % 10);
|
||||
regs[MM58274_MINUTE10] = (tm->tm_min / 10);
|
||||
regs[MM58274_HOUR1] = (tm->tm_hour % 10);
|
||||
regs[MM58274_HOUR10] = (tm->tm_hour / 10);
|
||||
/* Store hour in 24-hour or 12-hour mode */
|
||||
if (regs[MM58274_SETTINGS] & 0x01) {
|
||||
regs[MM58274_HOUR1] = (tm->tm_hour % 10);
|
||||
regs[MM58274_HOUR10] = (tm->tm_hour / 10);
|
||||
} else {
|
||||
regs[MM58274_HOUR1] = ((tm->tm_hour % 12) % 10);
|
||||
regs[MM58274_HOUR10] = (((tm->tm_hour % 12) / 10));
|
||||
if (tm->tm_hour >= 12)
|
||||
regs[MM58274_SETTINGS] |= 0x04;
|
||||
else
|
||||
regs[MM58274_SETTINGS] &= 0x0B;
|
||||
}
|
||||
regs[MM58274_WEEKDAY] = (tm->tm_wday + 1);
|
||||
regs[MM58274_DAY1] = (tm->tm_mday % 10);
|
||||
regs[MM58274_DAY10] = (tm->tm_mday / 10);
|
||||
regs[MM58274_MONTH1] = ((tm->tm_mon + 1) % 10);
|
||||
regs[MM58274_MONTH10] = ((tm->tm_mon + 1) / 10);
|
||||
/* MM58274 can store 00 to 99 years but M240 uses the YEAR1 register to count 8 years from leap year */
|
||||
regs[MM58274_YEAR1] = ((tm->tm_year + 1900) % 8);
|
||||
/* Keep bit 0 and 1 12-hour / 24-hour and AM / PM */
|
||||
regs[MM58274_SETTINGS] &= 0x03;
|
||||
/* Set leap counter bits 2 and 3 */
|
||||
regs[MM58274_SETTINGS] += (4* (regs[MM58274_YEAR1] & 0x03));
|
||||
}
|
||||
|
||||
/* Get the chip time. */
|
||||
static void
|
||||
mm58274_time_get(uint8_t *regs, struct tm *tm)
|
||||
{
|
||||
tm->tm_sec = nibbles(MM58274_SECOND);
|
||||
tm->tm_min = nibbles(MM58274_MINUTE);
|
||||
/* Read hour in 24-hour or 12-hour mode */
|
||||
if (regs[MM58274_SETTINGS] & 0x01)
|
||||
tm->tm_hour = nibbles(MM58274_HOUR);
|
||||
else
|
||||
tm->tm_hour = ((nibbles(MM58274_HOUR) % 12) + (regs[MM58274_SETTINGS] & 0x04) ? 12 : 0);
|
||||
tm->tm_wday = (regs[MM58274_WEEKDAY] - 1);
|
||||
tm->tm_mday = nibbles(MM58274_DAY);
|
||||
tm->tm_mon = (nibbles(MM58274_MONTH) - 1);
|
||||
/* MM58274 can store 00 to 99 years but M240 uses the YEAR1 register to count 8 years from leap year */
|
||||
tm->tm_year = (1984 + regs[MM58274_YEAR1] - 1900);
|
||||
}
|
||||
|
||||
/* This is called every second through the NVR/RTC hook. */
|
||||
static void
|
||||
mm58274_tick(nvr_t *nvr)
|
||||
{
|
||||
mm58x74_recalc();
|
||||
mm58274_time_set(nvr->regs, &intclk);
|
||||
}
|
||||
|
||||
static void
|
||||
mm58274_start(nvr_t *nvr)
|
||||
{
|
||||
struct tm tm;
|
||||
|
||||
/* Initialize the internal and chip times. */
|
||||
if (time_sync & TIME_SYNC_ENABLED) {
|
||||
/* Use the internal clock's time. */
|
||||
nvr_time_get(&tm);
|
||||
mm58274_time_set(nvr->regs, &tm);
|
||||
} else {
|
||||
/* Set the internal clock from the chip time. */
|
||||
mm58274_time_get(nvr->regs, &tm);
|
||||
nvr_time_set(&tm);
|
||||
}
|
||||
mm58274_time_get(nvr->regs, &intclk);
|
||||
}
|
||||
|
||||
/* Write to one of the chip registers. */
|
||||
static void
|
||||
mm58274_write(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
nvr_t *nvr = (nvr_t *) priv;
|
||||
|
||||
addr &= 0x0f;
|
||||
val &= 0x0f;
|
||||
|
||||
/* Update non-read-only changed values if not synchronizing time to host */
|
||||
if ((addr != MM58274_TENTHS))
|
||||
if ((nvr->regs[addr] != val) && !(time_sync & TIME_SYNC_ENABLED))
|
||||
nvr_dosave = 1;
|
||||
|
||||
if ((addr == MM58274_CONTROL) && (val & 0x04)) {
|
||||
/* When timer starts, MM58274 sets tenths of second to 0 */
|
||||
nvr->regs[MM58274_TENTHS] = 0;
|
||||
}
|
||||
|
||||
/* Store the new value */
|
||||
nvr->regs[addr] = val;
|
||||
|
||||
/* Update internal clock with MM58274 time */
|
||||
mm58274_time_get(nvr->regs, &intclk);
|
||||
}
|
||||
|
||||
/* Read from one of the chip registers. */
|
||||
static uint8_t
|
||||
mm58274_read(uint16_t addr, void *priv)
|
||||
{
|
||||
nvr_t *nvr = (nvr_t *) priv;
|
||||
|
||||
addr &= 0x0f;
|
||||
|
||||
/* Grab and return the desired value */
|
||||
return (nvr->regs[addr]);
|
||||
}
|
||||
|
||||
/* Reset the MM58274 to a default state. */
|
||||
static void
|
||||
mm58274_reset(nvr_t *nvr)
|
||||
{
|
||||
/* Clear the NVRAM. */
|
||||
memset(nvr->regs, 0xff, nvr->size);
|
||||
|
||||
/* Reset the RTC registers. */
|
||||
memset(nvr->regs, 0x00, 16);
|
||||
nvr->regs[MM58274_WEEKDAY] = 0x01;
|
||||
nvr->regs[MM58274_DAY1] = 0x01;
|
||||
nvr->regs[MM58274_MONTH1] = 0x01;
|
||||
nvr->regs[MM58274_SETTINGS] = 0x01;
|
||||
}
|
||||
|
||||
static void
|
||||
mm58274_init(nvr_t *nvr, int size)
|
||||
{
|
||||
/* This is machine specific. */
|
||||
nvr->size = size;
|
||||
nvr->irq = -1;
|
||||
|
||||
/* Set up any local handlers here. */
|
||||
nvr->reset = mm58274_reset;
|
||||
nvr->start = mm58274_start;
|
||||
nvr->tick = mm58274_tick;
|
||||
|
||||
/* Initialize the actual NVR. */
|
||||
nvr_init(nvr);
|
||||
|
||||
io_sethandler(0x0070, 16,
|
||||
mm58274_read, NULL, NULL, mm58274_write, NULL, NULL, nvr);
|
||||
}
|
||||
|
||||
static void
|
||||
m24_kbd_poll(void *priv)
|
||||
{
|
||||
@@ -975,6 +1147,7 @@ int
|
||||
machine_xt_m240_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
nvr_t *nvr;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/m240/olivetti_m240_pch6_2.04_low.bin",
|
||||
"roms/machines/m240/olivetti_m240_pch5_2.04_high.bin",
|
||||
@@ -999,9 +1172,6 @@ machine_xt_m240_init(const machine_t *model)
|
||||
device_add(&keyboard_at_olivetti_device);
|
||||
device_add(&port_6x_olivetti_device);
|
||||
|
||||
/* FIXME: make sure this is correct?? */
|
||||
device_add(&at_nvr_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
@@ -1010,6 +1180,14 @@ machine_xt_m240_init(const machine_t *model)
|
||||
|
||||
nmi_init();
|
||||
|
||||
/* Allocate an NVR for this machine. */
|
||||
nvr = (nvr_t *) malloc(sizeof(nvr_t));
|
||||
if (nvr == NULL)
|
||||
return (0);
|
||||
memset(nvr, 0x00, sizeof(nvr_t));
|
||||
|
||||
mm58274_init(nvr, model->nvrmask + 1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,65 +1,65 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of the Toshiba T1000 and T1200 portables.
|
||||
* Implementation of the Toshiba T1000 and T1200 portables.
|
||||
*
|
||||
* The T1000 is the T3100e's little brother -- a real laptop
|
||||
* with a rechargeable battery.
|
||||
* The T1000 is the T3100e's little brother -- a real laptop
|
||||
* with a rechargeable battery.
|
||||
*
|
||||
* Features: 80C88 at 4.77MHz
|
||||
* - 512k system RAM
|
||||
* - 640x200 monochrome LCD
|
||||
* - 82-key keyboard
|
||||
* - Real-time clock. Not the normal 146818, but a TC8521,
|
||||
* which is a 4-bit chip.
|
||||
* - A ROM drive (128k, 256k or 512k) which acts as a mini
|
||||
* hard drive and contains a copy of DOS 2.11.
|
||||
* - 160 bytes of non-volatile RAM for the CONFIG.SYS used
|
||||
* when booting from the ROM drive. Possibly physically
|
||||
* located in the keyboard controller RAM.
|
||||
* Features: 80C88 at 4.77MHz
|
||||
* - 512k system RAM
|
||||
* - 640x200 monochrome LCD
|
||||
* - 82-key keyboard
|
||||
* - Real-time clock. Not the normal 146818, but a TC8521,
|
||||
* which is a 4-bit chip.
|
||||
* - A ROM drive (128k, 256k or 512k) which acts as a mini
|
||||
* hard drive and contains a copy of DOS 2.11.
|
||||
* - 160 bytes of non-volatile RAM for the CONFIG.SYS used
|
||||
* when booting from the ROM drive. Possibly physically
|
||||
* located in the keyboard controller RAM.
|
||||
*
|
||||
* An optional memory expansion board can be fitted. This adds
|
||||
* 768k of RAM, which can be used for up to three purposes:
|
||||
* > Conventional memory -- 128k between 512k and 640k
|
||||
* > HardRAM -- a battery-backed RAM drive.
|
||||
* > EMS
|
||||
* An optional memory expansion board can be fitted. This adds
|
||||
* 768k of RAM, which can be used for up to three purposes:
|
||||
* > Conventional memory -- 128k between 512k and 640k
|
||||
* > HardRAM -- a battery-backed RAM drive.
|
||||
* > EMS
|
||||
*
|
||||
* This means that there are up to three different
|
||||
* implementations of non-volatile RAM in the same computer
|
||||
* (52 nibbles in the TC8521, 160 bytes of CONFIG.SYS, and
|
||||
* up to 768k of HardRAM).
|
||||
* This means that there are up to three different
|
||||
* implementations of non-volatile RAM in the same computer
|
||||
* (52 nibbles in the TC8521, 160 bytes of CONFIG.SYS, and
|
||||
* up to 768k of HardRAM).
|
||||
*
|
||||
* The T1200 is a slightly upgraded version with a turbo mode
|
||||
* (double CPU clock, 9.54MHz) and an optional hard drive.
|
||||
* The interface for this is proprietary both at the physical
|
||||
* and programming level.
|
||||
* The T1200 is a slightly upgraded version with a turbo mode
|
||||
* (double CPU clock, 9.54MHz) and an optional hard drive.
|
||||
* The interface for this is proprietary both at the physical
|
||||
* and programming level.
|
||||
*
|
||||
* 01F2h: If hard drive is present, low 4 bits are 0Ch [20Mb]
|
||||
* or 0Dh [10Mb].
|
||||
* 01F2h: If hard drive is present, low 4 bits are 0Ch [20Mb]
|
||||
* or 0Dh [10Mb].
|
||||
*
|
||||
* The hard drive is a 20MB (615/2/26) RLL 3.5" drive.
|
||||
* The hard drive is a 20MB (615/2/26) RLL 3.5" drive.
|
||||
*
|
||||
* The TC8521 is a 4-bit RTC, so each memory location can only
|
||||
* hold a single BCD digit. Hence everything has 'ones' and
|
||||
* 'tens' digits.
|
||||
* The TC8521 is a 4-bit RTC, so each memory location can only
|
||||
* hold a single BCD digit. Hence everything has 'ones' and
|
||||
* 'tens' digits.
|
||||
*
|
||||
* NOTE: Still need to figure out a way to load/save ConfigSys and
|
||||
* HardRAM stuff. Needs to be linked in to the NVR code.
|
||||
* NOTE: Still need to figure out a way to load/save ConfigSys and
|
||||
* HardRAM stuff. Needs to be linked in to the NVR code.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2018,2019 Fred N. van Kempen.
|
||||
* Copyright 2018,2019 Miran Grca.
|
||||
* Copyright 2018,2019 Sarah Walker.
|
||||
* Copyright 2018,2019 Fred N. van Kempen.
|
||||
* Copyright 2018,2019 Miran Grca.
|
||||
* Copyright 2018,2019 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -888,7 +888,7 @@ machine_xt_t1000_init(const machine_t *model)
|
||||
machine_common_init(model);
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
device_add(&keyboard_xt_device);
|
||||
device_add(&keyboard_xt_t1x00_device);
|
||||
t1000.fdc = device_add(&fdc_xt_device);
|
||||
nmi_init();
|
||||
|
||||
@@ -948,7 +948,7 @@ machine_xt_t1200_init(const machine_t *model)
|
||||
NULL, MEM_MAPPING_EXTERNAL, &t1000);
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
device_add(&keyboard_xt_device);
|
||||
device_add(&keyboard_xt_t1x00_device);
|
||||
t1000.fdc = device_add(&fdc_xt_t1x00_device);
|
||||
nmi_init();
|
||||
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of the Toshiba T1000 plasma display, which
|
||||
* has a fixed resolution of 640x200 pixels.
|
||||
* Implementation of the Toshiba T1000 plasma display, which
|
||||
* has a fixed resolution of 640x200 pixels.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2018,2019 Fred N. van Kempen.
|
||||
* Copyright 2018,2019 Miran Grca.
|
||||
* Copyright 2018,2019 Sarah Walker.
|
||||
* Copyright 2018,2019 Fred N. van Kempen.
|
||||
* Copyright 2018,2019 Miran Grca.
|
||||
* Copyright 2018,2019 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -546,9 +546,9 @@ t1000_recalcattrs(t1000_t *t1000)
|
||||
* Bit 0: Attributes 01-06, 08-0E are inverse video
|
||||
* Bit 1: Attributes 01-06, 08-0E are bold
|
||||
* Bit 2: Attributes 11-16, 18-1F, 21-26, 28-2F ... F1-F6, F8-FF
|
||||
* are inverse video
|
||||
* are inverse video
|
||||
* Bit 3: Attributes 11-16, 18-1F, 21-26, 28-2F ... F1-F6, F8-FF
|
||||
* are bold */
|
||||
* are bold */
|
||||
|
||||
/* Set up colours */
|
||||
if (t1000->invert) {
|
||||
|
||||
@@ -1031,6 +1031,42 @@ const machine_t machines[] = {
|
||||
.snd_device = NULL,
|
||||
.net_device = NULL
|
||||
},
|
||||
{
|
||||
.name = "[8088] Packard Bell PB8810",
|
||||
.internal_name = "pb8810",
|
||||
.type = MACHINE_TYPE_8088,
|
||||
.chipset = MACHINE_CHIPSET_DISCRETE,
|
||||
.init = machine_xt_pb8810_init,
|
||||
.pad = 0,
|
||||
.pad0 = 0,
|
||||
.pad1 = MACHINE_AVAILABLE,
|
||||
.pad2 = 0,
|
||||
.cpu = {
|
||||
.package = CPU_PKG_8088,
|
||||
.block = CPU_BLOCK_NONE,
|
||||
.min_bus = 0,
|
||||
.max_bus = 0,
|
||||
.min_voltage = 0,
|
||||
.max_voltage = 0,
|
||||
.min_multi = 0,
|
||||
.max_multi = 0
|
||||
},
|
||||
.bus_flags = MACHINE_PC,
|
||||
.flags = MACHINE_FLAGS_NONE,
|
||||
.ram = {
|
||||
.min = 256,
|
||||
.max = 640,
|
||||
.step = 256
|
||||
},
|
||||
.nvrmask = 0,
|
||||
.kbc = KBC_IBM_PC_XT,
|
||||
.kbc_p1 = 0xff00,
|
||||
.gpio = 0xffffffff,
|
||||
.device = NULL,
|
||||
.vid_device = NULL,
|
||||
.snd_device = NULL,
|
||||
.net_device = NULL
|
||||
},
|
||||
{
|
||||
.name = "[8088] Philips P3105/NMS9100",
|
||||
.internal_name = "p3105",
|
||||
@@ -1999,7 +2035,7 @@ const machine_t machines[] = {
|
||||
.max = 640,
|
||||
.step = 128
|
||||
},
|
||||
.nvrmask = 0,
|
||||
.nvrmask = 15,
|
||||
.kbc = KBC_OLIVETTI_XT,
|
||||
.kbc_p1 = 0xff00,
|
||||
.gpio = 0xffffffff,
|
||||
@@ -2036,7 +2072,7 @@ const machine_t machines[] = {
|
||||
.max = 640,
|
||||
.step = 128
|
||||
},
|
||||
.nvrmask = 0,
|
||||
.nvrmask = 15,
|
||||
.kbc = KBC_OLIVETTI,
|
||||
.kbc_p1 = 0xff04,
|
||||
.gpio = 0xffffffff,
|
||||
|
||||
@@ -302,7 +302,7 @@ mmutranslatereal_normal(uint32_t addr, int rw)
|
||||
|
||||
if ((temp & 0x80) && (cr4 & CR4_PSE)) {
|
||||
/*4MB page*/
|
||||
if (((CPL == 3) && !(temp & 4) && !cpl_override) || (rw && !(temp & 2) && (((CPL == 3) && !cpl_override) || (is486 && (cr0 & WP_FLAG))))) {
|
||||
if (((CPL == 3) && !(temp & 4) && !cpl_override) || (rw && !(temp & 2) && (((CPL == 3) && !cpl_override) || ((is486 || isibm486) && (cr0 & WP_FLAG))))) {
|
||||
cr2 = addr;
|
||||
temp &= 1;
|
||||
if (CPL == 3)
|
||||
@@ -323,7 +323,7 @@ mmutranslatereal_normal(uint32_t addr, int rw)
|
||||
|
||||
temp = rammap((temp & ~0xfff) + ((addr >> 10) & 0xffc));
|
||||
temp3 = temp & temp2;
|
||||
if (!(temp & 1) || ((CPL == 3) && !(temp3 & 4) && !cpl_override) || (rw && !(temp3 & 2) && (((CPL == 3) && !cpl_override) || (is486 && (cr0 & WP_FLAG))))) {
|
||||
if (!(temp & 1) || ((CPL == 3) && !(temp3 & 4) && !cpl_override) || (rw && !(temp3 & 2) && (((CPL == 3) && !cpl_override) || ((is486 || isibm486) && (cr0 & WP_FLAG))))) {
|
||||
cr2 = addr;
|
||||
temp &= 1;
|
||||
if (CPL == 3)
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of the following network controllers:
|
||||
* - Novell NE1000 (ISA 8-bit);
|
||||
* - Novell NE2000 (ISA 16-bit);
|
||||
* - Novell NE/2 compatible (NetWorth Inc. Ethernext/MC) (MCA 16-bit);
|
||||
* - Realtek RTL8019AS (ISA 16-bit, PnP);
|
||||
* - Realtek RTL8029AS (PCI).
|
||||
* Implementation of the following network controllers:
|
||||
* - Novell NE1000 (ISA 8-bit);
|
||||
* - Novell NE2000 (ISA 16-bit);
|
||||
* - Novell NE/2 compatible (NetWorth Inc. Ethernext/MC) (MCA 16-bit);
|
||||
* - Realtek RTL8019AS (ISA 16-bit, PnP);
|
||||
* - Realtek RTL8029AS (PCI).
|
||||
*
|
||||
*
|
||||
*
|
||||
* Based on @(#)ne2k.cc v1.56.2.1 2004/02/02 22:37:22 cbothamy
|
||||
* Based on @(#)ne2k.cc v1.56.2.1 2004/02/02 22:37:22 cbothamy
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* TheCollector1995, <mariogplayer@gmail.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Peter Grehan, <grehan@iprg.nokia.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* TheCollector1995, <mariogplayer@gmail.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Peter Grehan, <grehan@iprg.nokia.com>
|
||||
*
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Portions Copyright (C) 2002 MandrakeSoft S.A.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Portions Copyright (C) 2002 MandrakeSoft S.A.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,36 +1,34 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
*
|
||||
* Handle WinPcap library processing.
|
||||
* Handle WinPcap library processing.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
@@ -1,40 +1,38 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* Implementation of the network module.
|
||||
*
|
||||
* Implementation of the network module.
|
||||
*
|
||||
* NOTE The definition of the netcard_t is currently not optimal;
|
||||
* it should be malloc'ed and then linked to the NETCARD def.
|
||||
* Will be done later.
|
||||
* NOTE The definition of the netcard_t is currently not optimal;
|
||||
* it should be malloc'ed and then linked to the NETCARD def.
|
||||
* Will be done later.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
@@ -1,38 +1,36 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* Simple program to show usage of (Win)Pcap.
|
||||
*
|
||||
* Simple program to show usage of (Win)Pcap.
|
||||
*
|
||||
* Based on the "libpcap" examples.
|
||||
* Based on the "libpcap" examples.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
48
src/nvr.c
48
src/nvr.c
@@ -1,38 +1,36 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
*
|
||||
* Implement a generic NVRAM/CMOS/RTC device.
|
||||
* Implement a generic NVRAM/CMOS/RTC device.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>,
|
||||
* David Hrdlička, <hrdlickadavid@outlook.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>,
|
||||
* David Hrdlička, <hrdlickadavid@outlook.com>
|
||||
*
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2018,2019 David Hrdlička.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2018,2019 David Hrdlička.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
340
src/nvr_at.c
340
src/nvr_at.c
@@ -1,204 +1,204 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implement a more-or-less defacto-standard RTC/NVRAM.
|
||||
* Implement a more-or-less defacto-standard RTC/NVRAM.
|
||||
*
|
||||
* When IBM released the PC/AT machine, it came standard with a
|
||||
* battery-backed RTC chip to keep the time of day, something
|
||||
* that was optional on standard PC's with a myriad variants
|
||||
* being put on the market, often on cheap multi-I/O cards.
|
||||
* When IBM released the PC/AT machine, it came standard with a
|
||||
* battery-backed RTC chip to keep the time of day, something
|
||||
* that was optional on standard PC's with a myriad variants
|
||||
* being put on the market, often on cheap multi-I/O cards.
|
||||
*
|
||||
* The PC/AT had an on-board DS12885-series chip ("the black
|
||||
* block") which was an RTC/clock chip with onboard oscillator
|
||||
* and a backup battery (hence the big size.) The chip also had
|
||||
* a small amount of RAM bytes available to the user, which was
|
||||
* used by IBM's ROM BIOS to store machine configuration data.
|
||||
* Later versions and clones used the 12886 and/or 1288(C)7
|
||||
* series, or the MC146818 series, all with an external battery.
|
||||
* Many of those batteries would create corrosion issues later
|
||||
* on in mainboard life...
|
||||
* The PC/AT had an on-board DS12885-series chip ("the black
|
||||
* block") which was an RTC/clock chip with onboard oscillator
|
||||
* and a backup battery (hence the big size.) The chip also had
|
||||
* a small amount of RAM bytes available to the user, which was
|
||||
* used by IBM's ROM BIOS to store machine configuration data.
|
||||
* Later versions and clones used the 12886 and/or 1288(C)7
|
||||
* series, or the MC146818 series, all with an external battery.
|
||||
* Many of those batteries would create corrosion issues later
|
||||
* on in mainboard life...
|
||||
*
|
||||
* Since then, pretty much any PC has an implementation of that
|
||||
* device, which became known as the "nvr" or "cmos".
|
||||
* Since then, pretty much any PC has an implementation of that
|
||||
* device, which became known as the "nvr" or "cmos".
|
||||
*
|
||||
* NOTES Info extracted from the data sheets:
|
||||
* NOTES Info extracted from the data sheets:
|
||||
*
|
||||
* * The century register at location 32h is a BCD register
|
||||
* designed to automatically load the BCD value 20 as the
|
||||
* year register changes from 99 to 00. The MSB of this
|
||||
* register is not affected when the load of 20 occurs,
|
||||
* and remains at the value written by the user.
|
||||
* * The century register at location 32h is a BCD register
|
||||
* designed to automatically load the BCD value 20 as the
|
||||
* year register changes from 99 to 00. The MSB of this
|
||||
* register is not affected when the load of 20 occurs,
|
||||
* and remains at the value written by the user.
|
||||
*
|
||||
* * Rate Selector (RS3:RS0)
|
||||
* These four rate-selection bits select one of the 13
|
||||
* taps on the 15-stage divider or disable the divider
|
||||
* output. The tap selected can be used to generate an
|
||||
* output square wave (SQW pin) and/or a periodic interrupt.
|
||||
* * Rate Selector (RS3:RS0)
|
||||
* These four rate-selection bits select one of the 13
|
||||
* taps on the 15-stage divider or disable the divider
|
||||
* output. The tap selected can be used to generate an
|
||||
* output square wave (SQW pin) and/or a periodic interrupt.
|
||||
*
|
||||
* The user can do one of the following:
|
||||
* - enable the interrupt with the PIE bit;
|
||||
* - enable the SQW output pin with the SQWE bit;
|
||||
* - enable both at the same time and the same rate; or
|
||||
* - enable neither.
|
||||
* The user can do one of the following:
|
||||
* - enable the interrupt with the PIE bit;
|
||||
* - enable the SQW output pin with the SQWE bit;
|
||||
* - enable both at the same time and the same rate; or
|
||||
* - enable neither.
|
||||
*
|
||||
* Table 3 lists the periodic interrupt rates and the square
|
||||
* wave frequencies that can be chosen with the RS bits.
|
||||
* These four read/write bits are not affected by !RESET.
|
||||
* Table 3 lists the periodic interrupt rates and the square
|
||||
* wave frequencies that can be chosen with the RS bits.
|
||||
* These four read/write bits are not affected by !RESET.
|
||||
*
|
||||
* * Oscillator (DV2:DV0)
|
||||
* These three bits are used to turn the oscillator on or
|
||||
* off and to reset the countdown chain. A pattern of 010
|
||||
* is the only combination of bits that turn the oscillator
|
||||
* on and allow the RTC to keep time. A pattern of 11x
|
||||
* enables the oscillator but holds the countdown chain in
|
||||
* reset. The next update occurs at 500ms after a pattern
|
||||
* of 010 is written to DV0, DV1, and DV2.
|
||||
* * Oscillator (DV2:DV0)
|
||||
* These three bits are used to turn the oscillator on or
|
||||
* off and to reset the countdown chain. A pattern of 010
|
||||
* is the only combination of bits that turn the oscillator
|
||||
* on and allow the RTC to keep time. A pattern of 11x
|
||||
* enables the oscillator but holds the countdown chain in
|
||||
* reset. The next update occurs at 500ms after a pattern
|
||||
* of 010 is written to DV0, DV1, and DV2.
|
||||
*
|
||||
* * Update-In-Progress (UIP)
|
||||
* This bit is a status flag that can be monitored. When the
|
||||
* UIP bit is a 1, the update transfer occurs soon. When
|
||||
* UIP is a 0, the update transfer does not occur for at
|
||||
* least 244us. The time, calendar, and alarm information
|
||||
* in RAM is fully available for access when the UIP bit
|
||||
* is 0. The UIP bit is read-only and is not affected by
|
||||
* !RESET. Writing the SET bit in Register B to a 1
|
||||
* inhibits any update transfer and clears the UIP status bit.
|
||||
* * Update-In-Progress (UIP)
|
||||
* This bit is a status flag that can be monitored. When the
|
||||
* UIP bit is a 1, the update transfer occurs soon. When
|
||||
* UIP is a 0, the update transfer does not occur for at
|
||||
* least 244us. The time, calendar, and alarm information
|
||||
* in RAM is fully available for access when the UIP bit
|
||||
* is 0. The UIP bit is read-only and is not affected by
|
||||
* !RESET. Writing the SET bit in Register B to a 1
|
||||
* inhibits any update transfer and clears the UIP status bit.
|
||||
*
|
||||
* * Daylight Saving Enable (DSE)
|
||||
* This bit is a read/write bit that enables two daylight
|
||||
* saving adjustments when DSE is set to 1. On the first
|
||||
* Sunday in April (or the last Sunday in April in the
|
||||
* MC146818A), the time increments from 1:59:59 AM to
|
||||
* 3:00:00 AM. On the last Sunday in October when the time
|
||||
* first reaches 1:59:59 AM, it changes to 1:00:00 AM.
|
||||
* * Daylight Saving Enable (DSE)
|
||||
* This bit is a read/write bit that enables two daylight
|
||||
* saving adjustments when DSE is set to 1. On the first
|
||||
* Sunday in April (or the last Sunday in April in the
|
||||
* MC146818A), the time increments from 1:59:59 AM to
|
||||
* 3:00:00 AM. On the last Sunday in October when the time
|
||||
* first reaches 1:59:59 AM, it changes to 1:00:00 AM.
|
||||
*
|
||||
* When DSE is enabled, the internal logic test for the
|
||||
* first/last Sunday condition at midnight. If the DSE bit
|
||||
* is not set when the test occurs, the daylight saving
|
||||
* function does not operate correctly. These adjustments
|
||||
* do not occur when the DSE bit is 0. This bit is not
|
||||
* affected by internal functions or !RESET.
|
||||
* When DSE is enabled, the internal logic test for the
|
||||
* first/last Sunday condition at midnight. If the DSE bit
|
||||
* is not set when the test occurs, the daylight saving
|
||||
* function does not operate correctly. These adjustments
|
||||
* do not occur when the DSE bit is 0. This bit is not
|
||||
* affected by internal functions or !RESET.
|
||||
*
|
||||
* * 24/12
|
||||
* The 24/12 control bit establishes the format of the hours
|
||||
* byte. A 1 indicates the 24-hour mode and a 0 indicates
|
||||
* the 12-hour mode. This bit is read/write and is not
|
||||
* affected by internal functions or !RESET.
|
||||
* * 24/12
|
||||
* The 24/12 control bit establishes the format of the hours
|
||||
* byte. A 1 indicates the 24-hour mode and a 0 indicates
|
||||
* the 12-hour mode. This bit is read/write and is not
|
||||
* affected by internal functions or !RESET.
|
||||
*
|
||||
* * Data Mode (DM)
|
||||
* This bit indicates whether time and calendar information
|
||||
* is in binary or BCD format. The DM bit is set by the
|
||||
* program to the appropriate format and can be read as
|
||||
* required. This bit is not modified by internal functions
|
||||
* or !RESET. A 1 in DM signifies binary data, while a 0 in
|
||||
* DM specifies BCD data.
|
||||
* * Data Mode (DM)
|
||||
* This bit indicates whether time and calendar information
|
||||
* is in binary or BCD format. The DM bit is set by the
|
||||
* program to the appropriate format and can be read as
|
||||
* required. This bit is not modified by internal functions
|
||||
* or !RESET. A 1 in DM signifies binary data, while a 0 in
|
||||
* DM specifies BCD data.
|
||||
*
|
||||
* * Square-Wave Enable (SQWE)
|
||||
* When this bit is set to 1, a square-wave signal at the
|
||||
* frequency set by the rate-selection bits RS3-RS0 is driven
|
||||
* out on the SQW pin. When the SQWE bit is set to 0, the
|
||||
* SQW pin is held low. SQWE is a read/write bit and is
|
||||
* cleared by !RESET. SQWE is low if disabled, and is high
|
||||
* impedance when VCC is below VPF. SQWE is cleared to 0 on
|
||||
* !RESET.
|
||||
* * Square-Wave Enable (SQWE)
|
||||
* When this bit is set to 1, a square-wave signal at the
|
||||
* frequency set by the rate-selection bits RS3-RS0 is driven
|
||||
* out on the SQW pin. When the SQWE bit is set to 0, the
|
||||
* SQW pin is held low. SQWE is a read/write bit and is
|
||||
* cleared by !RESET. SQWE is low if disabled, and is high
|
||||
* impedance when VCC is below VPF. SQWE is cleared to 0 on
|
||||
* !RESET.
|
||||
*
|
||||
* * Update-Ended Interrupt Enable (UIE)
|
||||
* This bit is a read/write bit that enables the update-end
|
||||
* flag (UF) bit in Register C to assert !IRQ. The !RESET
|
||||
* pin going low or the SET bit going high clears the UIE bit.
|
||||
* The internal functions of the device do not affect the UIE
|
||||
* bit, but is cleared to 0 on !RESET.
|
||||
* * Update-Ended Interrupt Enable (UIE)
|
||||
* This bit is a read/write bit that enables the update-end
|
||||
* flag (UF) bit in Register C to assert !IRQ. The !RESET
|
||||
* pin going low or the SET bit going high clears the UIE bit.
|
||||
* The internal functions of the device do not affect the UIE
|
||||
* bit, but is cleared to 0 on !RESET.
|
||||
*
|
||||
* * Alarm Interrupt Enable (AIE)
|
||||
* This bit is a read/write bit that, when set to 1, permits
|
||||
* the alarm flag (AF) bit in Register C to assert !IRQ. An
|
||||
* alarm interrupt occurs for each second that the three time
|
||||
* bytes equal the three alarm bytes, including a don't-care
|
||||
* alarm code of binary 11XXXXXX. The AF bit does not
|
||||
* initiate the !IRQ signal when the AIE bit is set to 0.
|
||||
* The internal functions of the device do not affect the AIE
|
||||
* bit, but is cleared to 0 on !RESET.
|
||||
* * Alarm Interrupt Enable (AIE)
|
||||
* This bit is a read/write bit that, when set to 1, permits
|
||||
* the alarm flag (AF) bit in Register C to assert !IRQ. An
|
||||
* alarm interrupt occurs for each second that the three time
|
||||
* bytes equal the three alarm bytes, including a don't-care
|
||||
* alarm code of binary 11XXXXXX. The AF bit does not
|
||||
* initiate the !IRQ signal when the AIE bit is set to 0.
|
||||
* The internal functions of the device do not affect the AIE
|
||||
* bit, but is cleared to 0 on !RESET.
|
||||
*
|
||||
* * Periodic Interrupt Enable (PIE)
|
||||
* The PIE bit is a read/write bit that allows the periodic
|
||||
* interrupt flag (PF) bit in Register C to drive the !IRQ pin
|
||||
* low. When the PIE bit is set to 1, periodic interrupts are
|
||||
* generated by driving the !IRQ pin low at a rate specified
|
||||
* by the RS3-RS0 bits of Register A. A 0 in the PIE bit
|
||||
* blocks the !IRQ output from being driven by a periodic
|
||||
* interrupt, but the PF bit is still set at the periodic
|
||||
* rate. PIE is not modified b any internal device functions,
|
||||
* but is cleared to 0 on !RESET.
|
||||
* * Periodic Interrupt Enable (PIE)
|
||||
* The PIE bit is a read/write bit that allows the periodic
|
||||
* interrupt flag (PF) bit in Register C to drive the !IRQ pin
|
||||
* low. When the PIE bit is set to 1, periodic interrupts are
|
||||
* generated by driving the !IRQ pin low at a rate specified
|
||||
* by the RS3-RS0 bits of Register A. A 0 in the PIE bit
|
||||
* blocks the !IRQ output from being driven by a periodic
|
||||
* interrupt, but the PF bit is still set at the periodic
|
||||
* rate. PIE is not modified b any internal device functions,
|
||||
* but is cleared to 0 on !RESET.
|
||||
*
|
||||
* * SET
|
||||
* When the SET bit is 0, the update transfer functions
|
||||
* normally by advancing the counts once per second. When
|
||||
* the SET bit is written to 1, any update transfer is
|
||||
* inhibited, and the program can initialize the time and
|
||||
* calendar bytes without an update occurring in the midst of
|
||||
* initializing. Read cycles can be executed in a similar
|
||||
* manner. SET is a read/write bit and is not affected by
|
||||
* !RESET or internal functions of the device.
|
||||
* * SET
|
||||
* When the SET bit is 0, the update transfer functions
|
||||
* normally by advancing the counts once per second. When
|
||||
* the SET bit is written to 1, any update transfer is
|
||||
* inhibited, and the program can initialize the time and
|
||||
* calendar bytes without an update occurring in the midst of
|
||||
* initializing. Read cycles can be executed in a similar
|
||||
* manner. SET is a read/write bit and is not affected by
|
||||
* !RESET or internal functions of the device.
|
||||
*
|
||||
* * Update-Ended Interrupt Flag (UF)
|
||||
* This bit is set after each update cycle. When the UIE
|
||||
* bit is set to 1, the 1 in UF causes the IRQF bit to be
|
||||
* a 1, which asserts the !IRQ pin. This bit can be
|
||||
* cleared by reading Register C or with a !RESET.
|
||||
* * Update-Ended Interrupt Flag (UF)
|
||||
* This bit is set after each update cycle. When the UIE
|
||||
* bit is set to 1, the 1 in UF causes the IRQF bit to be
|
||||
* a 1, which asserts the !IRQ pin. This bit can be
|
||||
* cleared by reading Register C or with a !RESET.
|
||||
*
|
||||
* * Alarm Interrupt Flag (AF)
|
||||
* A 1 in the AF bit indicates that the current time has
|
||||
* matched the alarm time. If the AIE bit is also 1, the
|
||||
* !IRQ pin goes low and a 1 appears in the IRQF bit. This
|
||||
* bit can be cleared by reading Register C or with a
|
||||
* !RESET.
|
||||
* * Alarm Interrupt Flag (AF)
|
||||
* A 1 in the AF bit indicates that the current time has
|
||||
* matched the alarm time. If the AIE bit is also 1, the
|
||||
* !IRQ pin goes low and a 1 appears in the IRQF bit. This
|
||||
* bit can be cleared by reading Register C or with a
|
||||
* !RESET.
|
||||
*
|
||||
* * Periodic Interrupt Flag (PF)
|
||||
* This bit is read-only and is set to 1 when an edge is
|
||||
* detected on the selected tap of the divider chain. The
|
||||
* RS3 through RS0 bits establish the periodic rate. PF is
|
||||
* set to 1 independent of the state of the PIE bit. When
|
||||
* both PF and PIE are 1s, the !IRQ signal is active and
|
||||
* sets the IRQF bit. This bit can be cleared by reading
|
||||
* Register C or with a !RESET.
|
||||
* * Periodic Interrupt Flag (PF)
|
||||
* This bit is read-only and is set to 1 when an edge is
|
||||
* detected on the selected tap of the divider chain. The
|
||||
* RS3 through RS0 bits establish the periodic rate. PF is
|
||||
* set to 1 independent of the state of the PIE bit. When
|
||||
* both PF and PIE are 1s, the !IRQ signal is active and
|
||||
* sets the IRQF bit. This bit can be cleared by reading
|
||||
* Register C or with a !RESET.
|
||||
*
|
||||
* * Interrupt Request Flag (IRQF)
|
||||
* The interrupt request flag (IRQF) is set to a 1 when one
|
||||
* or more of the following are true:
|
||||
* - PF == PIE == 1
|
||||
* - AF == AIE == 1
|
||||
* - UF == UIE == 1
|
||||
* Any time the IRQF bit is a 1, the !IRQ pin is driven low.
|
||||
* All flag bits are cleared after Register C is read by the
|
||||
* program or when the !RESET pin is low.
|
||||
* * Interrupt Request Flag (IRQF)
|
||||
* The interrupt request flag (IRQF) is set to a 1 when one
|
||||
* or more of the following are true:
|
||||
* - PF == PIE == 1
|
||||
* - AF == AIE == 1
|
||||
* - UF == UIE == 1
|
||||
* Any time the IRQF bit is a 1, the !IRQ pin is driven low.
|
||||
* All flag bits are cleared after Register C is read by the
|
||||
* program or when the !RESET pin is low.
|
||||
*
|
||||
* * Valid RAM and Time (VRT)
|
||||
* This bit indicates the condition of the battery connected
|
||||
* to the VBAT pin. This bit is not writeable and should
|
||||
* always be 1 when read. If a 0 is ever present, an
|
||||
* exhausted internal lithium energy source is indicated and
|
||||
* both the contents of the RTC data and RAM data are
|
||||
* questionable. This bit is unaffected by !RESET.
|
||||
* * Valid RAM and Time (VRT)
|
||||
* This bit indicates the condition of the battery connected
|
||||
* to the VBAT pin. This bit is not writeable and should
|
||||
* always be 1 when read. If a 0 is ever present, an
|
||||
* exhausted internal lithium energy source is indicated and
|
||||
* both the contents of the RTC data and RAM data are
|
||||
* questionable. This bit is unaffected by !RESET.
|
||||
*
|
||||
* This file implements a generic version of the RTC/NVRAM chip,
|
||||
* including the later update (DS12887A) which implemented a
|
||||
* "century" register to be compatible with Y2K.
|
||||
* This file implements a generic version of the RTC/NVRAM chip,
|
||||
* including the later update (DS12887A) which implemented a
|
||||
* "century" register to be compatible with Y2K.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Mahod,
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Mahod,
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2017-2020 Fred N. van Kempen.
|
||||
* Copyright 2016-2020 Miran Grca.
|
||||
* Copyright 2008-2020 Sarah Walker.
|
||||
* Copyright 2017-2020 Fred N. van Kempen.
|
||||
* Copyright 2016-2020 Miran Grca.
|
||||
* Copyright 2008-2020 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -1299,7 +1299,7 @@ const device_t p6rp4_nvr_device = {
|
||||
};
|
||||
|
||||
const device_t amstrad_megapc_nvr_device = {
|
||||
.name = "Amstrad MegapC NVRAM",
|
||||
.name = "Amstrad MegaPC NVRAM",
|
||||
.internal_name = "amstrad_megapc_nvr",
|
||||
.flags = DEVICE_ISA | DEVICE_AT,
|
||||
.local = 36,
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Handling of the PS/2 series CMOS devices.
|
||||
* Handling of the PS/2 series CMOS devices.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
*
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -1,36 +1,34 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
*
|
||||
* Provide centralized access to the PNG image handler.
|
||||
* Provide centralized access to the PNG image handler.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
@@ -1,40 +1,38 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
*
|
||||
* Various ASCII to Unicode maps, for the various codepages.
|
||||
* Various ASCII to Unicode maps, for the various codepages.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Michael Drüing, <michael@drueing.de>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Michael Drüing, <michael@drueing.de>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Based on code by Frederic Weymann (originally for DosBox.)
|
||||
* Based on code by Frederic Weymann (originally for DosBox.)
|
||||
*
|
||||
* Copyright 2018 Michael Drüing.
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
* Copyright 2018 Michael Drüing.
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
@@ -1,40 +1,38 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
*
|
||||
* Implementation of the Generic ESC/P Dot-Matrix printer.
|
||||
* Implementation of the Generic ESC/P Dot-Matrix printer.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Michael Drüing, <michael@drueing.de>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Michael Drüing, <michael@drueing.de>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Based on code by Frederic Weymann (originally for DosBox.)
|
||||
* Based on code by Frederic Weymann (originally for DosBox.)
|
||||
*
|
||||
* Copyright 2018,2019 Michael Drüing.
|
||||
* Copyright 2019,2019 Fred N. van Kempen.
|
||||
* Copyright 2018,2019 Michael Drüing.
|
||||
* Copyright 2019,2019 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
@@ -697,8 +695,8 @@ process_char(escp_t *dev, uint8_t ch)
|
||||
case 0x5e: // Enable printing of all character codes on next character
|
||||
case 0x67: // Select 10.5-point, 15-cpi (ESC g)
|
||||
|
||||
case 0x834: // Select italic font (FS 4) (= ESC 4)
|
||||
case 0x835: // Cancel italic font (FS 5) (= ESC 5)
|
||||
case 0x834: // Select italic font (FS 4) (= ESC 4)
|
||||
case 0x835: // Cancel italic font (FS 5) (= ESC 5)
|
||||
case 0x846: // Select forward feed mode (FS F)
|
||||
case 0x852: // Select reverse feed mode (FS R)
|
||||
dev->esc_parms_req = 0;
|
||||
@@ -735,14 +733,14 @@ process_char(escp_t *dev, uint8_t ch)
|
||||
case 0x77: // Turn double-height printing on/off (ESC w)
|
||||
case 0x78: // Select LQ or draft (ESC x)
|
||||
case 0x7e: // Select/Deselect slash zero (ESC ~)
|
||||
case 0x832: // Select 1/6-inch line spacing (FS 2) (= ESC 2)
|
||||
case 0x833: // Set n/360-inch line spacing (FS 3) (= ESC +)
|
||||
case 0x841: // Set n/60-inch line spacing (FS A) (= ESC A)
|
||||
case 0x843: // Select LQ type style (FS C) (= ESC k)
|
||||
case 0x832: // Select 1/6-inch line spacing (FS 2) (= ESC 2)
|
||||
case 0x833: // Set n/360-inch line spacing (FS 3) (= ESC +)
|
||||
case 0x841: // Set n/60-inch line spacing (FS A) (= ESC A)
|
||||
case 0x843: // Select LQ type style (FS C) (= ESC k)
|
||||
case 0x845: // Select character width (FS E)
|
||||
case 0x849: // Select character table (FS I) (= ESC t)
|
||||
case 0x849: // Select character table (FS I) (= ESC t)
|
||||
case 0x853: // Select High Speed/High Density elite pitch (FS S)
|
||||
case 0x856: // Turn double-height printing on/off (FS V) (= ESC w)
|
||||
case 0x856: // Turn double-height printing on/off (FS V) (= ESC w)
|
||||
dev->esc_parms_req = 1;
|
||||
break;
|
||||
|
||||
|
||||
@@ -1,43 +1,41 @@
|
||||
/*
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
* VARCem Virtual ARchaeological Computer EMulator.
|
||||
* An emulator of (mostly) x86-based PC systems and devices,
|
||||
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
|
||||
* spanning the era between 1981 and 1995.
|
||||
*
|
||||
* This file is part of the VARCem Project.
|
||||
* Implementation of a generic text printer.
|
||||
*
|
||||
* Implementation of a generic text printer.
|
||||
*
|
||||
* Simple old text printers were unable to do any formatting
|
||||
* of the text. They were just sheets of paper with a fixed
|
||||
* size (in the U.S., this would be Letter, 8.5"x11") with a
|
||||
* set of fixed margings to allow for proper operation of the
|
||||
* printer mechanics. This would lead to a page being 66 lines
|
||||
* of 80 characters each.
|
||||
* Simple old text printers were unable to do any formatting
|
||||
* of the text. They were just sheets of paper with a fixed
|
||||
* size (in the U.S., this would be Letter, 8.5"x11") with a
|
||||
* set of fixed margings to allow for proper operation of the
|
||||
* printer mechanics. This would lead to a page being 66 lines
|
||||
* of 80 characters each.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2018,2019 Fred N. van Kempen.
|
||||
* Copyright 2018,2019 Fred N. van Kempen.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
* 1. Redistributions of source code must retain the entire
|
||||
* above notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
* 3. Neither the name of the copyright holder nor the names
|
||||
* of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
|
||||
@@ -54,7 +54,6 @@ DeviceConfig::~DeviceConfig()
|
||||
void DeviceConfig::ConfigureDevice(const _device_* device, int instance, Settings* settings) {
|
||||
DeviceConfig dc(settings);
|
||||
dc.setWindowTitle(QString("%1 Device Configuration").arg(device->name));
|
||||
int combo_to_struct[256];
|
||||
int c, d, p, q;
|
||||
|
||||
device_context_t device_context;
|
||||
|
||||
@@ -46,7 +46,9 @@ void HardwareRenderer::initializeGL()
|
||||
{
|
||||
m_context->makeCurrent(this);
|
||||
initializeOpenGLFunctions();
|
||||
m_texture = new QOpenGLTexture(QImage(2048,2048, QImage::Format::Format_RGB32));
|
||||
auto image = QImage(2048, 2048, QImage::Format_RGB32);
|
||||
image.fill(0xff000000);
|
||||
m_texture = new QOpenGLTexture(image);
|
||||
m_blt = new QOpenGLTextureBlitter;
|
||||
m_blt->setRedBlueSwizzle(true);
|
||||
m_blt->create();
|
||||
@@ -138,6 +140,7 @@ void HardwareRenderer::initializeGL()
|
||||
pclog("OpenGL shader language version: %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION));
|
||||
glClearColor(0, 0, 0, 1);
|
||||
m_texture->setWrapMode(QOpenGLTexture::ClampToEdge);
|
||||
update();
|
||||
}
|
||||
|
||||
void HardwareRenderer::paintGL() {
|
||||
|
||||
@@ -154,6 +154,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
ui->stackedWidget->setMouseTracking(true);
|
||||
statusBar()->setVisible(!hide_status_bar);
|
||||
statusBar()->setStyleSheet("QStatusBar::item {border: None; } QStatusBar QLabel { margin-right: 2px; margin-bottom: 1px; }");
|
||||
this->centralWidget()->setStyleSheet("background-color: black;");
|
||||
ui->toolBar->setVisible(!hide_tool_bar);
|
||||
renderers[0].reset(nullptr);
|
||||
auto toolbar_spacer = new QWidget();
|
||||
@@ -506,15 +507,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
#endif
|
||||
if (!vnc_enabled) video_setblit(qt_blit);
|
||||
|
||||
if (start_in_fullscreen) {
|
||||
connect(ui->stackedWidget, &RendererStack::blit, this, [this] () {
|
||||
if (start_in_fullscreen) {
|
||||
QTimer::singleShot(100, ui->actionFullscreen, &QAction::trigger);
|
||||
start_in_fullscreen = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#ifdef MTR_ENABLED
|
||||
{
|
||||
ui->actionBegin_trace->setVisible(true);
|
||||
@@ -710,6 +702,10 @@ void MainWindow::showEvent(QShowEvent *event) {
|
||||
QApplication::processEvents();
|
||||
this->adjustSize();
|
||||
}
|
||||
if (start_in_fullscreen) {
|
||||
start_in_fullscreen = 0;
|
||||
QTimer::singleShot(0, ui->actionFullscreen, &QAction::trigger);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionKeyboard_requires_capture_triggered() {
|
||||
@@ -754,10 +750,6 @@ void MainWindow::on_actionCtrl_Alt_Esc_triggered() {
|
||||
|
||||
void MainWindow::on_actionPause_triggered() {
|
||||
plat_pause(dopause ^ 1);
|
||||
auto pause_icon = dopause ? QIcon(":/menuicons/win/icons/run.ico") : QIcon(":/menuicons/win/icons/pause.ico");
|
||||
auto tooltip_text = dopause ? QString(tr("Resume execution")) : QString(tr("Pause execution"));
|
||||
ui->actionPause->setIcon(pause_icon);
|
||||
ui->actionPause->setToolTip(tooltip_text);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionExit_triggered() {
|
||||
@@ -1009,17 +1001,17 @@ std::array<uint32_t, 256> x11_to_xt_2
|
||||
0x51,
|
||||
0x52,
|
||||
0x53,
|
||||
0x54,
|
||||
0x138,
|
||||
0x55,
|
||||
0x56,
|
||||
0x35,
|
||||
0x57,
|
||||
0x58,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0x56,
|
||||
0x70,
|
||||
0x7B,
|
||||
0x7D,
|
||||
0x2B,
|
||||
0x7E,
|
||||
0,
|
||||
0x11C,
|
||||
0x11D,
|
||||
@@ -1036,7 +1028,23 @@ std::array<uint32_t, 256> x11_to_xt_2
|
||||
0x150,
|
||||
0x151,
|
||||
0x152,
|
||||
0x153
|
||||
0x153,
|
||||
0,
|
||||
0, /* Mute */
|
||||
0, /* Volume Down */
|
||||
0, /* Volume Up */
|
||||
0, /* Power Off */
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0x70,
|
||||
0x7B,
|
||||
0x73,
|
||||
0x15B,
|
||||
0x15C,
|
||||
0x15D
|
||||
};
|
||||
|
||||
std::array<uint32_t, 256> x11_to_xt_vnc
|
||||
@@ -1532,6 +1540,7 @@ void MainWindow::on_actionFullscreen_triggered() {
|
||||
ui->menubar->hide();
|
||||
ui->statusbar->hide();
|
||||
ui->toolBar->hide();
|
||||
ui->stackedWidget->setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
|
||||
showFullScreen();
|
||||
if (vid_api == 5) QTimer::singleShot(0, this, [this] () { ui->stackedWidget->switchRenderer(RendererStack::Renderer::Direct3D9); });
|
||||
}
|
||||
@@ -1617,7 +1626,7 @@ void MainWindow::showMessage_(int flags, const QString &header, const QString &m
|
||||
|
||||
void MainWindow::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
if (send_keyboard_input && !(kbd_req_capture && !mouse_capture && !video_fullscreen))
|
||||
if (send_keyboard_input && !(kbd_req_capture && !mouse_capture))
|
||||
{
|
||||
// Windows keys in Qt have one-to-one mapping.
|
||||
if (event->key() == Qt::Key_Pause && !keyboard_recv(0x38) && !keyboard_recv(0x138)) {
|
||||
@@ -1631,8 +1640,6 @@ void MainWindow::keyPressEvent(QKeyEvent* event)
|
||||
keyboard_input(1, 0x1D);
|
||||
keyboard_input(1, 0x45);
|
||||
}
|
||||
} else if (event->key() == Qt::Key_Super_L || event->key() == Qt::Key_Super_R) {
|
||||
keyboard_input(1, event->key() == Qt::Key_Super_L ? 0x15B : 0x15C);
|
||||
} else
|
||||
#ifdef Q_OS_MACOS
|
||||
processMacKeyboardInput(true, event);
|
||||
@@ -1676,9 +1683,6 @@ void MainWindow::keyReleaseEvent(QKeyEvent* event)
|
||||
if (!send_keyboard_input)
|
||||
return;
|
||||
|
||||
if (event->key() == Qt::Key_Super_L || event->key() == Qt::Key_Super_R) {
|
||||
keyboard_input(0, event->key() == Qt::Key_Super_L ? 0x15B : 0x15C);
|
||||
} else
|
||||
#ifdef Q_OS_MACOS
|
||||
processMacKeyboardInput(false, event);
|
||||
#else
|
||||
@@ -2056,6 +2060,13 @@ void MainWindow::setSendKeyboardInput(bool enabled)
|
||||
send_keyboard_input = enabled;
|
||||
}
|
||||
|
||||
void MainWindow::updateUiPauseState() {
|
||||
auto pause_icon = dopause ? QIcon(":/menuicons/win/icons/run.ico") : QIcon(":/menuicons/win/icons/pause.ico");
|
||||
auto tooltip_text = dopause ? QString(tr("Resume execution")) : QString(tr("Pause execution"));
|
||||
ui->actionPause->setIcon(pause_icon);
|
||||
ui->actionPause->setToolTip(tooltip_text);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionPreferences_triggered()
|
||||
{
|
||||
ProgSettings progsettings(this);
|
||||
|
||||
@@ -64,6 +64,7 @@ public slots:
|
||||
void togglePause();
|
||||
void initRendererMonitorSlot(int monitor_index);
|
||||
void destroyRendererMonitorSlot(int monitor_index);
|
||||
void updateUiPauseState();
|
||||
private slots:
|
||||
void on_actionFullscreen_triggered();
|
||||
void on_actionSettings_triggered();
|
||||
|
||||
@@ -194,6 +194,9 @@ OpenGLRenderer::initialize()
|
||||
|
||||
emit initialized();
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
context->swapBuffers(this);
|
||||
} catch (const opengl_init_error &e) {
|
||||
/* Mark all buffers as in use */
|
||||
for (auto &flag : buf_usage)
|
||||
|
||||
@@ -366,6 +366,7 @@ plat_pause(int p)
|
||||
ui_window_title(oldtitle);
|
||||
}
|
||||
discord_update_activity(dopause);
|
||||
QTimer::singleShot(0, main_window, &MainWindow::updateUiPauseState);
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
if (source_hwnd)
|
||||
|
||||
@@ -416,6 +416,7 @@ RendererStack::createRenderer(Renderer renderer)
|
||||
current->setFocusPolicy(Qt::NoFocus);
|
||||
current->setFocusProxy(this);
|
||||
current->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
current->setStyleSheet("background-color: black");
|
||||
addWidget(current.get());
|
||||
|
||||
this->setStyleSheet("background-color: black");
|
||||
|
||||
@@ -73,6 +73,12 @@ static void setCDROMSpeed(QAbstractItemModel* model, const QModelIndex& idx, uin
|
||||
model->setData(i, speed, Qt::UserRole);
|
||||
}
|
||||
|
||||
static void setCDROMEarly(QAbstractItemModel* model, const QModelIndex& idx, bool early) {
|
||||
auto i = idx.siblingAtColumn(2);
|
||||
model->setData(i, (early == true) ? QObject::tr("On") : QObject::tr("Off"));
|
||||
model->setData(i, early, Qt::UserRole);
|
||||
}
|
||||
|
||||
SettingsFloppyCDROM::SettingsFloppyCDROM(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::SettingsFloppyCDROM)
|
||||
@@ -120,15 +126,17 @@ SettingsFloppyCDROM::SettingsFloppyCDROM(QWidget *parent) :
|
||||
Models::AddEntry(model, QString("%1x").arg(i + 1), i + 1);
|
||||
}
|
||||
|
||||
model = new QStandardItemModel(0, 2, this);
|
||||
model = new QStandardItemModel(0, 3, this);
|
||||
ui->tableViewCDROM->setModel(model);
|
||||
model->setHeaderData(0, Qt::Horizontal, tr("Bus"));
|
||||
model->setHeaderData(1, Qt::Horizontal, tr("Speed"));
|
||||
model->setHeaderData(2, Qt::Horizontal, tr("Earlier drive"));
|
||||
model->insertRows(0, CDROM_NUM);
|
||||
for (int i = 0; i < CDROM_NUM; i++) {
|
||||
auto idx = model->index(i, 0);
|
||||
setCDROMBus(model, idx, cdrom[i].bus_type, cdrom[i].res);
|
||||
setCDROMSpeed(model, idx.siblingAtColumn(1), cdrom[i].speed);
|
||||
setCDROMEarly(model, idx.siblingAtColumn(2), cdrom[i].early);
|
||||
Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type, cdrom[i].bus_type == CDROM_BUS_ATAPI ? cdrom[i].ide_channel : cdrom[i].scsi_device_id);
|
||||
}
|
||||
ui->tableViewCDROM->resizeColumnsToContents();
|
||||
@@ -154,7 +162,7 @@ void SettingsFloppyCDROM::save() {
|
||||
/* Removable devices category */
|
||||
model = ui->tableViewCDROM->model();
|
||||
for (int i = 0; i < CDROM_NUM; i++) {
|
||||
cdrom[i].is_dir = 0;
|
||||
cdrom[i].is_dir = 0;
|
||||
cdrom[i].priv = NULL;
|
||||
cdrom[i].ops = NULL;
|
||||
cdrom[i].image = NULL;
|
||||
@@ -165,6 +173,7 @@ void SettingsFloppyCDROM::save() {
|
||||
cdrom[i].bus_type = model->index(i, 0).data(Qt::UserRole).toUInt();
|
||||
cdrom[i].res = model->index(i, 0).data(Qt::UserRole + 1).toUInt();
|
||||
cdrom[i].speed = model->index(i, 1).data(Qt::UserRole).toUInt();
|
||||
cdrom[i].early = model->index(i, 2).data(Qt::UserRole).toUInt();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,6 +188,7 @@ void SettingsFloppyCDROM::onCDROMRowChanged(const QModelIndex ¤t) {
|
||||
uint8_t bus = current.siblingAtColumn(0).data(Qt::UserRole).toUInt();
|
||||
uint8_t channel = current.siblingAtColumn(0).data(Qt::UserRole + 1).toUInt();
|
||||
uint8_t speed = current.siblingAtColumn(1).data(Qt::UserRole).toUInt();
|
||||
bool early = current.siblingAtColumn(2).data(Qt::UserRole).toBool();
|
||||
|
||||
ui->comboBoxBus->setCurrentIndex(-1);
|
||||
auto* model = ui->comboBoxBus->model();
|
||||
@@ -194,6 +204,7 @@ void SettingsFloppyCDROM::onCDROMRowChanged(const QModelIndex ¤t) {
|
||||
}
|
||||
|
||||
ui->comboBoxSpeed->setCurrentIndex(speed == 0 ? 7 : speed - 1);
|
||||
ui->checkBoxEarlierDrive->setChecked(early);
|
||||
}
|
||||
|
||||
void SettingsFloppyCDROM::on_checkBoxTurboTimings_stateChanged(int arg1) {
|
||||
@@ -219,6 +230,7 @@ void SettingsFloppyCDROM::on_comboBoxBus_currentIndexChanged(int index) {
|
||||
bool enabled = (bus != CDROM_BUS_DISABLED);
|
||||
ui->comboBoxChannel->setEnabled(enabled);
|
||||
ui->comboBoxSpeed->setEnabled(enabled);
|
||||
ui->checkBoxEarlierDrive->setEnabled(enabled);
|
||||
Harddrives::populateBusChannels(ui->comboBoxChannel->model(), bus);
|
||||
}
|
||||
|
||||
@@ -251,3 +263,10 @@ void SettingsFloppyCDROM::on_comboBoxChannel_activated(int) {
|
||||
ui->comboBoxChannel->currentData().toUInt());
|
||||
Harddrives::busTrackClass->device_track(1, DEV_CDROM, ui->tableViewCDROM->model()->data(i, Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i, Qt::UserRole + 1).toInt());
|
||||
}
|
||||
|
||||
void SettingsFloppyCDROM::on_checkBoxEarlierDrive_stateChanged(int arg1)
|
||||
{
|
||||
auto idx = ui->tableViewCDROM->selectionModel()->currentIndex();
|
||||
setCDROMEarly(ui->tableViewCDROM->model(), idx.siblingAtColumn(2), (arg1 == Qt::Checked) ? true : false);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ private slots:
|
||||
void onFloppyRowChanged(const QModelIndex ¤t);
|
||||
void onCDROMRowChanged(const QModelIndex ¤t);
|
||||
|
||||
void on_checkBoxEarlierDrive_stateChanged(int arg1);
|
||||
|
||||
private:
|
||||
Ui::SettingsFloppyCDROM *ui;
|
||||
};
|
||||
|
||||
@@ -145,6 +145,13 @@
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="comboBoxSpeed"/>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QCheckBox" name="checkBoxEarlierDrive">
|
||||
<property name="text">
|
||||
<string>Earlier drive</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -174,7 +174,7 @@ void WindowsRawInputFilter::keyboard_handle(PRAWINPUT raw)
|
||||
RAWKEYBOARD rawKB = raw->data.keyboard;
|
||||
scancode = rawKB.MakeCode;
|
||||
|
||||
if (kbd_req_capture && !mouse_capture && !video_fullscreen)
|
||||
if (kbd_req_capture && !mouse_capture)
|
||||
return;
|
||||
|
||||
/* If it's not a scan code that starts with 0xE1 */
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
#include <stdarg.h>
|
||||
#include <inttypes.h>
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -81,7 +82,8 @@ const uint8_t scsi_cdrom_command_flags[0x100] = {
|
||||
IMPLEMENTED | CHECK_READY, /* 0x1E */
|
||||
0, 0, 0, 0, 0, 0, /* 0x1F-0x24 */
|
||||
IMPLEMENTED | CHECK_READY, /* 0x25 */
|
||||
0, 0, /* 0x26-0x27 */
|
||||
IMPLEMENTED | CHECK_READY | SCSI_ONLY | EARLY_ONLY,/* 0x26 */
|
||||
0, /* 0x27 */
|
||||
IMPLEMENTED | CHECK_READY, /* 0x28 */
|
||||
0, 0, /* 0x29-0x2A */
|
||||
IMPLEMENTED | CHECK_READY | NONDATA, /* 0x2B */
|
||||
@@ -349,11 +351,10 @@ scsi_cdrom_init(scsi_cdrom_t *dev)
|
||||
|
||||
dev->sense[0] = 0xf0;
|
||||
dev->sense[7] = 10;
|
||||
#ifdef POSSIBLE_EARLY_ATAPI
|
||||
dev->status = READY_STAT | DSC_STAT;
|
||||
#else
|
||||
dev->status = 0;
|
||||
#endif
|
||||
if (dev->early)
|
||||
dev->status = READY_STAT | DSC_STAT;
|
||||
else
|
||||
dev->status = 0;
|
||||
dev->pos = 0;
|
||||
dev->packet_status = PHASE_NONE;
|
||||
scsi_cdrom_sense_key = scsi_cdrom_asc = scsi_cdrom_ascq = dev->unit_attention = 0;
|
||||
@@ -541,6 +542,7 @@ static void
|
||||
scsi_cdrom_update_request_length(scsi_cdrom_t *dev, int len, int block_len)
|
||||
{
|
||||
int32_t bt, min_len = 0;
|
||||
double dlen;
|
||||
|
||||
dev->max_transfer_len = dev->request_length;
|
||||
|
||||
@@ -589,6 +591,16 @@ scsi_cdrom_update_request_length(scsi_cdrom_t *dev, int len, int block_len)
|
||||
else if (len > dev->max_transfer_len)
|
||||
dev->request_length = dev->max_transfer_len;
|
||||
|
||||
/* READ CD MSF and READ CD: Round the request length to the sector size - the device must ensure
|
||||
that a media access comand does not DRQ in the middle of a sector. One of the drivers that
|
||||
relies on the correctness of this behavior is MTMCDAI.SYS (the Mitsumi CD-ROM driver) for DOS
|
||||
which uses the READ CD command to read data on some CD types. */
|
||||
if ((dev->current_cdb[0] == 0xb9) || (dev->current_cdb[0] == 0xbe)) {
|
||||
/* Round to sector length. */
|
||||
dlen = ((double) dev->request_length) / ((double) block_len);
|
||||
dev->request_length = ((uint16_t) floor(dlen)) * block_len;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1011,8 +1023,8 @@ scsi_cdrom_read_blocks(scsi_cdrom_t *dev, int32_t *len, int first_batch)
|
||||
|
||||
if (ret == -1)
|
||||
return 0;
|
||||
else if (!ret || ((dev->old_len != *len) && !first_batch)) {
|
||||
if ((dev->old_len != *len) && !first_batch)
|
||||
else if (!ret || (!first_batch && (dev->old_len != *len))) {
|
||||
if (!first_batch && (dev->old_len != *len))
|
||||
scsi_cdrom_illegal_mode(dev);
|
||||
|
||||
return 0;
|
||||
@@ -1174,6 +1186,12 @@ scsi_cdrom_pre_execution_check(scsi_cdrom_t *dev, uint8_t *cdb)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!dev->early && (scsi_cdrom_command_flags[cdb[0]] & EARLY_ONLY)) {
|
||||
scsi_cdrom_log("CD-ROM %i: Attempting to execute SCSI-only command %02X over ATAPI\n", dev->id, cdb[0]);
|
||||
scsi_cdrom_illegal_opcode(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((dev->drv->bus_type < CDROM_BUS_SCSI) && (scsi_cdrom_command_flags[cdb[0]] & SCSI_ONLY)) {
|
||||
scsi_cdrom_log("CD-ROM %i: Attempting to execute SCSI-only command %02X over ATAPI\n", dev->id, cdb[0]);
|
||||
scsi_cdrom_illegal_opcode(dev);
|
||||
@@ -1998,19 +2016,27 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb)
|
||||
scsi_cdrom_data_command_finish(dev, len, len, max_len, 0);
|
||||
break;
|
||||
|
||||
/* GPCMD_CHINON_EJECT on Chinon */
|
||||
case GPCMD_AUDIO_TRACK_SEARCH:
|
||||
scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS);
|
||||
if ((dev->drv->host_drive < 1) || (dev->drv->cd_status <= CD_STATUS_DATA_ONLY)) {
|
||||
scsi_cdrom_illegal_mode(dev);
|
||||
break;
|
||||
}
|
||||
pos = (cdb[2] << 24) | (cdb[3] << 16) | (cdb[4] << 8) | cdb[5];
|
||||
ret = cdrom_audio_track_search(dev->drv, pos, cdb[9], cdb[1] & 1);
|
||||
|
||||
if (ret)
|
||||
if (dev->early) {
|
||||
scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS);
|
||||
scsi_cdrom_stop(sc);
|
||||
cdrom_eject(dev->id);
|
||||
scsi_cdrom_command_complete(dev);
|
||||
else
|
||||
scsi_cdrom_illegal_mode(dev);
|
||||
} else {
|
||||
scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS);
|
||||
if ((dev->drv->host_drive < 1) || (dev->drv->cd_status <= CD_STATUS_DATA_ONLY)) {
|
||||
scsi_cdrom_illegal_mode(dev);
|
||||
break;
|
||||
}
|
||||
pos = (cdb[2] << 24) | (cdb[3] << 16) | (cdb[4] << 8) | cdb[5];
|
||||
ret = cdrom_audio_track_search(dev->drv, pos, cdb[9], cdb[1] & 1);
|
||||
|
||||
if (ret)
|
||||
scsi_cdrom_command_complete(dev);
|
||||
else
|
||||
scsi_cdrom_illegal_mode(dev);
|
||||
}
|
||||
break;
|
||||
|
||||
case GPCMD_TOSHIBA_PLAY_AUDIO:
|
||||
@@ -2149,13 +2175,13 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb)
|
||||
dev->buffer[1] = 0x11;
|
||||
break;
|
||||
case CD_STATUS_PAUSED:
|
||||
dev->buffer[1] = 0x12;
|
||||
dev->buffer[1] = ((dev->drv->bus_type == CDROM_BUS_SCSI) && dev->early) ? 0x15 : 0x12;
|
||||
break;
|
||||
case CD_STATUS_DATA_ONLY:
|
||||
dev->buffer[1] = 0x15;
|
||||
dev->buffer[1] = ((dev->drv->bus_type == CDROM_BUS_SCSI) && dev->early) ? 0x00 : 0x15;
|
||||
break;
|
||||
default:
|
||||
dev->buffer[1] = 0x13;
|
||||
dev->buffer[1] = ((dev->drv->bus_type == CDROM_BUS_SCSI) && dev->early) ? 0x00 : 0x13;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2168,35 +2194,42 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb)
|
||||
scsi_cdrom_data_command_finish(dev, len, len, len, 0);
|
||||
break;
|
||||
|
||||
/* GPCMD_CHINON_STOP on Chinon */
|
||||
case GPCMD_READ_SUBCODEQ_PLAYING_STATUS:
|
||||
scsi_cdrom_set_phase(dev, SCSI_PHASE_DATA_IN);
|
||||
|
||||
alloc_length = cdb[1] & 0x1f;
|
||||
|
||||
scsi_cdrom_buf_alloc(dev, alloc_length);
|
||||
|
||||
if (!dev->drv->ops) {
|
||||
scsi_cdrom_not_ready(dev);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!alloc_length) {
|
||||
if (dev->early) {
|
||||
scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS);
|
||||
scsi_cdrom_log("CD-ROM %i: All done - callback set\n", dev->id);
|
||||
dev->packet_status = PHASE_COMPLETE;
|
||||
dev->callback = 20.0 * CDROM_TIME;
|
||||
scsi_cdrom_set_callback(dev);
|
||||
break;
|
||||
scsi_cdrom_stop(sc);
|
||||
scsi_cdrom_command_complete(dev);
|
||||
} else {
|
||||
scsi_cdrom_set_phase(dev, SCSI_PHASE_DATA_IN);
|
||||
|
||||
alloc_length = cdb[1] & 0x1f;
|
||||
|
||||
scsi_cdrom_buf_alloc(dev, alloc_length);
|
||||
|
||||
if (!dev->drv->ops) {
|
||||
scsi_cdrom_not_ready(dev);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!alloc_length) {
|
||||
scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS);
|
||||
scsi_cdrom_log("CD-ROM %i: All done - callback set\n", dev->id);
|
||||
dev->packet_status = PHASE_COMPLETE;
|
||||
dev->callback = 20.0 * CDROM_TIME;
|
||||
scsi_cdrom_set_callback(dev);
|
||||
break;
|
||||
}
|
||||
|
||||
len = alloc_length;
|
||||
|
||||
memset(dev->buffer, 0, len);
|
||||
dev->buffer[0] = cdrom_get_current_subcodeq_playstatus(dev->drv, &dev->buffer[1]);
|
||||
scsi_cdrom_log("Audio Status = %02x\n", dev->buffer[0]);
|
||||
|
||||
scsi_cdrom_set_buf_len(dev, BufLen, &alloc_length);
|
||||
scsi_cdrom_data_command_finish(dev, len, len, len, 0);
|
||||
}
|
||||
|
||||
len = alloc_length;
|
||||
|
||||
memset(dev->buffer, 0, len);
|
||||
dev->buffer[0] = cdrom_get_current_subcodeq_playstatus(dev->drv, &dev->buffer[1]);
|
||||
scsi_cdrom_log("Audio Status = %02x\n", dev->buffer[0]);
|
||||
|
||||
scsi_cdrom_set_buf_len(dev, BufLen, &alloc_length);
|
||||
scsi_cdrom_data_command_finish(dev, len, len, len, 0);
|
||||
break;
|
||||
|
||||
case GPCMD_READ_DVD_STRUCTURE:
|
||||
@@ -2235,6 +2268,12 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb)
|
||||
}
|
||||
break;
|
||||
|
||||
case GPCMD_CHINON_UNKNOWN:
|
||||
scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS);
|
||||
scsi_cdrom_stop(sc);
|
||||
scsi_cdrom_command_complete(dev);
|
||||
break;
|
||||
|
||||
case GPCMD_START_STOP_UNIT:
|
||||
scsi_cdrom_set_phase(dev, SCSI_PHASE_STATUS);
|
||||
|
||||
@@ -2309,22 +2348,36 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb)
|
||||
dev->buffer[idx++] = 0x01;
|
||||
dev->buffer[idx++] = 0x00;
|
||||
dev->buffer[idx++] = 68;
|
||||
if (dev->drv->bus_type == CDROM_BUS_SCSI)
|
||||
ide_padstr8(dev->buffer + idx, 8, "TOSHIBA"); /* Vendor */
|
||||
else
|
||||
#ifdef USE_86BOX_CD
|
||||
ide_padstr8(dev->buffer + idx, 8, EMU_NAME); /* Vendor */
|
||||
ide_padstr8(dev->buffer + idx, 8, EMU_NAME); /* Vendor */
|
||||
#else
|
||||
ide_padstr8(dev->buffer + idx, 8, "HITACHI"); /* Vendor */
|
||||
if (dev->drv->bus_type == CDROM_BUS_SCSI) {
|
||||
if (dev->early)
|
||||
ide_padstr8(dev->buffer + idx, 8, "CHINON"); /* Vendor */
|
||||
else
|
||||
ide_padstr8(dev->buffer + idx, 8, "TOSHIBA"); /* Vendor */
|
||||
} else {
|
||||
if (dev->early)
|
||||
ide_padstr8(dev->buffer + idx, 8, "NEC"); /* Vendor */
|
||||
else
|
||||
ide_padstr8(dev->buffer + idx, 8, "HITACHI"); /* Vendor */
|
||||
}
|
||||
#endif
|
||||
idx += 8;
|
||||
if (dev->drv->bus_type == CDROM_BUS_SCSI)
|
||||
ide_padstr8(dev->buffer + idx, 40, "XM6201TASUN32XCD1103"); /* Product */
|
||||
else
|
||||
#ifdef USE_86BOX_CD
|
||||
ide_padstr8(dev->buffer + idx, 40, device_identify_ex); /* Product */
|
||||
#else
|
||||
ide_padstr8(dev->buffer + idx, 40, "CDR-8130"); /* Product */
|
||||
if (dev->drv->bus_type == CDROM_BUS_SCSI) {
|
||||
if (dev->early)
|
||||
ide_padstr8(dev->buffer + idx, 40, "CD-ROM CDS-431"); /* Product */
|
||||
else
|
||||
ide_padstr8(dev->buffer + idx, 40, "XM6201TASUN32XCD1103"); /* Product */
|
||||
} else {
|
||||
if (dev->early)
|
||||
ide_padstr8(dev->buffer + idx, 40, "CD-ROM DRIVE:260"); /* Product */
|
||||
else
|
||||
ide_padstr8(dev->buffer + idx, 40, "CDR-8130"); /* Product */
|
||||
}
|
||||
#endif
|
||||
idx += 40;
|
||||
ide_padstr8(dev->buffer + idx, 20, "53R141"); /* Product */
|
||||
@@ -2359,21 +2412,33 @@ scsi_cdrom_command(scsi_common_t *sc, uint8_t *cdb)
|
||||
dev->buffer[7] = 0x20; /* Wide bus supported */
|
||||
}
|
||||
|
||||
if (dev->drv->bus_type == CDROM_BUS_SCSI) {
|
||||
ide_padstr8(dev->buffer + 8, 8, "TOSHIBA"); /* Vendor */
|
||||
ide_padstr8(dev->buffer + 16, 16, "XM6201TASUN32XCD"); /* Product */
|
||||
ide_padstr8(dev->buffer + 32, 4, "1103"); /* Revision */
|
||||
} else {
|
||||
#ifdef USE_86BOX_CD
|
||||
ide_padstr8(dev->buffer + 8, 8, EMU_NAME); /* Vendor */
|
||||
ide_padstr8(dev->buffer + 16, 16, device_identify); /* Product */
|
||||
ide_padstr8(dev->buffer + 32, 4, EMU_VERSION_EX); /* Revision */
|
||||
ide_padstr8(dev->buffer + 8, 8, EMU_NAME); /* Vendor */
|
||||
ide_padstr8(dev->buffer + 16, 16, device_identify); /* Product */
|
||||
ide_padstr8(dev->buffer + 32, 4, EMU_VERSION_EX); /* Revision */
|
||||
#else
|
||||
ide_padstr8(dev->buffer + 8, 8, "HITACHI"); /* Vendor */
|
||||
ide_padstr8(dev->buffer + 16, 16, "CDR-8130"); /* Product */
|
||||
ide_padstr8(dev->buffer + 32, 4, "0020"); /* Revision */
|
||||
#endif
|
||||
if (dev->drv->bus_type == CDROM_BUS_SCSI) {
|
||||
if (dev->early) {
|
||||
ide_padstr8(dev->buffer + 8, 8, "CHINON"); /* Vendor */
|
||||
ide_padstr8(dev->buffer + 16, 16, "CD-ROM CDS-431"); /* Product */
|
||||
ide_padstr8(dev->buffer + 32, 4, "H42"); /* Revision */
|
||||
} else {
|
||||
ide_padstr8(dev->buffer + 8, 8, "TOSHIBA"); /* Vendor */
|
||||
ide_padstr8(dev->buffer + 16, 16, "XM6201TASUN32XCD"); /* Product */
|
||||
ide_padstr8(dev->buffer + 32, 4, "1103"); /* Revision */
|
||||
}
|
||||
} else {
|
||||
if (dev->early) {
|
||||
ide_padstr8(dev->buffer + 8, 8, "NEC"); /* Vendor */
|
||||
ide_padstr8(dev->buffer + 16, 16, "CD-ROM DRIVE:260"); /* Product */
|
||||
ide_padstr8(dev->buffer + 32, 4, "1.01"); /* Revision */
|
||||
} else {
|
||||
ide_padstr8(dev->buffer + 8, 8, "HITACHI"); /* Vendor */
|
||||
ide_padstr8(dev->buffer + 16, 16, "CDR-8130"); /* Product */
|
||||
ide_padstr8(dev->buffer + 32, 4, "0020"); /* Revision */
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
idx = 36;
|
||||
|
||||
@@ -2645,25 +2710,35 @@ scsi_cdrom_identify(ide_t *ide, int ide_has_dma)
|
||||
scsi_cdrom_t *dev;
|
||||
char device_identify[9] = { '8', '6', 'B', '_', 'C', 'D', '0', '0', 0 };
|
||||
|
||||
dev = (scsi_cdrom_t *) ide->p;
|
||||
dev = (scsi_cdrom_t *) ide->sc;
|
||||
|
||||
device_identify[7] = dev->id + 0x30;
|
||||
scsi_cdrom_log("ATAPI Identify: %s\n", device_identify);
|
||||
#else
|
||||
scsi_cdrom_t *dev = (scsi_cdrom_t *) ide->sc;
|
||||
#endif
|
||||
|
||||
ide->buffer[0] = 0x8000 | (5 << 8) | 0x80 | (2 << 5); /* ATAPI device, CD-ROM drive, removable media, accelerated DRQ */
|
||||
if (dev->early)
|
||||
ide->buffer[0] = 0x8000 | (5 << 8) | 0x80 | (1 << 5); /* ATAPI device, CD-ROM drive, removable media, interrupt DRQ */
|
||||
else
|
||||
ide->buffer[0] = 0x8000 | (5 << 8) | 0x80 | (2 << 5); /* ATAPI device, CD-ROM drive, removable media, accelerated DRQ */
|
||||
ide_padstr((char *) (ide->buffer + 10), "", 20); /* Serial Number */
|
||||
#ifdef USE_86BOX_CD
|
||||
ide_padstr((char *) (ide->buffer + 23), EMU_VERSION_EX, 8); /* Firmware */
|
||||
ide_padstr((char *) (ide->buffer + 27), device_identify, 40); /* Model */
|
||||
#else
|
||||
#ifdef USE_NEC_CD
|
||||
ide_padstr((char *) (ide->buffer + 23), "4.20 ", 8); /* Firmware */
|
||||
ide_padstr((char *) (ide->buffer + 27), "NEC CD-ROM DRIVE:273 ", 40); /* Model */
|
||||
#else
|
||||
ide_padstr((char *) (ide->buffer + 23), "0020 ", 8); /* Firmware */
|
||||
ide_padstr((char *) (ide->buffer + 27), "HITACHI CDR-8130 ", 40); /* Model */
|
||||
#endif
|
||||
if (dev->early) {
|
||||
#ifdef WRONG
|
||||
ide_padstr((char *) (ide->buffer + 23), "1.01 ", 8); /* Firmware */
|
||||
ide_padstr((char *) (ide->buffer + 27), "NEC CD-ROM DRIVE:260 ", 40); /* Model */
|
||||
#else
|
||||
ide_padstr((char *) (ide->buffer + 23), ".110 ", 8); /* Firmware */
|
||||
ide_padstr((char *) (ide->buffer + 27), "EN C DCR-MOD IREV2:06 ", 40); /* Model */
|
||||
#endif
|
||||
} else {
|
||||
ide_padstr((char *) (ide->buffer + 23), "0020 ", 8); /* Firmware */
|
||||
ide_padstr((char *) (ide->buffer + 27), "HITACHI CDR-8130 ", 40); /* Model */
|
||||
}
|
||||
#endif
|
||||
ide->buffer[49] = 0x200; /* LBA supported */
|
||||
ide->buffer[126] = 0xfffe; /* Interpret zero byte count limit as maximum length */
|
||||
@@ -2711,6 +2786,7 @@ scsi_cdrom_drive_reset(int c)
|
||||
dev->drv = drv;
|
||||
|
||||
dev->cur_lun = SCSI_LUN_USE_CDB;
|
||||
dev->early = dev->drv->early;
|
||||
|
||||
drv->insert = scsi_cdrom_insert;
|
||||
drv->get_volume = scsi_cdrom_get_volume;
|
||||
@@ -2749,7 +2825,7 @@ scsi_cdrom_drive_reset(int c)
|
||||
id->phase_data_out = scsi_cdrom_phase_data_out;
|
||||
id->command_stop = scsi_cdrom_command_stop;
|
||||
id->bus_master_error = scsi_cdrom_bus_master_error;
|
||||
id->interrupt_drq = 0;
|
||||
id->interrupt_drq = dev->early;
|
||||
|
||||
ide_atapi_attach(id);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ vt82c686_fdc_handler(vt82c686_t *dev)
|
||||
|
||||
fdc_remove(dev->fdc);
|
||||
|
||||
if (dev->regs[0x02] & 0x10)
|
||||
if ((dev->regs[0x02] & 0x10) && !(dev->regs[0x0f] & 0x03))
|
||||
fdc_set_base(dev->fdc, io_base);
|
||||
|
||||
fdc_set_dma_ch(dev->fdc, dev->fdc_dma);
|
||||
@@ -77,7 +77,7 @@ vt82c686_lpt_handler(vt82c686_t *dev)
|
||||
|
||||
lpt1_remove();
|
||||
|
||||
if (((dev->regs[0x02] & 0x03) != 0x03) && (io_base >= 0x100) && (io_base <= io_mask))
|
||||
if (((dev->regs[0x02] & 0x03) != 0x03) && !(dev->regs[0x0f] & 0x11) && (io_base >= 0x100) && (io_base <= io_mask))
|
||||
lpt1_init(io_base);
|
||||
|
||||
if (dev->lpt_irq) {
|
||||
@@ -92,7 +92,7 @@ vt82c686_serial_handler(vt82c686_t *dev, int uart)
|
||||
{
|
||||
serial_remove(dev->uart[uart]);
|
||||
|
||||
if (dev->regs[0x02] & (0x04 << uart))
|
||||
if ((dev->regs[0x02] & (0x04 << uart)) && !(dev->regs[0x0f] & ((0x04 << uart) | 0x01)))
|
||||
serial_setup(dev->uart[uart], dev->regs[0x07 + uart] << 2, dev->uart_irq[uart]);
|
||||
}
|
||||
|
||||
@@ -161,6 +161,10 @@ vt82c686_write(uint16_t port, uint8_t val, void *priv)
|
||||
|
||||
case 0x0f:
|
||||
dev->regs[reg] &= 0x7f;
|
||||
vt82c686_lpt_handler(dev);
|
||||
vt82c686_serial_handler(dev, 0);
|
||||
vt82c686_serial_handler(dev, 1);
|
||||
vt82c686_fdc_handler(dev);
|
||||
break;
|
||||
|
||||
case 0x10:
|
||||
@@ -243,20 +247,13 @@ vt82c686_sio_write(uint8_t addr, uint8_t val, void *priv)
|
||||
static void
|
||||
vt82c686_reset(vt82c686_t *dev)
|
||||
{
|
||||
memset(dev->regs, 0, 20);
|
||||
memset(dev->regs, 0, 21);
|
||||
|
||||
dev->regs[0x00] = 0x3c;
|
||||
dev->regs[0x02] = 0x03;
|
||||
dev->regs[0x03] = 0xfc;
|
||||
dev->regs[0x06] = 0xde;
|
||||
dev->regs[0x07] = 0xfe;
|
||||
dev->regs[0x08] = 0xbe;
|
||||
|
||||
fdc_reset(dev->fdc);
|
||||
|
||||
serial_setup(dev->uart[0], COM1_ADDR, COM1_IRQ);
|
||||
serial_setup(dev->uart[1], COM2_ADDR, COM2_IRQ);
|
||||
|
||||
vt82c686_lpt_handler(dev);
|
||||
vt82c686_serial_handler(dev, 0);
|
||||
vt82c686_serial_handler(dev, 1);
|
||||
|
||||
@@ -159,7 +159,7 @@ const device_t adlib_mca_device = {
|
||||
.internal_name = "adlib_mca",
|
||||
.flags = DEVICE_MCA,
|
||||
.local = 0,
|
||||
.init = adlib_init,
|
||||
.init = adlib_mca_init,
|
||||
.close = adlib_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
|
||||
@@ -891,12 +891,15 @@ azt_init(const device_t *info)
|
||||
azt2316a_t *azt2316a = malloc(sizeof(azt2316a_t));
|
||||
memset(azt2316a, 0, sizeof(azt2316a_t));
|
||||
|
||||
azt2316a->type = info->local;
|
||||
azt2316a->type = info->local & 0x7fffffff;
|
||||
|
||||
if (azt2316a->type == SB_SUBTYPE_CLONE_AZT1605_0X0C) {
|
||||
fn = "azt1605.nvr";
|
||||
} else if (azt2316a->type == SB_SUBTYPE_CLONE_AZT2316A_0X11) {
|
||||
fn = "azt2316a.nvr";
|
||||
if (info->local & 0x80000000)
|
||||
fn = "acermagic_s20.nvr";
|
||||
else
|
||||
fn = "azt2316a.nvr";
|
||||
}
|
||||
|
||||
/* config */
|
||||
@@ -982,7 +985,9 @@ azt_init(const device_t *info)
|
||||
else
|
||||
fatal("AZT2316A: invalid sb irq in config word %08X\n", azt2316a->config_word);
|
||||
|
||||
switch (azt2316a->config_word & (3 << 6)) {
|
||||
if (info->local & 0x80000000)
|
||||
azt2316a->cur_dma = 1;
|
||||
else switch (azt2316a->config_word & (3 << 6)) {
|
||||
case 1 << 6:
|
||||
azt2316a->cur_dma = 0;
|
||||
break;
|
||||
@@ -1112,7 +1117,10 @@ azt_init(const device_t *info)
|
||||
azt2316a->cur_wss_enabled = 0;
|
||||
|
||||
// these are not present on the EEPROM
|
||||
azt2316a->cur_dma = device_get_config_int("sb_dma8"); // TODO: investigate TSR to make this work with it - there is no software configurable DMA8?
|
||||
if (info->local & 0x80000000)
|
||||
azt2316a->cur_dma = 1;
|
||||
else
|
||||
azt2316a->cur_dma = device_get_config_int("sb_dma8"); // TODO: investigate TSR to make this work with it - there is no software configurable DMA8?
|
||||
azt2316a->cur_wss_irq = device_get_config_int("wss_irq");
|
||||
azt2316a->cur_wss_dma = device_get_config_int("wss_dma");
|
||||
azt2316a->cur_mode = 0;
|
||||
@@ -1125,7 +1133,10 @@ azt_init(const device_t *info)
|
||||
azt2316a->wss_interrupt_after_config = device_get_config_int("wss_interrupt_after_config");
|
||||
|
||||
/* wss part */
|
||||
ad1848_init(&azt2316a->ad1848, device_get_config_int("codec"));
|
||||
if (info->local & 0x80000000)
|
||||
ad1848_init(&azt2316a->ad1848, AD1848_TYPE_CS4231);
|
||||
else
|
||||
ad1848_init(&azt2316a->ad1848, device_get_config_int("codec"));
|
||||
|
||||
ad1848_setirq(&azt2316a->ad1848, azt2316a->cur_wss_irq);
|
||||
ad1848_setdma(&azt2316a->ad1848, azt2316a->cur_wss_dma);
|
||||
@@ -1491,6 +1502,88 @@ static const device_config_t azt2316a_config[] = {
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
static const device_config_t acermagic_s20_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
.name = "wss_interrupt_after_config",
|
||||
.description = "Raise CODEC interrupt on CODEC setup (needed by some drivers)",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.name = "addr",
|
||||
.description = "SB Address",
|
||||
.type = CONFIG_HEX16,
|
||||
.default_string = "",
|
||||
.default_int = 0,
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{
|
||||
.description = "0x220",
|
||||
.value = 0x220
|
||||
},
|
||||
{
|
||||
.description = "0x240",
|
||||
.value = 0x240
|
||||
},
|
||||
{
|
||||
.description = "Use EEPROM setting",
|
||||
.value = 0
|
||||
},
|
||||
{
|
||||
.description = ""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
.name = "wss_irq",
|
||||
.description = "WSS IRQ",
|
||||
.type = CONFIG_SELECTION,
|
||||
.selection = {
|
||||
{
|
||||
.description = "IRQ 11",
|
||||
.value = 11
|
||||
},
|
||||
{
|
||||
.description = "IRQ 10",
|
||||
.value = 10
|
||||
},
|
||||
{
|
||||
.description = "IRQ 7",
|
||||
.value = 7
|
||||
},
|
||||
{
|
||||
.description = ""
|
||||
}
|
||||
},
|
||||
.default_int = 10
|
||||
},
|
||||
{
|
||||
.name = "opl",
|
||||
.description = "Enable OPL",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = "",
|
||||
.default_int = 1
|
||||
},
|
||||
{
|
||||
.name = "receive_input",
|
||||
.description = "Receive input (SB MIDI)",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = "",
|
||||
.default_int = 1
|
||||
},
|
||||
{
|
||||
.name = "receive_input401",
|
||||
.description = "Receive input (MPU-401)",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = "",
|
||||
.default_int = 0
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
const device_t azt2316a_device = {
|
||||
.name = "Aztech Sound Galaxy Pro 16 AB (Washington)",
|
||||
.internal_name = "azt2316a",
|
||||
@@ -1505,6 +1598,20 @@ const device_t azt2316a_device = {
|
||||
.config = azt2316a_config
|
||||
};
|
||||
|
||||
const device_t acermagic_s20_device = {
|
||||
.name = "AcerMagic S20",
|
||||
.internal_name = "acermagic_s20",
|
||||
.flags = DEVICE_ISA | DEVICE_AT,
|
||||
.local = SB_SUBTYPE_CLONE_AZT2316A_0X11 | 0x80000000,
|
||||
.init = azt_init,
|
||||
.close = azt_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = azt_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = acermagic_s20_config
|
||||
};
|
||||
|
||||
const device_t azt1605_device = {
|
||||
.name = "Aztech Sound Galaxy Nova 16 Extra (Clinton)",
|
||||
.internal_name = "azt1605",
|
||||
|
||||
@@ -109,6 +109,7 @@ static const SOUND_CARD sound_cards[] = {
|
||||
// clang-format off
|
||||
{ &sound_none_device },
|
||||
{ &sound_internal_device },
|
||||
{ &acermagic_s20_device },
|
||||
{ &adlib_device },
|
||||
{ &adgold_device },
|
||||
{ &azt2316a_device },
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user