2017-11-19 21:59:38 -05:00
|
|
|
/*
|
2019-09-27 14:07:57 +02:00
|
|
|
* 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.
|
2017-11-19 21:59:38 -05:00
|
|
|
*
|
2019-09-27 14:07:57 +02:00
|
|
|
* This file is part of the 86Box distribution.
|
2017-11-19 21:59:38 -05:00
|
|
|
*
|
|
|
|
|
* Implementation of the Schneider EuroPC system.
|
|
|
|
|
*
|
|
|
|
|
* NOTES: BIOS info (taken from MAME, thanks guys!!)
|
|
|
|
|
*
|
|
|
|
|
* f000:e107 bios checksum test
|
|
|
|
|
* memory test
|
|
|
|
|
* f000:e145 irq vector init
|
|
|
|
|
* f000:e156
|
|
|
|
|
* f000:e169-d774 test of special registers 254/354
|
|
|
|
|
* f000:e16c-e817
|
|
|
|
|
* f000:e16f
|
|
|
|
|
* f000:ec08 test of special registers 800a rtc time
|
|
|
|
|
* or date error, rtc corrected
|
|
|
|
|
* f000:ef66 0xf
|
|
|
|
|
* f000:db3e 0x8..0xc
|
|
|
|
|
* f000:d7f8
|
|
|
|
|
* f000:db5f
|
2022-02-20 02:26:27 -05:00
|
|
|
* f000:e172
|
2017-11-19 21:59:38 -05:00
|
|
|
* f000:ecc5 801a video setup error
|
|
|
|
|
* f000:d6c9 copyright output
|
|
|
|
|
* f000:e1b7
|
2018-03-13 03:46:10 +01:00
|
|
|
* f000:e1be DI bits set mean output text!!! (801a)
|
2017-11-19 21:59:38 -05:00
|
|
|
* f000: 0x8000 output
|
|
|
|
|
* 1 rtc error
|
|
|
|
|
* 2 rtc time or date error
|
|
|
|
|
* 4 checksum error in setup
|
|
|
|
|
* 8 rtc status corrected
|
|
|
|
|
* 10 video setup error
|
|
|
|
|
* 20 video ram bad
|
|
|
|
|
* 40 monitor type not recogniced
|
|
|
|
|
* 80 mouse port enabled
|
|
|
|
|
* 100 joystick port enabled
|
|
|
|
|
* f000:e1e2-dc0c CPU speed is 4.77 mhz
|
|
|
|
|
* f000:e1e5-f9c0 keyboard processor error
|
|
|
|
|
* f000:e1eb-c617 external lpt1 at 0x3bc
|
|
|
|
|
* f000:e1ee-e8ee external coms at
|
|
|
|
|
*
|
|
|
|
|
* Routines:
|
|
|
|
|
* f000:c92d output text at bp
|
|
|
|
|
* f000:db3e RTC read reg cl
|
|
|
|
|
* f000:e8ee piep
|
|
|
|
|
* f000:e95e RTC write reg cl
|
|
|
|
|
* polls until JIM 0xa is zero,
|
|
|
|
|
* output cl at jim 0xa
|
|
|
|
|
* write ah hinibble as lownibble into jim 0xa
|
|
|
|
|
* write ah lownibble into jim 0xa
|
2018-03-13 03:46:10 +01:00
|
|
|
* f000:ef66 RTC read reg cl
|
2017-11-19 21:59:38 -05:00
|
|
|
* polls until jim 0xa is zero,
|
|
|
|
|
* output cl at jim 0xa
|
|
|
|
|
* read low 4 nibble at jim 0xa
|
|
|
|
|
* read low 4 nibble at jim 0xa
|
|
|
|
|
* return first nibble<<4|second nibble in ah
|
2022-02-20 02:26:27 -05:00
|
|
|
* f000:f046 seldom compares ret
|
2018-03-13 03:46:10 +01:00
|
|
|
* f000:fe87 0 -> ds
|
|
|
|
|
*
|
|
|
|
|
* Memory:
|
|
|
|
|
* 0000:0469 bit 0: b0000 memory available
|
2017-11-19 21:59:38 -05:00
|
|
|
* bit 1: b8000 memory available
|
2018-03-13 03:46:10 +01:00
|
|
|
* 0000:046a: 00 jim 250 01 jim 350
|
2017-11-19 21:59:38 -05:00
|
|
|
*
|
|
|
|
|
* WARNING THIS IS A WORK-IN-PROGRESS MODULE. USE AT OWN RISK.
|
2022-02-20 02:26:27 -05:00
|
|
|
*
|
2020-03-25 00:46:02 +02:00
|
|
|
*
|
2017-11-19 21:59:38 -05:00
|
|
|
*
|
|
|
|
|
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
|
|
|
|
*
|
|
|
|
|
* Inspired by the "jim.c" file originally present, but a
|
|
|
|
|
* fully re-written module, based on the information from
|
|
|
|
|
* Schneider's schematics and technical manuals, and the
|
|
|
|
|
* input from people with real EuroPC hardware.
|
|
|
|
|
*
|
2019-09-27 14:07:57 +02:00
|
|
|
* Copyright 2017-2019 Fred N. van Kempen.
|
2017-11-19 21:59:38 -05:00
|
|
|
*/
|
2018-05-21 19:04:05 +02:00
|
|
|
#include <stdarg.h>
|
2017-09-25 04:31:20 -04:00
|
|
|
#include <stdint.h>
|
2018-05-21 19:04:05 +02:00
|
|
|
#include <stdio.h>
|
2016-06-26 00:34:39 +02:00
|
|
|
#include <string.h>
|
2017-11-19 21:59:38 -05:00
|
|
|
#include <stdlib.h>
|
2017-09-25 04:31:20 -04:00
|
|
|
#include <wchar.h>
|
2018-03-13 03:46:10 +01:00
|
|
|
#include <time.h>
|
2018-05-21 19:04:05 +02:00
|
|
|
#define HAVE_STDARG_H
|
2020-03-29 14:24:42 +02:00
|
|
|
#include <86box/86box.h>
|
|
|
|
|
#include <86box/io.h>
|
|
|
|
|
#include <86box/timer.h>
|
|
|
|
|
#include <86box/nmi.h>
|
|
|
|
|
#include <86box/mem.h>
|
|
|
|
|
#include <86box/pit.h>
|
|
|
|
|
#include <86box/rom.h>
|
|
|
|
|
#include <86box/device.h>
|
|
|
|
|
#include <86box/nvr.h>
|
|
|
|
|
#include <86box/keyboard.h>
|
|
|
|
|
#include <86box/mouse.h>
|
|
|
|
|
#include <86box/gameport.h>
|
|
|
|
|
#include <86box/fdd.h>
|
|
|
|
|
#include <86box/fdc.h>
|
|
|
|
|
#include <86box/hdc.h>
|
|
|
|
|
#include <86box/video.h>
|
|
|
|
|
#include <86box/machine.h>
|
2017-06-16 16:00:44 -04:00
|
|
|
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
#define EUROPC_DEBUG 0 /* current debugging level */
|
2017-06-16 16:00:44 -04:00
|
|
|
|
2017-09-04 01:52:29 -04:00
|
|
|
|
2017-11-19 21:59:38 -05:00
|
|
|
/* M3002 RTC chip registers. */
|
|
|
|
|
#define MRTC_SECONDS 0x00 /* BCD, 00-59 */
|
|
|
|
|
#define MRTC_MINUTES 0x01 /* BCD, 00-59 */
|
|
|
|
|
#define MRTC_HOURS 0x02 /* BCD, 00-23 */
|
|
|
|
|
#define MRTC_DAYS 0x03 /* BCD, 01-31 */
|
|
|
|
|
#define MRTC_MONTHS 0x04 /* BCD, 01-12 */
|
2018-03-13 03:46:10 +01:00
|
|
|
#define MRTC_YEARS 0x05 /* BCD, 00-99 (year only) */
|
2017-11-19 21:59:38 -05:00
|
|
|
#define MRTC_WEEKDAY 0x06 /* BCD, 01-07 */
|
|
|
|
|
#define MRTC_WEEKNO 0x07 /* BCD, 01-52 */
|
|
|
|
|
#define MRTC_CONF_A 0x08 /* EuroPC config, binary */
|
|
|
|
|
#define MRTC_CONF_B 0x09 /* EuroPC config, binary */
|
|
|
|
|
#define MRTC_CONF_C 0x0a /* EuroPC config, binary */
|
|
|
|
|
#define MRTC_CONF_D 0x0b /* EuroPC config, binary */
|
|
|
|
|
#define MRTC_CONF_E 0x0c /* EuroPC config, binary */
|
|
|
|
|
#define MRTC_CHECK_LO 0x0d /* Checksum, low byte */
|
|
|
|
|
#define MRTC_CHECK_HI 0x0e /* Checksum, high byte */
|
|
|
|
|
#define MRTC_CTRLSTAT 0x0f /* RTC control/status, binary */
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
uint16_t jim; /* JIM base address */
|
|
|
|
|
|
|
|
|
|
uint8_t regs[16]; /* JIM internal regs (8) */
|
|
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
nvr_t nvr; /* NVR */
|
|
|
|
|
uint8_t nvr_stat;
|
|
|
|
|
uint8_t nvr_addr;
|
2019-09-27 14:07:57 +02:00
|
|
|
|
|
|
|
|
void * mouse;
|
2018-03-13 03:46:10 +01:00
|
|
|
} europc_t;
|
2017-06-16 16:00:44 -04:00
|
|
|
|
2017-11-19 21:59:38 -05:00
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
static europc_t europc;
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
|
2018-05-21 19:04:05 +02:00
|
|
|
#ifdef ENABLE_EUROPC_LOG
|
|
|
|
|
int europc_do_log = ENABLE_EUROPC_LOG;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
europc_log(const char *fmt, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
if (europc_do_log)
|
|
|
|
|
{
|
|
|
|
|
va_start(ap, fmt);
|
|
|
|
|
pclog_ex(fmt, ap);
|
|
|
|
|
va_end(ap);
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-10-22 04:22:00 +02:00
|
|
|
#else
|
|
|
|
|
#define europc_log(fmt, ...)
|
|
|
|
|
#endif
|
2018-05-21 19:04:05 +02:00
|
|
|
|
|
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
/*
|
|
|
|
|
* This is called every second through the NVR/RTC hook.
|
|
|
|
|
*
|
|
|
|
|
* We fake a 'running' RTC by updating its registers on
|
|
|
|
|
* each passing second. Not exactly accurate, but good
|
|
|
|
|
* enough.
|
|
|
|
|
*
|
|
|
|
|
* Note that this code looks nasty because of all the
|
|
|
|
|
* BCD to decimal vv going on.
|
|
|
|
|
*
|
|
|
|
|
* FIXME: should we mark NVR as dirty?
|
|
|
|
|
*/
|
|
|
|
|
static void
|
2018-07-15 01:41:53 +02:00
|
|
|
europc_rtc_tick(nvr_t *nvr)
|
2017-08-25 23:17:45 +02:00
|
|
|
{
|
2018-03-13 03:46:10 +01:00
|
|
|
uint8_t *regs;
|
|
|
|
|
int mon, yr;
|
|
|
|
|
|
|
|
|
|
/* Only if RTC is running.. */
|
|
|
|
|
regs = nvr->regs;
|
|
|
|
|
if (! (regs[MRTC_CTRLSTAT] & 0x01)) return;
|
|
|
|
|
|
|
|
|
|
regs[MRTC_SECONDS] = RTC_BCDINC(nvr->regs[MRTC_SECONDS], 1);
|
|
|
|
|
if (regs[MRTC_SECONDS] >= RTC_BCD(60)) {
|
|
|
|
|
regs[MRTC_SECONDS] = RTC_BCD(0);
|
|
|
|
|
regs[MRTC_MINUTES] = RTC_BCDINC(regs[MRTC_MINUTES], 1);
|
|
|
|
|
if (regs[MRTC_MINUTES] >= RTC_BCD(60)) {
|
|
|
|
|
regs[MRTC_MINUTES] = RTC_BCD(0);
|
|
|
|
|
regs[MRTC_HOURS] = RTC_BCDINC(regs[MRTC_HOURS], 1);
|
|
|
|
|
if (regs[MRTC_HOURS] >= RTC_BCD(24)) {
|
|
|
|
|
regs[MRTC_HOURS] = RTC_BCD(0);
|
|
|
|
|
regs[MRTC_DAYS] = RTC_BCDINC(regs[MRTC_DAYS], 1);
|
|
|
|
|
mon = RTC_DCB(regs[MRTC_MONTHS]);
|
|
|
|
|
yr = RTC_DCB(regs[MRTC_YEARS]) + 1900;
|
|
|
|
|
if (RTC_DCB(regs[MRTC_DAYS]) > nvr_get_days(mon, yr)) {
|
|
|
|
|
regs[MRTC_DAYS] = RTC_BCD(1);
|
|
|
|
|
regs[MRTC_MONTHS] = RTC_BCDINC(regs[MRTC_MONTHS], 1);
|
|
|
|
|
if (regs[MRTC_MONTHS] > RTC_BCD(12)) {
|
|
|
|
|
regs[MRTC_MONTHS] = RTC_BCD(1);
|
|
|
|
|
regs[MRTC_YEARS] = RTC_BCDINC(regs[MRTC_YEARS], 1) & 0xff;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-11-19 21:59:38 -05:00
|
|
|
}
|
2017-08-25 23:17:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
/* Get the current NVR time. */
|
|
|
|
|
static void
|
|
|
|
|
rtc_time_get(uint8_t *regs, struct tm *tm)
|
2017-08-25 23:17:45 +02:00
|
|
|
{
|
2018-03-13 03:46:10 +01:00
|
|
|
/* NVR is in BCD data mode. */
|
|
|
|
|
tm->tm_sec = RTC_DCB(regs[MRTC_SECONDS]);
|
|
|
|
|
tm->tm_min = RTC_DCB(regs[MRTC_MINUTES]);
|
|
|
|
|
tm->tm_hour = RTC_DCB(regs[MRTC_HOURS]);
|
|
|
|
|
tm->tm_wday = (RTC_DCB(regs[MRTC_WEEKDAY]) - 1);
|
|
|
|
|
tm->tm_mday = RTC_DCB(regs[MRTC_DAYS]);
|
|
|
|
|
tm->tm_mon = (RTC_DCB(regs[MRTC_MONTHS]) - 1);
|
|
|
|
|
tm->tm_year = RTC_DCB(regs[MRTC_YEARS]);
|
|
|
|
|
#if USE_Y2K
|
|
|
|
|
tm->tm_year += (RTC_DCB(regs[MRTC_CENTURY]) * 100) - 1900;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
/* Set the current NVR time. */
|
|
|
|
|
static void
|
|
|
|
|
rtc_time_set(uint8_t *regs, struct tm *tm)
|
|
|
|
|
{
|
|
|
|
|
/* NVR is in BCD data mode. */
|
|
|
|
|
regs[MRTC_SECONDS] = RTC_BCD(tm->tm_sec);
|
|
|
|
|
regs[MRTC_MINUTES] = RTC_BCD(tm->tm_min);
|
|
|
|
|
regs[MRTC_HOURS] = RTC_BCD(tm->tm_hour);
|
|
|
|
|
regs[MRTC_WEEKDAY] = RTC_BCD(tm->tm_wday + 1);
|
|
|
|
|
regs[MRTC_DAYS] = RTC_BCD(tm->tm_mday);
|
|
|
|
|
regs[MRTC_MONTHS] = RTC_BCD(tm->tm_mon + 1);
|
|
|
|
|
regs[MRTC_YEARS] = RTC_BCD(tm->tm_year % 100);
|
|
|
|
|
#if USE_Y2K
|
|
|
|
|
regs[MRTC_CENTURY] = RTC_BCD((tm->tm_year+1900) / 100);
|
|
|
|
|
#endif
|
2017-11-19 21:59:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2018-03-13 03:46:10 +01:00
|
|
|
rtc_start(nvr_t *nvr)
|
2017-11-19 21:59:38 -05:00
|
|
|
{
|
2018-03-13 03:46:10 +01:00
|
|
|
struct tm tm;
|
|
|
|
|
|
|
|
|
|
/* Initialize the internal and chip times. */
|
2018-08-01 18:07:52 +02:00
|
|
|
if (time_sync & TIME_SYNC_ENABLED) {
|
2018-03-13 03:46:10 +01:00
|
|
|
/* Use the internal clock's time. */
|
|
|
|
|
nvr_time_get(&tm);
|
|
|
|
|
rtc_time_set(nvr->regs, &tm);
|
|
|
|
|
} else {
|
|
|
|
|
/* Set the internal clock from the chip time. */
|
|
|
|
|
rtc_time_get(nvr->regs, &tm);
|
|
|
|
|
nvr_time_set(&tm);
|
2017-11-19 21:59:38 -05:00
|
|
|
}
|
2018-03-13 03:46:10 +01:00
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
/* Start the RTC - BIOS will do this. */
|
|
|
|
|
nvr->regs[MRTC_CTRLSTAT] = 0x01;
|
2017-11-19 21:59:38 -05:00
|
|
|
#endif
|
2017-08-25 23:17:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
/* Create a valid checksum for the current NVR data. */
|
|
|
|
|
static uint8_t
|
|
|
|
|
rtc_checksum(uint8_t *ptr)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-03-13 03:46:10 +01:00
|
|
|
uint8_t sum;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
/* Calculate all bytes with XOR. */
|
|
|
|
|
sum = 0x00;
|
|
|
|
|
for (i=MRTC_CONF_A; i<=MRTC_CONF_E; i++)
|
|
|
|
|
sum += ptr[i];
|
2017-11-19 21:59:38 -05:00
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
return(sum);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Reset the machine's NVR to a sane state. */
|
|
|
|
|
static void
|
|
|
|
|
rtc_reset(nvr_t *nvr)
|
|
|
|
|
{
|
|
|
|
|
/* Initialize the RTC to a known state. */
|
|
|
|
|
nvr->regs[MRTC_SECONDS] = RTC_BCD(0); /* seconds */
|
|
|
|
|
nvr->regs[MRTC_MINUTES] = RTC_BCD(0); /* minutes */
|
|
|
|
|
nvr->regs[MRTC_HOURS] = RTC_BCD(0); /* hours */
|
|
|
|
|
nvr->regs[MRTC_DAYS] = RTC_BCD(1); /* days */
|
|
|
|
|
nvr->regs[MRTC_MONTHS] = RTC_BCD(1); /* months */
|
|
|
|
|
nvr->regs[MRTC_YEARS] = RTC_BCD(80); /* years */
|
|
|
|
|
nvr->regs[MRTC_WEEKDAY] = RTC_BCD(1); /* weekday */
|
|
|
|
|
nvr->regs[MRTC_WEEKNO] = RTC_BCD(1); /* weekno */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* EuroPC System Configuration:
|
|
|
|
|
*
|
|
|
|
|
* [A] unknown
|
|
|
|
|
*
|
|
|
|
|
* [B] 7 1 bootdrive extern
|
|
|
|
|
* 0 bootdribe intern
|
|
|
|
|
* 6:5 11 invalid hard disk type
|
|
|
|
|
* 10 hard disk installed, type 2
|
|
|
|
|
* 01 hard disk installed, type 1
|
|
|
|
|
* 00 hard disk not installed
|
|
|
|
|
* 4:3 11 invalid external drive type
|
|
|
|
|
* 10 external drive 720K
|
|
|
|
|
* 01 external drive 360K
|
|
|
|
|
* 00 external drive disabled
|
|
|
|
|
* 2 unknown
|
|
|
|
|
* 1:0 11 invalid internal drive type
|
|
|
|
|
* 10 internal drive 360K
|
|
|
|
|
* 01 internal drive 720K
|
|
|
|
|
* 00 internal drive disabled
|
|
|
|
|
*
|
|
|
|
|
* [C] 7:6 unknown
|
|
|
|
|
* 5 monitor detection OFF
|
|
|
|
|
* 4 unknown
|
|
|
|
|
* 3:2 11 illegal memory size
|
|
|
|
|
* 10 512K
|
|
|
|
|
* 01 256K
|
|
|
|
|
* 00 640K
|
|
|
|
|
* 1:0 11 illegal game port
|
|
|
|
|
* 10 gameport as mouse port
|
|
|
|
|
* 01 gameport as joysticks
|
|
|
|
|
* 00 gameport disabled
|
|
|
|
|
*
|
|
|
|
|
* [D] 7:6 10 9MHz CPU speed
|
|
|
|
|
* 01 7MHz CPU speed
|
|
|
|
|
* 00 4.77 MHz CPU
|
|
|
|
|
* 5 unknown
|
|
|
|
|
* 4 external: color, internal: mono
|
|
|
|
|
* 3 unknown
|
|
|
|
|
* 2 internal video ON
|
|
|
|
|
* 1:0 11 mono
|
|
|
|
|
* 10 color80
|
|
|
|
|
* 01 color40
|
|
|
|
|
* 00 special (EGA,VGA etc)
|
|
|
|
|
*
|
|
|
|
|
* [E] 7:4 unknown
|
|
|
|
|
* 3:0 country (00=Deutschland, 0A=ASCII)
|
|
|
|
|
*/
|
|
|
|
|
nvr->regs[MRTC_CONF_A] = 0x00; /* CONFIG A */
|
|
|
|
|
nvr->regs[MRTC_CONF_B] = 0x0A; /* CONFIG B */
|
|
|
|
|
nvr->regs[MRTC_CONF_C] = 0x28; /* CONFIG C */
|
|
|
|
|
nvr->regs[MRTC_CONF_D] = 0x12; /* CONFIG D */
|
|
|
|
|
nvr->regs[MRTC_CONF_E] = 0x0A; /* CONFIG E */
|
|
|
|
|
|
|
|
|
|
nvr->regs[MRTC_CHECK_LO] = 0x00; /* checksum (LO) */
|
|
|
|
|
nvr->regs[MRTC_CHECK_HI] = 0x00; /* checksum (HI) */
|
|
|
|
|
|
|
|
|
|
nvr->regs[MRTC_CTRLSTAT] = 0x01; /* status/control */
|
|
|
|
|
|
|
|
|
|
/* Generate a valid checksum. */
|
|
|
|
|
nvr->regs[MRTC_CHECK_LO] = rtc_checksum(nvr->regs);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2017-06-16 16:00:44 -04:00
|
|
|
|
2017-11-19 21:59:38 -05:00
|
|
|
/* Execute a JIM control command. */
|
|
|
|
|
static void
|
2018-03-13 03:46:10 +01:00
|
|
|
jim_set(europc_t *sys, uint8_t reg, uint8_t val)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2017-11-19 21:59:38 -05:00
|
|
|
switch(reg) {
|
|
|
|
|
case 0: /* MISC control (WO) */
|
|
|
|
|
// bit0: enable MOUSE
|
|
|
|
|
// bit1: enable joystick
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2: /* AGA control */
|
|
|
|
|
if (! (val & 0x80)) {
|
|
|
|
|
/* Reset AGA. */
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (val) {
|
|
|
|
|
case 0x1f: /* 0001 1111 */
|
|
|
|
|
case 0x0b: /* 0000 1011 */
|
|
|
|
|
//europc_jim.mode=AGA_MONO;
|
2018-05-21 19:04:05 +02:00
|
|
|
europc_log("EuroPC: AGA Monochrome mode!\n");
|
2017-11-19 21:59:38 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x18: /* 0001 1000 */
|
|
|
|
|
case 0x1a: /* 0001 1010 */
|
|
|
|
|
//europc_jim.mode=AGA_COLOR;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x0e: /* 0000 1100 */
|
|
|
|
|
/*80 columns? */
|
2018-05-21 19:04:05 +02:00
|
|
|
europc_log("EuroPC: AGA 80-column mode!\n");
|
2017-11-19 21:59:38 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x0d: /* 0000 1011 */
|
|
|
|
|
/*40 columns? */
|
2018-05-21 19:04:05 +02:00
|
|
|
europc_log("EuroPC: AGA 40-column mode!\n");
|
2017-11-19 21:59:38 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
//europc_jim.mode=AGA_OFF;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 4: /* CPU Speed control */
|
|
|
|
|
switch(val & 0xc0) {
|
|
|
|
|
case 0x00: /* 4.77 MHz */
|
|
|
|
|
// cpu_set_clockscale(0, 1.0/2);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x40: /* 7.16 MHz */
|
|
|
|
|
// cpu_set_clockscale(0, 3.0/4);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default: /* 9.54 MHz */
|
|
|
|
|
// cpu_set_clockscale(0, 1);break;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sys->regs[reg] = val;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2017-06-16 16:00:44 -04:00
|
|
|
|
2017-11-19 21:59:38 -05:00
|
|
|
/* Write to one of the JIM registers. */
|
|
|
|
|
static void
|
|
|
|
|
jim_write(uint16_t addr, uint8_t val, void *priv)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-03-13 03:46:10 +01:00
|
|
|
europc_t *sys = (europc_t *)priv;
|
2017-11-19 21:59:38 -05:00
|
|
|
uint8_t b;
|
|
|
|
|
|
|
|
|
|
#if EUROPC_DEBUG > 1
|
2018-05-21 19:04:05 +02:00
|
|
|
europc_log("EuroPC: jim_wr(%04x, %02x)\n", addr, val);
|
2017-11-19 21:59:38 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
switch (addr & 0x000f) {
|
|
|
|
|
case 0x00: /* JIM internal registers (WRONLY) */
|
|
|
|
|
case 0x01:
|
|
|
|
|
case 0x02:
|
|
|
|
|
case 0x03:
|
|
|
|
|
case 0x04: /* JIM internal registers (R/W) */
|
|
|
|
|
case 0x05:
|
|
|
|
|
case 0x06:
|
|
|
|
|
case 0x07:
|
2018-03-13 03:46:10 +01:00
|
|
|
jim_set(sys, (addr & 0x07), val);
|
2017-11-19 21:59:38 -05:00
|
|
|
break;
|
|
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
case 0x0a: /* M3002 RTC INDEX/DATA register */
|
|
|
|
|
switch(sys->nvr_stat) {
|
2017-11-19 21:59:38 -05:00
|
|
|
case 0: /* save index */
|
2018-03-13 03:46:10 +01:00
|
|
|
sys->nvr_addr = val & 0x0f;
|
|
|
|
|
sys->nvr_stat++;
|
2017-11-19 21:59:38 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 1: /* save data HI nibble */
|
2018-03-13 03:46:10 +01:00
|
|
|
b = sys->nvr.regs[sys->nvr_addr] & 0x0f;
|
2017-11-19 21:59:38 -05:00
|
|
|
b |= (val << 4);
|
2018-03-13 03:46:10 +01:00
|
|
|
sys->nvr.regs[sys->nvr_addr] = b;
|
|
|
|
|
sys->nvr_stat++;
|
|
|
|
|
nvr_dosave++;
|
2017-11-19 21:59:38 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2: /* save data LO nibble */
|
2018-03-13 03:46:10 +01:00
|
|
|
b = sys->nvr.regs[sys->nvr_addr] & 0xf0;
|
2017-11-19 21:59:38 -05:00
|
|
|
b |= (val & 0x0f);
|
2018-03-13 03:46:10 +01:00
|
|
|
sys->nvr.regs[sys->nvr_addr] = b;
|
|
|
|
|
sys->nvr_stat = 0;
|
|
|
|
|
nvr_dosave++;
|
2017-11-19 21:59:38 -05:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
2018-05-21 19:04:05 +02:00
|
|
|
europc_log("EuroPC: invalid JIM write %02x, val %02x\n", addr, val);
|
2017-11-19 21:59:38 -05:00
|
|
|
break;
|
|
|
|
|
}
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
2017-09-02 20:39:57 +02:00
|
|
|
|
|
|
|
|
|
2017-11-19 21:59:38 -05:00
|
|
|
/* Read from one of the JIM registers. */
|
|
|
|
|
static uint8_t
|
|
|
|
|
jim_read(uint16_t addr, void *priv)
|
|
|
|
|
{
|
2018-03-13 03:46:10 +01:00
|
|
|
europc_t *sys = (europc_t *)priv;
|
2017-11-19 21:59:38 -05:00
|
|
|
uint8_t r = 0xff;
|
|
|
|
|
|
|
|
|
|
switch (addr & 0x000f) {
|
|
|
|
|
case 0x00: /* JIM internal registers (WRONLY) */
|
|
|
|
|
case 0x01:
|
|
|
|
|
case 0x02:
|
|
|
|
|
case 0x03:
|
|
|
|
|
r = 0x00;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x04: /* JIM internal registers (R/W) */
|
|
|
|
|
case 0x05:
|
|
|
|
|
case 0x06:
|
|
|
|
|
case 0x07:
|
|
|
|
|
r = sys->regs[addr & 0x07];
|
|
|
|
|
break;
|
|
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
case 0x0a: /* M3002 RTC INDEX/DATA register */
|
|
|
|
|
switch(sys->nvr_stat) {
|
2017-11-19 21:59:38 -05:00
|
|
|
case 0:
|
|
|
|
|
r = 0x00;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 1: /* read data HI nibble */
|
2018-03-13 03:46:10 +01:00
|
|
|
r = (sys->nvr.regs[sys->nvr_addr] >> 4);
|
|
|
|
|
sys->nvr_stat++;
|
2017-11-19 21:59:38 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2: /* read data LO nibble */
|
2018-03-13 03:46:10 +01:00
|
|
|
r = (sys->nvr.regs[sys->nvr_addr] & 0x0f);
|
|
|
|
|
sys->nvr_stat = 0;
|
2017-11-19 21:59:38 -05:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
2018-05-21 19:04:05 +02:00
|
|
|
europc_log("EuroPC: invalid JIM read %02x\n", addr);
|
2017-11-19 21:59:38 -05:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if EUROPC_DEBUG > 1
|
2018-05-21 19:04:05 +02:00
|
|
|
europc_log("EuroPC: jim_rd(%04x): %02x\n", addr, r);
|
2017-11-19 21:59:38 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return(r);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
/* Initialize the mainboard 'device' of the machine. */
|
2017-11-19 21:59:38 -05:00
|
|
|
static void *
|
2018-03-19 01:02:04 +01:00
|
|
|
europc_boot(const device_t *info)
|
2017-11-19 21:59:38 -05:00
|
|
|
{
|
2018-03-13 03:46:10 +01:00
|
|
|
europc_t *sys = &europc;
|
2017-11-19 21:59:38 -05:00
|
|
|
uint8_t b;
|
|
|
|
|
|
|
|
|
|
#if EUROPC_DEBUG
|
2018-05-21 19:04:05 +02:00
|
|
|
europc_log("EuroPC: booting mainboard..\n");
|
2017-11-19 21:59:38 -05:00
|
|
|
#endif
|
|
|
|
|
|
2018-05-21 19:04:05 +02:00
|
|
|
europc_log("EuroPC: NVR=[ %02x %02x %02x %02x %02x ] %sVALID\n",
|
2018-03-13 03:46:10 +01:00
|
|
|
sys->nvr.regs[MRTC_CONF_A], sys->nvr.regs[MRTC_CONF_B],
|
|
|
|
|
sys->nvr.regs[MRTC_CONF_C], sys->nvr.regs[MRTC_CONF_D],
|
|
|
|
|
sys->nvr.regs[MRTC_CONF_E],
|
|
|
|
|
(sys->nvr.regs[MRTC_CHECK_LO]!=rtc_checksum(sys->nvr.regs))?"IN":"");
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Now that we have initialized the NVR (either from file,
|
|
|
|
|
* or by setting it to defaults) we can start overriding it
|
2018-03-13 03:46:10 +01:00
|
|
|
* with values set by the user.
|
2017-11-19 21:59:38 -05:00
|
|
|
*/
|
2018-03-13 03:46:10 +01:00
|
|
|
b = (sys->nvr.regs[MRTC_CONF_D] & ~0x17);
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
video_reset(gfxcard);
|
2018-09-19 20:13:32 +02:00
|
|
|
if (video_is_cga())
|
|
|
|
|
b |= 0x12; /* external video, CGA80 */
|
|
|
|
|
else if (video_is_mda())
|
|
|
|
|
b |= 0x03; /* external video, mono */
|
|
|
|
|
else
|
|
|
|
|
b |= 0x10; /* external video, special */
|
2017-11-19 21:59:38 -05:00
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
sys->nvr.regs[MRTC_CONF_D] = b;
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
/* Update the memory size. */
|
2018-03-13 03:46:10 +01:00
|
|
|
b = (sys->nvr.regs[MRTC_CONF_C] & 0xf3);
|
2017-11-19 21:59:38 -05:00
|
|
|
switch(mem_size) {
|
|
|
|
|
case 256:
|
|
|
|
|
b |= 0x04;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 512:
|
|
|
|
|
b |= 0x08;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 640:
|
|
|
|
|
b |= 0x00;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2018-03-13 03:46:10 +01:00
|
|
|
sys->nvr.regs[MRTC_CONF_C] = b;
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
/* Update CPU speed. */
|
2018-03-13 03:46:10 +01:00
|
|
|
b = (sys->nvr.regs[MRTC_CONF_D] & 0x3f);
|
2017-11-19 21:59:38 -05:00
|
|
|
switch(cpu) {
|
|
|
|
|
case 0: /* 8088, 4.77 MHz */
|
|
|
|
|
b |= 0x00;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 1: /* 8088, 7.15 MHz */
|
|
|
|
|
b |= 0x40;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2: /* 8088, 9.56 MHz */
|
|
|
|
|
b |= 0x80;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2018-03-13 03:46:10 +01:00
|
|
|
sys->nvr.regs[MRTC_CONF_D] = b;
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
/* Set up game port. */
|
2018-03-13 03:46:10 +01:00
|
|
|
b = (sys->nvr.regs[MRTC_CONF_C] & 0xfc);
|
2019-09-27 14:07:57 +02:00
|
|
|
if (mouse_type == MOUSE_TYPE_INTERNAL) {
|
|
|
|
|
sys->mouse = device_add(&mouse_logibus_onboard_device);
|
2019-09-27 14:15:44 +02:00
|
|
|
mouse_bus_set_irq(sys->mouse, 2);
|
2019-09-27 14:07:57 +02:00
|
|
|
/* Configure the port for (Bus Mouse Compatible) Mouse. */
|
|
|
|
|
b |= 0x01;
|
2020-12-04 22:05:26 +05:00
|
|
|
} else if (joystick_type)
|
2017-11-19 21:59:38 -05:00
|
|
|
b |= 0x02; /* enable port as joysticks */
|
2018-03-13 03:46:10 +01:00
|
|
|
sys->nvr.regs[MRTC_CONF_C] = b;
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
/* Set up floppy types. */
|
2018-03-13 03:46:10 +01:00
|
|
|
sys->nvr.regs[MRTC_CONF_B] = 0x2a;
|
2017-11-19 21:59:38 -05:00
|
|
|
#endif
|
|
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
/* Validate the NVR checksum and save. */
|
|
|
|
|
sys->nvr.regs[MRTC_CHECK_LO] = rtc_checksum(sys->nvr.regs);
|
|
|
|
|
nvr_dosave++;
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Allocate the system's I/O handlers.
|
|
|
|
|
*
|
|
|
|
|
* The first one is for the JIM. Note that although JIM usually
|
|
|
|
|
* resides at 0x0250, a special solder jumper on the mainboard
|
|
|
|
|
* (JS9) can be used to "move" it to 0x0350, to get it out of
|
|
|
|
|
* the way of other cards that need this range.
|
|
|
|
|
*/
|
|
|
|
|
io_sethandler(sys->jim, 16,
|
2018-03-13 03:46:10 +01:00
|
|
|
jim_read,NULL,NULL, jim_write,NULL,NULL, sys);
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
/* Only after JIM has been initialized. */
|
2018-03-13 03:46:10 +01:00
|
|
|
(void)device_add(&keyboard_xt_device);
|
2017-11-19 21:59:38 -05:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
/* Enable and set up the FDC. */
|
|
|
|
|
(void)device_add(&fdc_xt_device);
|
|
|
|
|
|
|
|
|
|
/*
|
2017-11-19 21:59:38 -05:00
|
|
|
* Set up and enable the HD20 disk controller.
|
|
|
|
|
*
|
|
|
|
|
* We only do this if we have not configured another one.
|
|
|
|
|
*/
|
|
|
|
|
if (hdc_current == 1)
|
2018-04-25 23:51:13 +02:00
|
|
|
(void)device_add(&xta_hd20_device);
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
return(sys);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
europc_close(void *priv)
|
|
|
|
|
{
|
2018-03-13 03:46:10 +01:00
|
|
|
nvr_t *nvr = &europc.nvr;
|
2017-11-19 21:59:38 -05:00
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
if (nvr->fn != NULL)
|
|
|
|
|
free(nvr->fn);
|
2017-11-19 21:59:38 -05:00
|
|
|
}
|
|
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
static const device_config_t europc_config[] = {
|
2017-11-19 21:59:38 -05:00
|
|
|
{
|
2022-03-13 09:46:07 -04:00
|
|
|
.name = "js9",
|
|
|
|
|
.description = "JS9 Jumper (JIM)",
|
|
|
|
|
.type = CONFIG_INT,
|
|
|
|
|
.default_string = "",
|
|
|
|
|
.default_int = 0,
|
|
|
|
|
.file_filter = "",
|
|
|
|
|
.spinner = { 0 },
|
|
|
|
|
.selection = {
|
|
|
|
|
{ .description = "Disabled (250h)", .value = 0 },
|
|
|
|
|
{ .description = "Enabled (350h)", .value = 1 },
|
2022-04-02 18:14:24 -04:00
|
|
|
{ .description = "" }
|
2022-03-13 09:46:07 -04:00
|
|
|
},
|
2017-11-19 21:59:38 -05:00
|
|
|
},
|
2022-04-02 18:14:24 -04:00
|
|
|
{ .name = "", .description = "", .type = CONFIG_END }
|
2017-11-19 21:59:38 -05:00
|
|
|
};
|
|
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
const device_t europc_device = {
|
2022-03-13 09:46:07 -04:00
|
|
|
.name = "EuroPC System Board",
|
|
|
|
|
.internal_name = "europc",
|
|
|
|
|
.flags = 0,
|
|
|
|
|
.local = 0,
|
|
|
|
|
.init = europc_boot,
|
|
|
|
|
.close = europc_close,
|
|
|
|
|
.reset = NULL,
|
|
|
|
|
{ .available = NULL },
|
|
|
|
|
.speed_changed = NULL,
|
|
|
|
|
.force_redraw = NULL,
|
|
|
|
|
.config = europc_config
|
2017-11-19 21:59:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* This function sets up the Scheider EuroPC machine.
|
|
|
|
|
*
|
|
|
|
|
* Its task is to allocate a clean machine data block,
|
|
|
|
|
* and then simply enable the mainboard "device" which
|
|
|
|
|
* allows it to reset (dev init) and configured by the
|
|
|
|
|
* user.
|
|
|
|
|
*/
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
int
|
2018-03-19 01:02:04 +01:00
|
|
|
machine_europc_init(const machine_t *model)
|
2017-09-02 20:39:57 +02:00
|
|
|
{
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
int ret;
|
|
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
ret = bios_load_linear("roms/machines/europc/50145",
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
0x000f8000, 32768, 0);
|
|
|
|
|
|
|
|
|
|
if (bios_only || !ret)
|
|
|
|
|
return ret;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
machine_common_init(model);
|
2019-12-02 07:05:12 +01:00
|
|
|
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
2019-02-11 01:36:22 +01:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
nmi_init();
|
|
|
|
|
|
2018-03-13 03:46:10 +01:00
|
|
|
/* Clear the machine state. */
|
|
|
|
|
memset(&europc, 0x00, sizeof(europc_t));
|
|
|
|
|
europc.jim = 0x0250;
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
/* This is machine specific. */
|
2018-03-13 03:46:10 +01:00
|
|
|
europc.nvr.size = model->nvrmask + 1;
|
|
|
|
|
europc.nvr.irq = -1;
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
/* Set up any local handlers here. */
|
2018-03-13 03:46:10 +01:00
|
|
|
europc.nvr.reset = rtc_reset;
|
|
|
|
|
europc.nvr.start = rtc_start;
|
2018-07-15 01:41:53 +02:00
|
|
|
europc.nvr.tick = europc_rtc_tick;
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
/* Initialize the actual NVR. */
|
2018-03-13 03:46:10 +01:00
|
|
|
nvr_init(&europc.nvr);
|
2017-11-19 21:59:38 -05:00
|
|
|
|
|
|
|
|
/* Enable and set up the mainboard device. */
|
|
|
|
|
device_add(&europc_device);
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
|
|
|
|
|
return ret;
|
2017-09-02 20:39:57 +02:00
|
|
|
}
|