Added 8088-1 (10MHz) CPU support.
Added presetting a filename for NVR (so cards can use that.) Updated some more translation files for STR_3480 and STR_3481. Added a new card: ISA-based Clock/RTC cards for PC/XT systems. Un-did previous change to XT ST506 driver.
This commit is contained in:
12
src/config.c
12
src/config.c
@@ -12,7 +12,7 @@
|
||||
* it on Windows XP, and possibly also Vista. Use the
|
||||
* -DANSI_CFG for use on these systems.
|
||||
*
|
||||
* Version: @(#)config.c 1.0.31 2018/08/18
|
||||
* Version: @(#)config.c 1.0.32 2018/08/27
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -54,6 +54,7 @@
|
||||
#include "nvr.h"
|
||||
#include "device.h"
|
||||
#include "devices/misc/isamem.h"
|
||||
#include "devices/misc/isartc.h"
|
||||
#include "devices/ports/game_dev.h"
|
||||
#include "devices/ports/serial.h"
|
||||
#include "devices/ports/parallel.h"
|
||||
@@ -850,6 +851,9 @@ load_other(const char *cat)
|
||||
isamem_type[c] = isamem_get_from_internal_name(p);
|
||||
}
|
||||
|
||||
p = config_get_string(cat, "isartc_type", "none");
|
||||
isartc_type = isartc_get_from_internal_name(p);
|
||||
|
||||
#ifdef WALTJE
|
||||
romdos_enabled = !!config_get_int(cat, "romdos_enabled", 0);
|
||||
#endif
|
||||
@@ -894,6 +898,12 @@ save_other(const char *cat)
|
||||
isamem_get_internal_name(isamem_type[c]));
|
||||
}
|
||||
|
||||
if (isartc_type == 0)
|
||||
config_delete_var(cat, "isartc_type");
|
||||
else
|
||||
config_set_string(cat, "isartc_type",
|
||||
isartc_get_internal_name(isartc_type));
|
||||
|
||||
delete_section_if_empty(cat);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Define all known processor types.
|
||||
*
|
||||
* Version: @(#)cpu_table.c 1.0.3 2018/07/28
|
||||
* Version: @(#)cpu_table.c 1.0.4 2018/04/29
|
||||
*
|
||||
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -51,7 +51,9 @@ CPU cpus_8088[] = {
|
||||
{"8088/8", CPU_8088, 1, 8000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 1},
|
||||
#if 0
|
||||
{"8088/7.16", CPU_8088, 1, 14318184/2, 1, 0, 0, 0, 0, 0, 0,0,0,0, 1},
|
||||
#endif
|
||||
{"8088/10", CPU_8088, 2, 10000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 1},
|
||||
#if 0
|
||||
{"8088/12", CPU_8088, 3, 12000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 1},
|
||||
{"8088/16", CPU_8088, 4, 16000000, 1, 0, 0, 0, 0, 0, 0,0,0,0, 1},
|
||||
#endif
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
* Since all controllers (including the ones made by DTC) use
|
||||
* (mostly) the same API, we keep them all in this module.
|
||||
*
|
||||
* Version: @(#)hdc_st506_xt.c 1.0.11 2018/08/23
|
||||
* Version: @(#)hdc_st506_xt.c 1.0.12 2018/08/27
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
@@ -819,40 +819,42 @@ loadhd(hdc_t *dev, int c, int d, const wchar_t *fn)
|
||||
static const struct {
|
||||
uint16_t tracks;
|
||||
uint8_t hpc;
|
||||
uint8_t spt;
|
||||
} hd_types[4] = {
|
||||
{ 306, 4 }, /* Type 0 */
|
||||
{ 612, 4 }, /* Type 16 */
|
||||
{ 615, 4 }, /* Type 2 */
|
||||
{ 306, 8 } /* Type 13 */
|
||||
{ 306, 4, 17 }, /* Type 0 */
|
||||
{ 612, 4, 17 }, /* Type 16 */
|
||||
{ 615, 4, 17 }, /* Type 2 */
|
||||
{ 306, 8, 17 } /* Type 13 */
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
st506_set_switches(hdc_t *dev)
|
||||
{
|
||||
drive_t *drive;
|
||||
int c, d;
|
||||
|
||||
|
||||
dev->switches = 0;
|
||||
|
||||
for (d=0; d<2; d++) {
|
||||
drive_t *drive = &dev->drives[d];
|
||||
|
||||
for (d = 0; d < 2; d++) {
|
||||
drive = &dev->drives[d];
|
||||
|
||||
if (! drive->present) continue;
|
||||
|
||||
for (c=0; c<4; c++) {
|
||||
if (drive->spt == 17 &&
|
||||
drive->hpc == hd_types[c].hpc &&
|
||||
drive->tracks == hd_types[c].tracks) {
|
||||
dev->switches |= (c << (d * 2));
|
||||
for (c = 0; c < 4; c++) {
|
||||
if ((drive->spt == hd_types[c].spt) &&
|
||||
(drive->hpc == hd_types[c].hpc) &&
|
||||
(drive->tracks == hd_types[c].tracks)) {
|
||||
dev->switches |= (c << (d ? 0 : 2));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pclog("ST506: ");
|
||||
if (c == 4)
|
||||
pclog("*WARNING* drive %d has unsupported format", d);
|
||||
pclog("*WARNING* drive%d unsupported", d);
|
||||
else
|
||||
pclog("drive %d is type %d", d, c);
|
||||
pclog("drive%d is type %d", d, c);
|
||||
pclog(" (%d/%d/%d)\n", drive->tracks, drive->hpc, drive->spt);
|
||||
}
|
||||
}
|
||||
@@ -872,7 +874,7 @@ st506_init(const device_t *info)
|
||||
hdc_log("ST506: looking for disks..\n");
|
||||
#endif
|
||||
c = 0;
|
||||
for (i=0; i<HDD_NUM; i++) {
|
||||
for (i = 0; i < HDD_NUM; i++) {
|
||||
if ((hdd[i].bus == HDD_BUS_ST506) && (hdd[i].id.st506_channel < ST506_NUM)) {
|
||||
#ifdef ENABLE_HDC_LOG
|
||||
hdc_log("Found ST506 hard disk on channel %i\n", hdd[i].id.st506_channel);
|
||||
@@ -920,7 +922,7 @@ st506_close(void *priv)
|
||||
hdc_t *dev = (hdc_t *)priv;
|
||||
int d;
|
||||
|
||||
for (d=0; d<2; d++) {
|
||||
for (d = 0; d < 2; d++) {
|
||||
drive_t *drive = &dev->drives[d];
|
||||
|
||||
hdd_image_close(drive->hdd_num);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
* 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..
|
||||
*
|
||||
* Version: @(#)isamem.c 1.0.1 2018/08/18
|
||||
* Version: @(#)isamem.c 1.0.2 2018/08/27
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
@@ -448,18 +448,25 @@ dev->frame_addr = 0xE0000;
|
||||
|
||||
/* Say hello! */
|
||||
pclog("ISAMEM: %s (%iKB", info->name, dev->total_size);
|
||||
if (dev->total_size != tot) pclog(", %iKB for RAM", tot);
|
||||
if (tot && (dev->total_size != tot))
|
||||
pclog(", %iKB for RAM", tot);
|
||||
if (dev->flags & FLAG_FAST) pclog(", FAST");
|
||||
if (dev->flags & FLAG_WIDE) pclog(", 16BIT");
|
||||
pclog(")\n");
|
||||
|
||||
/* Force (back to) 8-bit bus if needed. */
|
||||
if (AT) {
|
||||
if (! cpu_16bitbus)
|
||||
pclog("ISAMEM: *WARNING* this board will slow down your PC!\n");
|
||||
if (dev->flags & FLAG_WIDE) {
|
||||
if (AT) {
|
||||
if (! cpu_16bitbus)
|
||||
pclog("ISAMEM: *WARNING* this board will slow down your PC!\n");
|
||||
} else {
|
||||
pclog("ISAMEM: not AT+ system, forcing 8-bit mode!\n");
|
||||
dev->flags &= ~FLAG_WIDE;
|
||||
}
|
||||
} else {
|
||||
pclog("ISAMEM: not AT+ system, forcing 8-bit mode!\n");
|
||||
dev->flags &= ~FLAG_WIDE;
|
||||
if (AT) {
|
||||
pclog("ISAMEM: *WARNING* this board will slow down your PC!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate and initialize our RAM. */
|
||||
@@ -624,7 +631,7 @@ dev->frame_addr = 0xE0000;
|
||||
}
|
||||
}
|
||||
|
||||
/* Just so its not NULL. */
|
||||
/* Let them know our device instance. */
|
||||
return((void *)dev);
|
||||
}
|
||||
|
||||
@@ -659,7 +666,7 @@ static const device_config_t ibmxt_config[] =
|
||||
"size", "Memory Size", CONFIG_SPINNER, "", 128,
|
||||
{ { 0 } },
|
||||
{ { 0 } },
|
||||
{ 0, 256, 16 }
|
||||
{ 0, 512, 16 }
|
||||
},
|
||||
{
|
||||
"start", "Start Address", CONFIG_SPINNER, "", 256,
|
||||
|
||||
683
src/devices/misc/isartc.c
Normal file
683
src/devices/misc/isartc.c
Normal file
@@ -0,0 +1,683 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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)
|
||||
*
|
||||
* 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 :)
|
||||
*
|
||||
* Version: @(#)isartc.c 1.0.1 2018/08/28
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* 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:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../../emu.h"
|
||||
#include "../../cpu/cpu.h"
|
||||
#include "../../machines/machine.h"
|
||||
#include "../../io.h"
|
||||
#include "../../device.h"
|
||||
#include "../../nvr.h"
|
||||
#include "../../ui/ui.h"
|
||||
#include "../../plat.h"
|
||||
#include "../system/pic.h"
|
||||
#include "isartc.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
const char *name; /* board name */
|
||||
uint8_t board; /* board type */
|
||||
|
||||
uint8_t flags; /* various flags */
|
||||
#define FLAG_YEAR80 0x01 /* YEAR byte is base-80 */
|
||||
#define FLAG_YEARBCD 0x02 /* YEAR byte is in BCD */
|
||||
|
||||
int8_t irq; /* configured IRQ channel */
|
||||
int8_t base_addrsz;
|
||||
uint32_t base_addr; /* configured I/O address */
|
||||
|
||||
/* Fields for the specific driver. */
|
||||
void (*f_wr)(uint16_t, uint8_t, void *);
|
||||
uint8_t (*f_rd)(uint16_t, void *);
|
||||
uint8_t year; /* register for YEAR value */
|
||||
char pad[3];
|
||||
|
||||
nvr_t nvr; /* RTC/NVR */
|
||||
} rtcdev_t;
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Driver for the NatSemi MM58167 chip. *
|
||||
* *
|
||||
************************************************************************/
|
||||
#define MM67_REGS 32
|
||||
|
||||
/* Define the RTC chip registers - see datasheet, pg4. */
|
||||
#define MM67_MSEC 0 /* milliseconds */
|
||||
#define MM67_HUNTEN 1 /* hundredths/tenths of seconds */
|
||||
#define MM67_SEC 2 /* seconds */
|
||||
#define MM67_MIN 3 /* minutes */
|
||||
#define MM67_HOUR 4 /* hours */
|
||||
#define MM67_DOW 5 /* day of the week */
|
||||
#define MM67_DOM 6 /* day of the month */
|
||||
#define MM67_MON 7 /* month */
|
||||
#define MM67_AL_MSEC 8 /* milliseconds */
|
||||
#define MM67_AL_HUNTEN 9 /* hundredths/tenths of seconds */
|
||||
#define MM67_AL_SEC 10 /* seconds */
|
||||
#define MM67_AL_MIN 11 /* minutes */
|
||||
#define MM67_AL_HOUR 12 /* hours */
|
||||
#define MM67_AL_DOW 13 /* day of the week */
|
||||
#define MM67_AL_DOM 14 /* day of the month */
|
||||
#define MM67_AL_MON 15 /* month */
|
||||
# define MM67_AL_DONTCARE 0xc0 /* always match in compare */
|
||||
#define MM67_ISTAT 16 /* IRQ status */
|
||||
#define MM67_ICTRL 17 /* IRQ control */
|
||||
# define MM67INT_MON 0x01 /* Month */
|
||||
# define MM67INT_WEEK 0x02 /* Week */
|
||||
# define MM67INT_DAY 0x04 /* Day */
|
||||
# define MM67INT_HOUR 0x08 /* Hour */
|
||||
# define MM67INT_MIN 0x10 /* Minute */
|
||||
# define MM67INT_SEC 0x20 /* Second */
|
||||
# define MM67INT_TENTH 0x40 /* Tenth */
|
||||
# define MM67INT_COMPARE 0x80 /* Compare */
|
||||
#define MM67_RSTCTR 18 /* reset counters */
|
||||
#define MM67_RSTRAM 19 /* reset RAM */
|
||||
#define MM67_STATUS 20 /* status bit */
|
||||
#define MM67_GOCMD 21 /* GO Command */
|
||||
#define MM67_STBYIRQ 22 /* standby IRQ */
|
||||
#define MM67_TEST 31 /* test mode */
|
||||
|
||||
|
||||
/* Check if the current time matches a set alarm time. */
|
||||
static int8_t
|
||||
mm67_chkalrm(nvr_t *nvr, int8_t addr)
|
||||
{
|
||||
return((nvr->regs[addr+8] == nvr->regs[addr]) ||
|
||||
((nvr->regs[addr+8] & MM67_AL_DONTCARE) == MM67_AL_DONTCARE));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
static void
|
||||
mm67_tick(nvr_t *nvr)
|
||||
{
|
||||
rtcdev_t *dev = (rtcdev_t *)nvr->data;
|
||||
uint8_t *regs = nvr->regs;
|
||||
int mon, year, f = 0;
|
||||
|
||||
regs[MM67_SEC] = RTC_BCDINC(nvr->regs[MM67_SEC], 1);
|
||||
if (regs[MM67_SEC] >= RTC_BCD(60)) {
|
||||
/* Set interrupt if needed. */
|
||||
if (regs[MM67_ICTRL] & MM67INT_SEC) f = MM67INT_SEC;
|
||||
|
||||
/* Roll over. */
|
||||
regs[MM67_SEC] = RTC_BCD(0);
|
||||
regs[MM67_MIN] = RTC_BCDINC(regs[MM67_MIN], 1);
|
||||
if (regs[MM67_MIN] >= RTC_BCD(60)) {
|
||||
/* Set interrupt if needed. */
|
||||
if (regs[MM67_ICTRL] & MM67INT_MIN) f = MM67INT_MIN;
|
||||
|
||||
/* Roll over. */
|
||||
regs[MM67_MIN] = RTC_BCD(0);
|
||||
regs[MM67_HOUR] = RTC_BCDINC(regs[MM67_HOUR], 1);
|
||||
if (regs[MM67_HOUR] >= RTC_BCD(24)) {
|
||||
/* Set interrupt if needed. */
|
||||
if (regs[MM67_ICTRL] & MM67INT_HOUR) f = MM67INT_HOUR;
|
||||
|
||||
/* Roll over. */
|
||||
regs[MM67_HOUR] = RTC_BCD(0);
|
||||
regs[MM67_DOW] = RTC_BCDINC(regs[MM67_DOW], 1);
|
||||
if (regs[MM67_DOW] > RTC_BCD(7)) {
|
||||
/* Roll over. */
|
||||
regs[MM67_DOW] = RTC_BCD(1);
|
||||
|
||||
/* Set interrupt if needed. */
|
||||
if (regs[MM67_ICTRL] & MM67INT_WEEK) f = MM67INT_WEEK;
|
||||
}
|
||||
|
||||
regs[MM67_DOM] = RTC_BCDINC(regs[MM67_DOM], 1);
|
||||
mon = RTC_DCB(regs[MM67_MON]);
|
||||
if (dev->year != -1) {
|
||||
year = RTC_DCB(regs[dev->year]);
|
||||
if (dev->flags & FLAG_YEAR80)
|
||||
year += 80;
|
||||
} else
|
||||
year = 80;
|
||||
year += 1900;
|
||||
if (RTC_DCB(regs[MM67_DOM]) > nvr_get_days(mon, year)) {
|
||||
/* Set interrupt if needed. */
|
||||
if (regs[MM67_ICTRL] & MM67INT_DAY) f = MM67INT_DAY;
|
||||
|
||||
/* Roll over. */
|
||||
regs[MM67_DOM] = RTC_BCD(1);
|
||||
regs[MM67_MON] = RTC_BCDINC(regs[MM67_MON], 1);
|
||||
if (regs[MM67_MON] > RTC_BCD(12)) {
|
||||
/* Set interrupt if needed. */
|
||||
if (regs[MM67_ICTRL] & MM67INT_MON) f = MM67INT_MON;
|
||||
|
||||
/* Roll over. */
|
||||
regs[MM67_MON] = RTC_BCD(1);
|
||||
if (dev->year != -1) {
|
||||
year++;
|
||||
if (dev->flags & FLAG_YEAR80)
|
||||
year -= 80;
|
||||
|
||||
if (dev->flags & FLAG_YEARBCD)
|
||||
regs[dev->year] = RTC_BCD(year % 100);
|
||||
else
|
||||
regs[dev->year] = year % 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for programmed alarm interrupt. */
|
||||
if (regs[MM67_ICTRL] & MM67INT_COMPARE) {
|
||||
for (mon = MM67_SEC; mon <= MM67_MON; mon++) {
|
||||
if (mm67_chkalrm(nvr, mon))
|
||||
f |= MM67INT_COMPARE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Raise the IRQ if needed (and if we have one..) */
|
||||
if (f != 0) {
|
||||
regs[MM67_ISTAT] = f;
|
||||
if (nvr->irq != -1)
|
||||
picint(1 << nvr->irq);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Get the current NVR time. */
|
||||
static void
|
||||
mm67_time_get(nvr_t *nvr, struct tm *tm)
|
||||
{
|
||||
rtcdev_t *dev = (rtcdev_t *)nvr->data;
|
||||
uint8_t *regs = nvr->regs;
|
||||
|
||||
/* NVR is in BCD data mode. */
|
||||
tm->tm_sec = RTC_DCB(regs[MM67_SEC]);
|
||||
tm->tm_min = RTC_DCB(regs[MM67_MIN]);
|
||||
tm->tm_hour = RTC_DCB(regs[MM67_HOUR]);
|
||||
tm->tm_wday = (RTC_DCB(regs[MM67_DOW]) - 1);
|
||||
tm->tm_mday = RTC_DCB(regs[MM67_DOM]);
|
||||
tm->tm_mon = (RTC_DCB(regs[MM67_MON]) - 1);
|
||||
if (dev->year != -1) {
|
||||
if (dev->flags & FLAG_YEARBCD)
|
||||
tm->tm_year = RTC_DCB(regs[dev->year]);
|
||||
else
|
||||
tm->tm_year = regs[dev->year];
|
||||
if (dev->flags & FLAG_YEAR80)
|
||||
tm->tm_year += 80;
|
||||
#ifdef MM67_CENTURY
|
||||
tm->tm_year += (regs[MM67_CENTURY] * 100) - 1900;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Set the current NVR time. */
|
||||
static void
|
||||
mm67_time_set(nvr_t *nvr, struct tm *tm)
|
||||
{
|
||||
rtcdev_t *dev = (rtcdev_t *)nvr->data;
|
||||
uint8_t *regs = nvr->regs;
|
||||
int year;
|
||||
|
||||
/* NVR is in BCD data mode. */
|
||||
regs[MM67_SEC] = RTC_BCD(tm->tm_sec);
|
||||
regs[MM67_MIN] = RTC_BCD(tm->tm_min);
|
||||
regs[MM67_HOUR] = RTC_BCD(tm->tm_hour);
|
||||
regs[MM67_DOW] = RTC_BCD(tm->tm_wday + 1);
|
||||
regs[MM67_DOM] = RTC_BCD(tm->tm_mday);
|
||||
regs[MM67_MON] = RTC_BCD(tm->tm_mon + 1);
|
||||
if (dev->year != -1) {
|
||||
if (dev->flags & FLAG_YEAR80)
|
||||
year = (tm->tm_year - 80) % 100;
|
||||
else
|
||||
year = tm->tm_year % 100;
|
||||
if (dev->flags & FLAG_YEARBCD)
|
||||
regs[dev->year] = RTC_BCD(year);
|
||||
else
|
||||
regs[dev->year] = regs[dev->year] + 1;
|
||||
#ifdef MM67_CENTURY
|
||||
regs[MM67_CENTURY] = (tm->tm_year+1900) / 100;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mm67_start(nvr_t *nvr)
|
||||
{
|
||||
struct tm tm;
|
||||
|
||||
/* Initialize the internal and chip times. */
|
||||
if (enable_sync) {
|
||||
/* Use the internal clock's time. */
|
||||
nvr_time_get(&tm);
|
||||
mm67_time_set(nvr, &tm);
|
||||
} else {
|
||||
/* Set the internal clock from the chip time. */
|
||||
mm67_time_get(nvr, &tm);
|
||||
nvr_time_set(&tm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Reset the RTC counters to a sane state. */
|
||||
static void
|
||||
mm67_reset(nvr_t *nvr)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Initialize the RTC to a known state. */
|
||||
for (i = MM67_MSEC; i <= MM67_MON; i++)
|
||||
nvr->regs[i] = RTC_BCD(0);
|
||||
nvr->regs[MM67_DOW] = RTC_BCD(1);
|
||||
nvr->regs[MM67_DOM] = RTC_BCD(1);
|
||||
nvr->regs[MM67_MON] = RTC_BCD(1);
|
||||
}
|
||||
|
||||
|
||||
/* Handle a READ operation from one of our registers. */
|
||||
static uint8_t
|
||||
mm67_read(uint16_t port, void *priv)
|
||||
{
|
||||
rtcdev_t *dev = (rtcdev_t *)priv;
|
||||
int reg = port - dev->base_addr;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
/* This chip is directly mapped on I/O. */
|
||||
cycles -= ISA_CYCLES(4);
|
||||
|
||||
switch(reg) {
|
||||
case MM67_ISTAT: /* IRQ status (RO) */
|
||||
ret = dev->nvr.regs[reg];
|
||||
dev->nvr.regs[reg] = 0x00;
|
||||
if (dev->irq != -1)
|
||||
picintc(1 << dev->irq);
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = dev->nvr.regs[reg];
|
||||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
pclog("ISARTC: read(%04x) = %02x\n", port-dev->base_addr, ret);
|
||||
#endif
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
/* Handle a WRITE operation to one of our registers. */
|
||||
static void
|
||||
mm67_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
rtcdev_t *dev = (rtcdev_t *)priv;
|
||||
int reg = port - dev->base_addr;
|
||||
int i;
|
||||
|
||||
#if 0
|
||||
pclog("ISARTC: write(%04x, %02x)\n", port-dev->base_addr, val);
|
||||
#endif
|
||||
|
||||
/* This chip is directly mapped on I/O. */
|
||||
cycles -= ISA_CYCLES(4);
|
||||
|
||||
switch(reg) {
|
||||
case MM67_ISTAT: /* intr status (RO) */
|
||||
break;
|
||||
|
||||
case MM67_ICTRL: /* intr control */
|
||||
dev->nvr.regs[MM67_ISTAT] = 0x00;
|
||||
dev->nvr.regs[reg] = val;
|
||||
pclog("RTC: write ictrl=%02x\n", val);
|
||||
break;
|
||||
|
||||
case MM67_RSTCTR:
|
||||
if (val == 0xff)
|
||||
mm67_reset(&dev->nvr);
|
||||
break;
|
||||
|
||||
case MM67_RSTRAM:
|
||||
if (val == 0xff) {
|
||||
for (i = MM67_AL_MSEC; i <= MM67_AL_MON; i++)
|
||||
dev->nvr.regs[i] = RTC_BCD(0);
|
||||
dev->nvr.regs[MM67_DOW] = RTC_BCD(1);
|
||||
dev->nvr.regs[MM67_DOM] = RTC_BCD(1);
|
||||
dev->nvr.regs[MM67_MON] = RTC_BCD(1);
|
||||
if (dev->year != -1) {
|
||||
val = (dev->flags & FLAG_YEAR80) ? 0 : 80;
|
||||
if (dev->flags & FLAG_YEARBCD)
|
||||
dev->nvr.regs[dev->year] = RTC_BCD(val);
|
||||
else
|
||||
dev->nvr.regs[dev->year] = val;
|
||||
#ifdef MM67_CENTURY
|
||||
dev->nvr.regs[MM67_CENTURY] = 19;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MM67_STATUS: /* STATUS (RO) */
|
||||
break;
|
||||
|
||||
case MM67_GOCMD:
|
||||
pclog("RTC: write gocmd=%02x\n", val);
|
||||
break;
|
||||
|
||||
case MM67_STBYIRQ:
|
||||
pclog("RTC: write stby=%02x\n", val);
|
||||
break;
|
||||
|
||||
case MM67_TEST:
|
||||
pclog("RTC: write test=%02x\n", val);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (! enable_sync)
|
||||
dev->nvr.regs[reg] = val;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Generic code for all supported chips. *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/* Initialize the device for use. */
|
||||
static void *
|
||||
isartc_init(const device_t *info)
|
||||
{
|
||||
rtcdev_t *dev;
|
||||
|
||||
/* Create a device instance. */
|
||||
dev = (rtcdev_t *)malloc(sizeof(rtcdev_t));
|
||||
memset(dev, 0x00, sizeof(rtcdev_t));
|
||||
dev->name = info->name;
|
||||
dev->board = info->local;
|
||||
dev->irq = -1;
|
||||
dev->year = -1;
|
||||
dev->nvr.data = dev;
|
||||
dev->nvr.size = 16;
|
||||
|
||||
/* Do per-board initialization. */
|
||||
switch(dev->board) {
|
||||
case 0: /* Everex EV-170 Magic I/O */
|
||||
dev->flags |= FLAG_YEAR80;
|
||||
dev->base_addr = device_get_config_hex16("base");
|
||||
dev->base_addrsz = 32;
|
||||
dev->irq = device_get_config_int("irq");
|
||||
dev->f_rd = mm67_read;
|
||||
dev->f_wr = mm67_write;
|
||||
dev->nvr.reset = mm67_reset;
|
||||
dev->nvr.start = mm67_start;
|
||||
dev->nvr.tick = mm67_tick;
|
||||
dev->year = MM67_AL_DOM; /* year, NON STANDARD */
|
||||
break;
|
||||
|
||||
case 1: /* DTK PII-147 Hexa I/O Plus */
|
||||
dev->flags |= FLAG_YEARBCD;
|
||||
dev->base_addr = device_get_config_hex16("base");
|
||||
dev->base_addrsz = 32;
|
||||
dev->f_rd = mm67_read;
|
||||
dev->f_wr = mm67_write;
|
||||
dev->nvr.reset = mm67_reset;
|
||||
dev->nvr.start = mm67_start;
|
||||
dev->nvr.tick = mm67_tick;
|
||||
dev->year = MM67_AL_HUNTEN; /* year, NON STANDARD */
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Say hello! */
|
||||
pclog("ISARTC: %s (I/O=%04XH", info->name, dev->base_addr);
|
||||
if (dev->irq != -1)
|
||||
pclog(", IRQ%i", dev->irq);
|
||||
pclog(")\n");
|
||||
|
||||
/* Set up an I/O port handler. */
|
||||
io_sethandler(dev->base_addr, dev->base_addrsz,
|
||||
dev->f_rd,NULL,NULL, dev->f_wr,NULL,NULL, dev);
|
||||
|
||||
/* Hook into the NVR backend. */
|
||||
dev->nvr.fn = (const wchar_t *)isartc_get_internal_name(isartc_type);
|
||||
dev->nvr.irq = dev->irq;
|
||||
nvr_init(&dev->nvr);
|
||||
|
||||
/* Let them know our device instance. */
|
||||
return((void *)dev);
|
||||
}
|
||||
|
||||
|
||||
/* Remove the device from the system. */
|
||||
static void
|
||||
isartc_close(void *priv)
|
||||
{
|
||||
rtcdev_t *dev = (rtcdev_t *)priv;
|
||||
|
||||
io_removehandler(dev->base_addr, dev->base_addrsz,
|
||||
dev->f_rd,NULL,NULL, dev->f_wr,NULL,NULL, dev);
|
||||
|
||||
if (dev->nvr.fn != NULL)
|
||||
free((wchar_t *)dev->nvr.fn);
|
||||
|
||||
free(dev);
|
||||
}
|
||||
|
||||
|
||||
static const device_config_t ev170_config[] = {
|
||||
{
|
||||
"base", "Address", CONFIG_HEX16, "", 0x02C0,
|
||||
{
|
||||
{
|
||||
"240H", 0x0240
|
||||
},
|
||||
{
|
||||
"2C0H", 0x02c0
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"irq", "IRQ", CONFIG_SELECTION, "", -1,
|
||||
{
|
||||
{
|
||||
"Disabled", -1
|
||||
},
|
||||
{
|
||||
"IRQ2", 2
|
||||
},
|
||||
{
|
||||
"IRQ5", 5
|
||||
},
|
||||
{
|
||||
"IRQ7", 7
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"", "", -1
|
||||
}
|
||||
};
|
||||
|
||||
static const device_t ev170_device = {
|
||||
"Everex EV-170 Magic I/O",
|
||||
DEVICE_ISA,
|
||||
0,
|
||||
isartc_init, isartc_close, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
ev170_config
|
||||
};
|
||||
|
||||
|
||||
static const device_config_t pii147_config[] = {
|
||||
{
|
||||
"base", "Address", CONFIG_HEX16, "", 0x0240,
|
||||
{
|
||||
{
|
||||
"Clock 1", 0x0240
|
||||
},
|
||||
{
|
||||
"Clock 2", 0x0340
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"", "", -1
|
||||
}
|
||||
};
|
||||
|
||||
static const device_t pii147_device = {
|
||||
"DTK PII-147 Hexa I/O Plus",
|
||||
DEVICE_ISA,
|
||||
1,
|
||||
isartc_init, isartc_close, NULL,
|
||||
NULL, NULL, NULL, NULL,
|
||||
pii147_config
|
||||
};
|
||||
|
||||
|
||||
static const struct {
|
||||
const char *internal_name;
|
||||
const device_t *dev;
|
||||
} boards[] = {
|
||||
{ "none", NULL, },
|
||||
{ "ev170", &ev170_device, },
|
||||
{ "pii147", &pii147_device, },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
void
|
||||
isartc_reset(void)
|
||||
{
|
||||
if (isartc_type == 0) return;
|
||||
|
||||
/* Add the device to the system. */
|
||||
device_add(boards[isartc_type].dev);
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
isartc_get_name(int board)
|
||||
{
|
||||
if (boards[board].dev == NULL) return(NULL);
|
||||
|
||||
return(boards[board].dev->name);
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
isartc_get_internal_name(int board)
|
||||
{
|
||||
return(boards[board].internal_name);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
isartc_get_from_internal_name(const char *s)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
while (boards[c].internal_name != NULL) {
|
||||
if (! strcmp(boards[c].internal_name, s))
|
||||
return(c);
|
||||
c++;
|
||||
}
|
||||
|
||||
/* Not found. */
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
const device_t *
|
||||
isartc_get_device(int board)
|
||||
{
|
||||
return(boards[board].dev);
|
||||
}
|
||||
71
src/devices/misc/isartc.h
Normal file
71
src/devices/misc/isartc.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* Version: @(#)isartc.h 1.0.1 2018/08/27
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* 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:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef ISARTC_H
|
||||
# define ISARTC_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Global variables. */
|
||||
|
||||
|
||||
/* Functions. */
|
||||
extern void isartc_reset(void);
|
||||
|
||||
extern const char *isartc_get_name(int t);
|
||||
extern const char *isartc_get_internal_name(int t);
|
||||
extern int isartc_get_from_internal_name(const char *s);
|
||||
extern const device_t *isartc_get_device(int t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /*ISARTC_H*/
|
||||
@@ -189,7 +189,7 @@
|
||||
* including the later update (DS12887A) which implemented a
|
||||
* "century" register to be compatible with Y2K.
|
||||
*
|
||||
* Version: @(#)nvr_at.c 1.0.9 2018/06/07
|
||||
* Version: @(#)nvr_at.c 1.0.10 2018/08/27
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -700,7 +700,7 @@ nvr_at_close(void *priv)
|
||||
nvr_t *nvr = (nvr_t *)priv;
|
||||
|
||||
if (nvr->fn != NULL)
|
||||
free(nvr->fn);
|
||||
free((wchar_t *)nvr->fn);
|
||||
|
||||
if (nvr->data != NULL)
|
||||
free(nvr->data);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Main include file for the application.
|
||||
*
|
||||
* Version: @(#)emu.h 1.0.28 2018/08/26
|
||||
* Version: @(#)emu.h 1.0.29 2018/08/27
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
@@ -125,7 +125,8 @@ extern int game_enabled, /* (C) enable game port */
|
||||
parallel_enabled[], /* (C) enable LPT ports */
|
||||
parallel_device[], /* (C) set up LPT devices */
|
||||
bugger_enabled, /* (C) enable ISAbugger */
|
||||
isamem_type[]; /* (C) enable ISA mem cards */
|
||||
isamem_type[], /* (C) enable ISA mem cards */
|
||||
isartc_type; /* (C) enable ISA RTC card */
|
||||
#ifdef WALTJE
|
||||
extern int romdos_enabled; /* (C) enable ROM DOS */
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
* bit 1: b8000 memory available
|
||||
* 0000:046a: 00 jim 250 01 jim 350
|
||||
*
|
||||
* Version: @(#)m_europc.c 1.0.15 2018/06/06
|
||||
* Version: @(#)m_europc.c 1.0.16 2018/08/27
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
@@ -692,8 +692,10 @@ europc_close(void *priv)
|
||||
{
|
||||
nvr_t *nvr = &europc.nvr;
|
||||
|
||||
if (nvr->fn != NULL)
|
||||
free(nvr->fn);
|
||||
if (nvr->fn != NULL) {
|
||||
free((wchar_t *)nvr->fn);
|
||||
nvr->fn = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* NOTES: OpenAT wip for 286-class machine with open BIOS.
|
||||
* PS2_M80-486 wip, pending receipt of TRM's for machine.
|
||||
*
|
||||
* Version: @(#)machine_table.c 1.0.25 2018/08/26
|
||||
* Version: @(#)machine_table.c 1.0.25 2018/08/28
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
|
||||
14
src/nvr.c
14
src/nvr.c
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implement a generic NVRAM/CMOS/RTC device.
|
||||
*
|
||||
* Version: @(#)nvr.c 1.0.10 2018/05/06
|
||||
* Version: @(#)nvr.c 1.0.11 2018/08/27
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
@@ -143,14 +143,20 @@ nvr_init(nvr_t *nvr)
|
||||
{
|
||||
char temp[64];
|
||||
struct tm *tm;
|
||||
wchar_t *sp;
|
||||
time_t now;
|
||||
int c;
|
||||
|
||||
/* Set up the NVR file's name. */
|
||||
sprintf(temp, "%s.nvr", machine_get_internal_name());
|
||||
if (nvr->fn != NULL)
|
||||
strcpy(temp, (const char *)nvr->fn);
|
||||
else
|
||||
strcpy(temp, machine_get_internal_name());
|
||||
strcat(temp, ".nvr");
|
||||
c = strlen(temp) + 1;
|
||||
nvr->fn = (wchar_t *)malloc(c*sizeof(wchar_t));
|
||||
mbstowcs(nvr->fn, temp, c);
|
||||
sp = (wchar_t *)malloc(c*sizeof(wchar_t));
|
||||
mbstowcs(sp, temp, c);
|
||||
nvr->fn = (const wchar_t *)sp;
|
||||
|
||||
/* Initialize the internal clock as needed. */
|
||||
memset(&intclk, 0x00, sizeof(intclk));
|
||||
|
||||
48
src/nvr.h
48
src/nvr.h
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Definitions for the generic NVRAM/CMOS driver.
|
||||
*
|
||||
* Version: @(#)nvr.h 1.0.6 2018/04/11
|
||||
* Version: @(#)nvr.h 1.0.7 2018/08/27
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
@@ -48,7 +48,7 @@
|
||||
# define EMU_NVR_H
|
||||
|
||||
|
||||
#define NVR_MAXSIZE 128 /* max size of NVR data */
|
||||
#define NVR_MAXSIZE 128 /* max size of NVR data */
|
||||
|
||||
/* Conversion from BCD to Binary and vice versa. */
|
||||
#define RTC_BCD(x) (((x) % 10) | (((x) / 10) << 4))
|
||||
@@ -58,41 +58,41 @@
|
||||
|
||||
/* Define a generic RTC/NVRAM device. */
|
||||
typedef struct _nvr_ {
|
||||
wchar_t *fn; /* pathname of image file */
|
||||
uint16_t size; /* device configuration */
|
||||
int8_t irq;
|
||||
const wchar_t *fn; /* pathname of image file */
|
||||
uint16_t size; /* device configuration */
|
||||
int8_t irq;
|
||||
|
||||
uint8_t onesec_cnt;
|
||||
int64_t onesec_time;
|
||||
uint8_t onesec_cnt;
|
||||
int64_t onesec_time;
|
||||
|
||||
void *data; /* local data */
|
||||
void *data; /* local data */
|
||||
|
||||
/* Hooks to device functions. */
|
||||
void (*reset)(struct _nvr_ *);
|
||||
void (*start)(struct _nvr_ *);
|
||||
void (*tick)(struct _nvr_ *);
|
||||
void (*reset)(struct _nvr_ *);
|
||||
void (*start)(struct _nvr_ *);
|
||||
void (*tick)(struct _nvr_ *);
|
||||
|
||||
uint8_t regs[NVR_MAXSIZE]; /* these are the registers */
|
||||
uint8_t regs[NVR_MAXSIZE]; /* these are the registers */
|
||||
} nvr_t;
|
||||
|
||||
|
||||
extern int nvr_dosave;
|
||||
extern int nvr_dosave;
|
||||
#ifdef EMU_DEVICE_H
|
||||
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 at_nvr_device;
|
||||
extern const device_t ps_nvr_device;
|
||||
extern const device_t amstrad_nvr_device;
|
||||
#endif
|
||||
|
||||
|
||||
extern void nvr_init(nvr_t *);
|
||||
extern wchar_t *nvr_path(const wchar_t *fn);
|
||||
extern int nvr_load(void);
|
||||
extern int nvr_save(void);
|
||||
extern void nvr_init(nvr_t *);
|
||||
extern wchar_t *nvr_path(const wchar_t *fn);
|
||||
extern int nvr_load(void);
|
||||
extern int nvr_save(void);
|
||||
|
||||
extern int nvr_is_leap(int year);
|
||||
extern int nvr_get_days(int month, int year);
|
||||
extern void nvr_time_get(struct tm *);
|
||||
extern void nvr_time_set(struct tm *);
|
||||
extern int nvr_is_leap(int year);
|
||||
extern int nvr_get_days(int month, int year);
|
||||
extern void nvr_time_get(struct tm *);
|
||||
extern void nvr_time_set(struct tm *);
|
||||
|
||||
|
||||
#endif /*EMU_NVR_H*/
|
||||
|
||||
9
src/pc.c
9
src/pc.c
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Main emulator module where most things are controlled.
|
||||
*
|
||||
* Version: @(#)pc.c 1.0.51 2018/08/26
|
||||
* Version: @(#)pc.c 1.0.52 2018/08/27
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -86,6 +86,7 @@
|
||||
#include "devices/video/video.h"
|
||||
#include "devices/misc/bugger.h"
|
||||
#include "devices/misc/isamem.h"
|
||||
#include "devices/misc/isartc.h"
|
||||
#include "ui/ui.h"
|
||||
#include "plat.h"
|
||||
|
||||
@@ -137,7 +138,8 @@ int game_enabled = 0, /* (C) enable game port */
|
||||
parallel_enabled[] = {0,0,0}, /* (C) enable LPT ports */
|
||||
parallel_device[] = {0,0,0}, /* (C) set up LPT devices */
|
||||
bugger_enabled = 0, /* (C) enable ISAbugger */
|
||||
isamem_type[ISAMEM_MAX] = { 0,0,0,0 }; /* (C) enable ISA mem cards */
|
||||
isamem_type[ISAMEM_MAX] = { 0,0,0,0 }, /* (C) enable ISA mem cards */
|
||||
isartc_type = 0; /* (C) enable ISA RTC card */
|
||||
#ifdef WALTJE
|
||||
int romdos_enabled = 0; /* (C) enable ROM DOS */
|
||||
#endif
|
||||
@@ -999,6 +1001,9 @@ pc_reset_hard_init(void)
|
||||
/* Reset any ISA memory cards. */
|
||||
isamem_reset();
|
||||
|
||||
/* Reset any ISA RTC cards. */
|
||||
isartc_reset();
|
||||
|
||||
fdd_reset();
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* String definitions for "Belorussian (Belarus)" language.
|
||||
*
|
||||
* Version: @(#)VARCem-BY.str 1.0.2 2018/08/25
|
||||
* Version: @(#)VARCem-BY.str 1.0.3 2018/08/27
|
||||
*
|
||||
* Authors: paul_met, <paul_met@yandex.ru>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -47,7 +47,7 @@
|
||||
*/
|
||||
|
||||
/* Do not translate! */
|
||||
#define TAG_VERSION 1,0,2
|
||||
#define TAG_VERSION 1,0,3
|
||||
#define TAG_AUTHOR "paul_met"
|
||||
#define TAG_EMAIL "paul_met@yandex.ru"
|
||||
|
||||
@@ -232,7 +232,8 @@
|
||||
#define STR_3477 "Трацічны IDE:"
|
||||
#define STR_3478 "Чацвярцічны IDE:"
|
||||
#define STR_3479 "Прылада ISABugger"
|
||||
#define STR_3480 "ISA Memory Expansion"
|
||||
#define STR_3480 "Карта расширения памяти (ISA)"
|
||||
#define STR_3481 "ISA Clock/RTC карта"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "Жорсткія дыскі:"
|
||||
|
||||
@@ -235,6 +235,7 @@
|
||||
#define STR_3478 "Kvartérní IDE:"
|
||||
#define STR_3479 "Zařízení ISABugger"
|
||||
#define STR_3480 "ISA Memory Expansion"
|
||||
#define STR_3481 "ISA Clock/RTC Card"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "Pevné disky:"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* String definitions for "German (Germany)" language.
|
||||
*
|
||||
* Version: @(#)VARCem-DE.str 1.0.7 2018/08/25
|
||||
* Version: @(#)VARCem-DE.str 1.0.8 2018/08/27
|
||||
*
|
||||
* Authors: Michael Drüing, <michael@drueing.de>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -48,7 +48,7 @@
|
||||
*/
|
||||
|
||||
/* Do not translate! */
|
||||
#define TAG_VERSION 1,0,7
|
||||
#define TAG_VERSION 1,0,8
|
||||
#define TAG_AUTHOR "Michael Drüing"
|
||||
#define TAG_EMAIL "michael@drueing.de"
|
||||
|
||||
@@ -248,6 +248,7 @@
|
||||
#define STR_3478 "Vierter IDE Bus:"
|
||||
#define STR_3479 "ISABugger Gerät"
|
||||
#define STR_3480 "ISA Speichererweiterung"
|
||||
#define STR_3481 "ISA Echtzeituhr-Karte (RTC)"
|
||||
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* String definitions for "Dutch (Netherlands)" language.
|
||||
*
|
||||
* Version: @(#)VARCem-DU.str 1.0.8 2018/08/25
|
||||
* Version: @(#)VARCem-DU.str 1.0.9 2018/08/26
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
@@ -46,7 +46,7 @@
|
||||
*/
|
||||
|
||||
/* Do not translate! */
|
||||
#define TAG_VERSION 1,0,8
|
||||
#define TAG_VERSION 1,0,9
|
||||
#define TAG_AUTHOR "Fred N. van Kempen"
|
||||
#define TAG_EMAIL "waltje@varcem.com"
|
||||
|
||||
@@ -234,6 +234,7 @@
|
||||
#define STR_3478 "Vierde IDE:"
|
||||
#define STR_3479 "ISABugger apparaat"
|
||||
#define STR_3480 "ISA geheugenuitbreiding"
|
||||
#define STR_3481 "ISA Clock/RTC uitbreiding"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "Vaste schijven:"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* it as the line-by-line base for the translated version, and
|
||||
* update fields as needed.
|
||||
*
|
||||
* Version: @(#)VARCem-EN.str 1.0.7 2018/08/25
|
||||
* Version: @(#)VARCem-EN.str 1.0.8 2018/08/26
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
@@ -237,7 +237,8 @@
|
||||
#define STR_3477 "Tertiary IDE:"
|
||||
#define STR_3478 "Quaternary IDE:"
|
||||
#define STR_3479 "ISABugger device"
|
||||
#define STR_3480 "ISA Memory Expansion"
|
||||
#define STR_3480 "ISA Memory Expansion Card"
|
||||
#define STR_3481 "ISA Clock/RTC Card"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "Hard disks:"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* String definitions for "Spanish (Spain, Normal Sort)" language.
|
||||
*
|
||||
* Version: @(#)VARCem-ES.str 1.0.6 2018/08/25
|
||||
* Version: @(#)VARCem-ES.str 1.0.7 2018/08/26
|
||||
*
|
||||
* Authors: Natalia Portillo, <claunia@claunia.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -48,7 +48,7 @@
|
||||
*/
|
||||
|
||||
/* Do not translate! */
|
||||
#define TAG_VERSION 1,0,6
|
||||
#define TAG_VERSION 1,0,7
|
||||
#define TAG_AUTHOR "Natalia Portillo"
|
||||
#define TAG_EMAIL "claunia@claunia.com"
|
||||
|
||||
@@ -237,6 +237,7 @@
|
||||
#define STR_3478 "IDE cuaternario:"
|
||||
#define STR_3479 "Dispositivo ISABugger"
|
||||
#define STR_3480 "Expansión de memoria (ISA)"
|
||||
#define STR_3481 "Reloj ISA / Tarjeta RTC"
|
||||
|
||||
/* UI diálogo: Preferencias (Discos duros, 3500.) */
|
||||
#define STR_3500 "Discos duros:"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* it as the line-by-line base for the translated version, and
|
||||
* update fields as needed.
|
||||
*
|
||||
* Version: @(#)VARCem-FI.str 1.0.5 2018/08/25
|
||||
* Version: @(#)VARCem-FI.str 1.0.6 2018/08/26
|
||||
*
|
||||
* Authors: Daniel Gurney, <dgurney@varcem.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -53,7 +53,7 @@
|
||||
*/
|
||||
|
||||
/* Do not translate! */
|
||||
#define TAG_VERSION 1,0,5
|
||||
#define TAG_VERSION 1,0,6
|
||||
#define TAG_AUTHOR "Daniel Gurney"
|
||||
#define TAG_EMAIL "dgurney@varcem.com"
|
||||
|
||||
@@ -238,6 +238,7 @@
|
||||
#define STR_3478 "Kvarternäärinen IDE:"
|
||||
#define STR_3479 "ISABugger-laite"
|
||||
#define STR_3480 "ISA-muistilaajennus"
|
||||
#define STR_3481 "ISA-kello/RTC-kortti"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "Kiintolevyt:"
|
||||
|
||||
@@ -236,6 +236,7 @@
|
||||
#define STR_3478 "4ème interface IDE:"
|
||||
#define STR_3479 "Carte ISABugger"
|
||||
#define STR_3480 "Carte d'extension mémoire ISA"
|
||||
#define STR_3481 "Carte d'horloge temps réel"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "Disques dur:"
|
||||
|
||||
@@ -235,6 +235,7 @@
|
||||
#define STR_3478 "IDE quaternario:"
|
||||
#define STR_3479 "Dispositivo ISABugger"
|
||||
#define STR_3480 "ISA Memory Expansion"
|
||||
#define STR_3481 "ISA Clock/RTC Card"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "Hard disk:"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* String definitions for "Japanese (Japan)" language.
|
||||
*
|
||||
* Version: @(#)VARCem-JP.str 1.0.6 2018/08/25
|
||||
* Version: @(#)VARCem-JP.str 1.0.7 2018/08/26
|
||||
*
|
||||
* Authors: Basic2004, <basic2004@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -48,7 +48,7 @@
|
||||
*/
|
||||
|
||||
/* Do not translate! */
|
||||
#define TAG_VERSION 1,0,6
|
||||
#define TAG_VERSION 1,0,7
|
||||
#define TAG_AUTHOR "Basic2004"
|
||||
#define TAG_EMAIL "basic2004@gmail.com"
|
||||
|
||||
@@ -234,7 +234,8 @@
|
||||
#define STR_3477 "3番目のIDE:"
|
||||
#define STR_3478 "4番目のIDE:"
|
||||
#define STR_3479 "ISABuggerデバイス"
|
||||
#define STR_3480 "ISA Memory Expansion"
|
||||
#define STR_3480 "ISAメモリー拡張ボード"
|
||||
#define STR_3481 "ISA Clock/RTC Card"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "ハードディスク:"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* String definitions for "Korean (South Korea)" language.
|
||||
*
|
||||
* Version: @(#)VARCem-KR.str 1.0.7 2018/08/25
|
||||
* Version: @(#)VARCem-KR.str 1.0.9 2018/08/27
|
||||
*
|
||||
* Authors: Yeong Uk Jo, <greatpsycho@yahoo.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -48,7 +48,7 @@
|
||||
*/
|
||||
|
||||
/* Do not translate! */
|
||||
#define TAG_VERSION 1,0,7
|
||||
#define TAG_VERSION 1,0,9
|
||||
#define TAG_AUTHOR "Yeong Uk Jo"
|
||||
#define TAG_EMAIL "greatpsycho@yahoo.com"
|
||||
|
||||
@@ -234,7 +234,8 @@
|
||||
#define STR_3477 "3 번째 IDE:"
|
||||
#define STR_3478 "4 번째 IDE:"
|
||||
#define STR_3479 "ISABugger 장치"
|
||||
#define STR_3480 "ISA Memory Expansion"
|
||||
#define STR_3480 "ISA 메모리 확장 카드"
|
||||
#define STR_3481 "ISA 내장 시계 카드"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "하드 디스크:"
|
||||
|
||||
@@ -233,6 +233,7 @@
|
||||
#define STR_3478 "Төрттік IDE:"
|
||||
#define STR_3479 "ISABugger қурылғы"
|
||||
#define STR_3480 "ISA Memory Expansion"
|
||||
#define STR_3481 "ISA Clock/RTC Card"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "атты табақжадтар:"
|
||||
|
||||
@@ -234,6 +234,7 @@
|
||||
#define STR_3478 "Ketvirtinis IDE:"
|
||||
#define STR_3479 "ISABugger įrenginys"
|
||||
#define STR_3480 "ISA Memory Expansion"
|
||||
#define STR_3481 "ISA Clock/RTC Card"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "Kietieji diskai:"
|
||||
|
||||
@@ -234,6 +234,7 @@
|
||||
#define STR_3478 "Fjerde IDE:"
|
||||
#define STR_3479 "ISABugger-enhet"
|
||||
#define STR_3480 "ISA Memory Expansion"
|
||||
#define STR_3481 "ISA Clock/RTC Card"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "Platelager:"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* String definitions for "Russian (Russia)" language.
|
||||
*
|
||||
* Version: @(#)VARCem-RU.str 1.0.11 2018/08/25
|
||||
* Version: @(#)VARCem-RU.str 1.0.12 2018/08/27
|
||||
*
|
||||
* Authors: Tarlabnor, <tarlabnor@varcem.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -47,7 +47,7 @@
|
||||
*/
|
||||
|
||||
/* Do not translate! */
|
||||
#define TAG_VERSION 1,0,11
|
||||
#define TAG_VERSION 1,0,12
|
||||
#define TAG_AUTHOR "Tarlabnor"
|
||||
#define TAG_EMAIL "tarlabnor@varcem.com"
|
||||
|
||||
@@ -233,6 +233,7 @@
|
||||
#define STR_3478 "Четвертичный IDE:"
|
||||
#define STR_3479 "Устройство ISABugger"
|
||||
#define STR_3480 "Карта расширения памяти (ISA)"
|
||||
#define STR_3481 "ISA Clock/RTC карта"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "Жёсткие диски:"
|
||||
|
||||
@@ -235,6 +235,7 @@
|
||||
#define STR_3478 "Kvartarni IDE:"
|
||||
#define STR_3479 "ISABugger naprava"
|
||||
#define STR_3480 "ISA Memory Expansion"
|
||||
#define STR_3481 "ISA Clock/RTC Card"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "Trdi diski:"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* String definitions for "Ukrainian (Ukraine)" language.
|
||||
*
|
||||
* Version: @(#)VARCem-UA.str 1.0.3 2018/08/25
|
||||
* Version: @(#)VARCem-UA.str 1.0.4 2018/08/27
|
||||
*
|
||||
* Authors: .SVD., <old-dos.ru>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -48,7 +48,7 @@
|
||||
*/
|
||||
|
||||
/* Do not translate! */
|
||||
#define TAG_VERSION 1,0,3
|
||||
#define TAG_VERSION 1,0,4
|
||||
#define TAG_AUTHOR ".SVD."
|
||||
#define TAG_EMAIL "old-dos.ru"
|
||||
|
||||
@@ -233,7 +233,8 @@
|
||||
#define STR_3477 "Третичний IDE:"
|
||||
#define STR_3478 "Четвертичний IDE:"
|
||||
#define STR_3479 "Пристрiй ISABugger"
|
||||
#define STR_3480 "ISA Memory Expansion"
|
||||
#define STR_3480 "Карта расширения памяти (ISA)"
|
||||
#define STR_3481 "ISA Clock/RTC карта"
|
||||
|
||||
/* UI dialog: Settings (Hard Disks, 3500.) */
|
||||
#define STR_3500 "Жорсткi диски:"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Common resources for the application.
|
||||
*
|
||||
* Version: @(#)VARCem-common.rc 1.0.7 2018/08/18
|
||||
* Version: @(#)VARCem-common.rc 1.0.8 2018/08/27
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
@@ -423,7 +423,7 @@ BEGIN
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,107,110,10
|
||||
END
|
||||
|
||||
DLG_CFG_PERIPHERALS DIALOG 97, 0, 267, 180
|
||||
DLG_CFG_PERIPHERALS DIALOG 97, 0, 267, 200
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 9, FONT_NAME
|
||||
BEGIN
|
||||
@@ -448,23 +448,28 @@ BEGIN
|
||||
CONTROL STR_3479,IDC_CHECK_BUGGER,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,80,94,10
|
||||
|
||||
GROUPBOX STR_3480,IDC_GROUP_ISAMEM,7,99,255,70
|
||||
LTEXT "#1:",IDT_1763,12,111,21,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_1,25,110,180,120,
|
||||
LTEXT STR_3481,IDT_1767,7,99,61,10
|
||||
COMBOBOX IDC_COMBO_ISARTC,71,98,140,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_ISAMEM_1,209,110,46,12
|
||||
LTEXT "#2:",IDT_1764,12,125,21,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_2,25,124,180,120,
|
||||
PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_ISARTC,214,98,46,12
|
||||
|
||||
GROUPBOX STR_3480,IDC_GROUP_ISAMEM,7,118,255,70
|
||||
LTEXT "#1:",IDT_1763,12,130,21,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_1,25,129,180,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_ISAMEM_2,209,124,46,12
|
||||
LTEXT "#3:",IDT_1765,12,139,21,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_3,25,138,180,120,
|
||||
PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_ISAMEM_1,209,129,46,12
|
||||
LTEXT "#2:",IDT_1764,12,144,21,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_2,25,143,180,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_ISAMEM_3,209,138,46,12
|
||||
LTEXT "#4:",IDT_1766,12,153,21,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_4,25,152,180,120,
|
||||
PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_ISAMEM_2,209,143,46,12
|
||||
LTEXT "#3:",IDT_1765,12,158,21,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_3,25,157,180,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_ISAMEM_4,209,152,46,12
|
||||
PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_ISAMEM_3,209,157,46,12
|
||||
LTEXT "#4:",IDT_1766,12,172,21,10
|
||||
COMBOBOX IDC_COMBO_ISAMEM_4,25,171,180,120,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_ISAMEM_4,209,171,46,12
|
||||
END
|
||||
|
||||
DLG_CFG_DISK DIALOG 97, 0, 267, 154
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#
|
||||
# Makefile for Windows systems using the MinGW32 environment.
|
||||
#
|
||||
# Version: @(#)Makefile.mingw 1.0.52 2018/08/26
|
||||
# Version: @(#)Makefile.mingw 1.0.53 2018/08/27
|
||||
#
|
||||
# Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
#
|
||||
@@ -599,7 +599,7 @@ INTELOBJ := intel.o \
|
||||
intel_piix.o intel_piix4.o
|
||||
|
||||
DEVOBJ := bugger.o \
|
||||
isamem.o \
|
||||
isamem.o isartc.o \
|
||||
game.o game_dev.o \
|
||||
parallel.o parallel_dev.o serial.o \
|
||||
sio_fdc37c66x.o sio_fdc37c669.o sio_fdc37c93x.o \
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#
|
||||
# Makefile for Windows using Visual Studio 2015.
|
||||
#
|
||||
# Version: @(#)Makefile.VC 1.0.39 2018/08/26
|
||||
# Version: @(#)Makefile.VC 1.0.40 2018/08/27
|
||||
#
|
||||
# Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
#
|
||||
@@ -569,7 +569,7 @@ INTELOBJ := intel.obj \
|
||||
intel_piix.obj intel_piix4.obj
|
||||
|
||||
DEVOBJ := bugger.obj \
|
||||
isamem.obj \
|
||||
isamem.obj isartc.obj \
|
||||
game.obj game_dev.obj \
|
||||
parallel.obj parallel_dev.obj serial.obj \
|
||||
sio_fdc37c66x.obj sio_fdc37c669.obj sio_fdc37c93x.obj \
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Windows resource defines.
|
||||
*
|
||||
* Version: @(#)resource.h 1.0.17 2018/08/18
|
||||
* Version: @(#)resource.h 1.0.18 2018/08/27
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -113,10 +113,11 @@
|
||||
#define IDT_1758 1758 /* ZIP drives: */
|
||||
#define IDT_1761 1761 /* Speed: */
|
||||
#define IDT_1762 1762 /* ZIP drives: */
|
||||
#define IDT_1763 1763 /* Board #1: */
|
||||
#define IDT_1764 1764 /* Board #2: */
|
||||
#define IDT_1765 1765 /* Board #3: */
|
||||
#define IDT_1766 1766 /* Board #4: */
|
||||
#define IDT_1763 1763 /* ISAMEM #1: */
|
||||
#define IDT_1764 1764 /* ISAMEM #2: */
|
||||
#define IDT_1765 1765 /* ISAMEM #3: */
|
||||
#define IDT_1766 1766 /* ISAMEM #4: */
|
||||
#define IDT_1767 1767 /* ISARTC: */
|
||||
|
||||
#define IDT_TITLE 1790 /* "VARCem for Plaform" */
|
||||
#define IDT_VERSION 1791 /* "version.." */
|
||||
@@ -188,6 +189,8 @@
|
||||
#define IDC_COMBO_IDE_QUA 1126
|
||||
#define IDC_CHECK_BUGGER 1127
|
||||
#define IDC_CONFIGURE_BUGGER 1128
|
||||
#define IDC_COMBO_ISARTC 1129
|
||||
#define IDC_CONFIGURE_ISARTC 1130
|
||||
|
||||
#define IDC_GROUP_ISAMEM 1140
|
||||
#define IDC_COMBO_ISAMEM_1 1141
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the Settings dialog.
|
||||
*
|
||||
* Version: @(#)win_settings.c 1.0.32 2018/08/18
|
||||
* Version: @(#)win_settings.c 1.0.33 2018/08/27
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -59,6 +59,7 @@
|
||||
#include "../devices/ports/parallel_dev.h"
|
||||
#include "../devices/ports/serial.h"
|
||||
#include "../devices/misc/isamem.h"
|
||||
#include "../devices/misc/isartc.h"
|
||||
#include "../devices/input/mouse.h"
|
||||
#include "../devices/input/game/joystick.h"
|
||||
#include "../devices/floppy/fdd.h"
|
||||
@@ -114,6 +115,7 @@ static int temp_hdc_type,
|
||||
temp_ide_ter, temp_ide_ter_irq,
|
||||
temp_ide_qua, temp_ide_qua_irq;
|
||||
static int temp_bugger,
|
||||
temp_isartc,
|
||||
temp_isamem[ISAMEM_MAX];
|
||||
|
||||
/* Floppy drives category. */
|
||||
@@ -224,6 +226,7 @@ settings_init(void)
|
||||
temp_ide_qua = ide_enable[3];
|
||||
temp_ide_qua_irq = ide_irq[3];
|
||||
temp_bugger = bugger_enabled;
|
||||
temp_isartc = isartc_type;
|
||||
|
||||
/* ISA memory boards. */
|
||||
for (i = 0; i < ISAMEM_MAX; i++)
|
||||
@@ -303,6 +306,7 @@ settings_changed(void)
|
||||
i = i || (temp_ide_qua != ide_enable[3]);
|
||||
i = i || (temp_ide_qua_irq != ide_irq[3]);
|
||||
i = i || (temp_bugger != bugger_enabled);
|
||||
i = i || (temp_isartc != isartc_type);
|
||||
|
||||
/* ISA memory boards. */
|
||||
for (j = 0; j < ISAMEM_MAX; j++)
|
||||
@@ -410,6 +414,7 @@ settings_save(void)
|
||||
ide_enable[3] = temp_ide_qua;
|
||||
ide_irq[3] = temp_ide_qua_irq;
|
||||
bugger_enabled = temp_bugger;
|
||||
isartc_type = temp_isartc;
|
||||
|
||||
/* ISA memory boards. */
|
||||
for (i = 0; i < ISAMEM_MAX; i++)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the Settings dialog.
|
||||
*
|
||||
* Version: @(#)win_settings_periph.h 1.0.10 2018/08/18
|
||||
* Version: @(#)win_settings_periph.h 1.0.11 2018/08/27
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -210,12 +210,34 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
h = GetDlgItem(hdlg, IDC_CHECK_BUGGER);
|
||||
SendMessage(h, BM_SETCHECK, temp_bugger, 0);
|
||||
|
||||
/* Populate the ISA RTC card dropdown. */
|
||||
h = GetDlgItem(hdlg, IDC_COMBO_ISARTC);
|
||||
for (d = 0; ; d++) {
|
||||
stransi = isartc_get_internal_name(d);
|
||||
if (stransi == NULL)
|
||||
break;
|
||||
|
||||
if (d == 0) {
|
||||
/* Translate "None". */
|
||||
SendMessage(h, CB_ADDSTRING, 0,
|
||||
(LPARAM)get_string(IDS_NONE));
|
||||
} else {
|
||||
stransi = isartc_get_name(d);
|
||||
mbstowcs(temp, stransi, sizeof_w(temp));
|
||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||
}
|
||||
}
|
||||
SendMessage(h, CB_SETCURSEL, temp_isartc, 0);
|
||||
h = GetDlgItem(hdlg, IDC_CONFIGURE_ISARTC);
|
||||
if (temp_isartc != 0)
|
||||
EnableWindow(h, TRUE);
|
||||
else
|
||||
EnableWindow(h, FALSE);
|
||||
|
||||
/* Populate the ISA memory card dropdowns. */
|
||||
for (c = 0; c < ISAMEM_MAX; c++) {
|
||||
h = GetDlgItem(hdlg, IDC_COMBO_ISAMEM_1 + c);
|
||||
|
||||
d = 0;
|
||||
for (;;) {
|
||||
for (d = 0; ; d++) {
|
||||
stransi = isamem_get_internal_name(d);
|
||||
if (stransi == NULL)
|
||||
break;
|
||||
@@ -229,12 +251,8 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
mbstowcs(temp, stransi, sizeof_w(temp));
|
||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||
}
|
||||
|
||||
d++;
|
||||
}
|
||||
|
||||
SendMessage(h, CB_SETCURSEL, temp_isamem[c], 0);
|
||||
|
||||
h = GetDlgItem(hdlg, IDC_CONFIGURE_ISAMEM_1 + c);
|
||||
if (temp_isamem[c] != 0)
|
||||
EnableWindow(h, TRUE);
|
||||
@@ -282,6 +300,16 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
EnableWindow(h, FALSE);
|
||||
break;
|
||||
|
||||
case IDC_COMBO_ISARTC:
|
||||
h = GetDlgItem(hdlg, IDC_COMBO_ISARTC);
|
||||
temp_isartc = SendMessage(h, CB_GETCURSEL, 0, 0);
|
||||
h = GetDlgItem(hdlg, IDC_CONFIGURE_ISARTC);
|
||||
if (temp_isartc != 0)
|
||||
EnableWindow(h, TRUE);
|
||||
else
|
||||
EnableWindow(h, FALSE);
|
||||
break;
|
||||
|
||||
case IDC_COMBO_ISAMEM_1:
|
||||
case IDC_COMBO_ISAMEM_2:
|
||||
case IDC_COMBO_ISAMEM_3:
|
||||
@@ -297,12 +325,20 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
EnableWindow(h, FALSE);
|
||||
break;
|
||||
|
||||
case IDC_CONFIGURE_ISARTC:
|
||||
dev = isartc_get_device(temp_isartc);
|
||||
if (dev != NULL)
|
||||
temp_deviceconfig |= dlg_devconf(hdlg, (void *)dev);
|
||||
break;
|
||||
|
||||
case IDC_CONFIGURE_ISAMEM_1:
|
||||
case IDC_CONFIGURE_ISAMEM_2:
|
||||
case IDC_CONFIGURE_ISAMEM_3:
|
||||
case IDC_CONFIGURE_ISAMEM_4:
|
||||
c = LOWORD(wParam) - IDC_CONFIGURE_ISAMEM_1;
|
||||
temp_deviceconfig |= dlg_devconf(hdlg, (void *)isamem_get_device(c));
|
||||
dev = isamem_get_device(c);
|
||||
if (dev != NULL)
|
||||
temp_deviceconfig |= dlg_devconf(hdlg, (void *)dev);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
Reference in New Issue
Block a user