Made the Toshiba's T1000 ROM DOS configurable.

Removed all xxx_get_dev() calls, and published the actual device_t's instead.
(first step to making all machines a device)
This commit is contained in:
waltje
2018-04-04 02:08:46 -04:00
parent c4e11354d5
commit 30b6ac523e
10 changed files with 190 additions and 219 deletions

View File

@@ -8,7 +8,7 @@
*
* Implementation of the Intel 430FX PCISet chip.
*
* Version: @(#)m_at_430fx.c 1.0.6 2018/03/21
* Version: @(#)m_at_430fx.c 1.0.7 2018/04/03
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -273,13 +273,6 @@ machine_at_endeavor_init(const machine_t *model, void *arg)
}
const device_t *
at_endeavor_get_device(void)
{
return &s3_phoenix_trio64_onboard_pci_device;
}
void
machine_at_zappa_init(const machine_t *model, void *arg)
{

View File

@@ -8,7 +8,7 @@
*
* Emulation of the IBM PCjr.
*
* Version: @(#)m_pcjr.c 1.0.4 2018/03/27
* Version: @(#)m_pcjr.c 1.0.5 2018/04/03
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -731,7 +731,7 @@ static const device_config_t pcjr_config[] = {
};
static const device_t pcjr_device = {
const device_t m_pcjr_device = {
"IBM PCjr",
0, 0,
NULL, NULL, NULL,
@@ -743,13 +743,6 @@ static const device_t pcjr_device = {
};
const device_t *
pcjr_get_device(void)
{
return &pcjr_device;
}
void
machine_pcjr_init(const machine_t *model, UNUSED(void *arg))
{
@@ -776,7 +769,7 @@ machine_pcjr_init(const machine_t *model, UNUSED(void *arg))
io_sethandler(0x03d0, 16,
vid_in, NULL, NULL, vid_out, NULL, NULL, pcjr);
timer_add(vid_poll, &pcjr->vidtime, TIMER_ALWAYS_ENABLED, pcjr);
device_add_ex(&pcjr_device, pcjr);
device_add_ex(&m_pcjr_device, pcjr);
/* Initialize the keyboard. */
key_queue_start = key_queue_end = 0;

View File

@@ -8,7 +8,7 @@
*
* Emulation of Tandy models 1000, 1000HX and 1000SL2.
*
* Version: @(#)m_tandy.c 1.0.5 2018/03/31
* Version: @(#)m_tandy.c 1.0.6 2018/04/03
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -1374,75 +1374,6 @@ vid_init(tandy_t *dev)
}
static const device_config_t vid_config[] = {
{
"display_type", "Display type", CONFIG_SELECTION, "", TANDY_RGB,
{
{
"RGB", TANDY_RGB
},
{
"Composite", TANDY_COMPOSITE
},
{
""
}
}
},
{
"", "", -1
}
};
static const device_t vid_device = {
"Tandy 1000",
0, 0,
NULL, vid_close, NULL,
NULL,
vid_speed_changed,
NULL,
NULL,
vid_config
};
static const device_t vid_device_hx = {
"Tandy 1000 HX",
0, 0,
NULL, vid_close, NULL,
NULL,
vid_speed_changed,
NULL,
NULL,
vid_config
};
static const device_t vid_device_sl = {
"Tandy 1000SL2",
0, 1,
NULL, vid_close, NULL,
NULL,
vid_speed_changed,
NULL,
NULL,
NULL
};
const device_t *
tandy1k_get_device(void)
{
return &vid_device;
}
const device_t *
tandy1k_hx_get_device(void)
{
return &vid_device_hx;
}
static void
eep_write(uint16_t addr, uint8_t val, void *priv)
{
@@ -1701,6 +1632,61 @@ init_rom(tandy_t *dev)
}
static const device_config_t vid_config[] = {
{
"display_type", "Display type", CONFIG_SELECTION, "", TANDY_RGB,
{
{
"RGB", TANDY_RGB
},
{
"Composite", TANDY_COMPOSITE
},
{
""
}
}
},
{
"", "", -1
}
};
const device_t m_tandy1k_device = {
"Tandy 1000",
0, 0,
NULL, vid_close, NULL,
NULL,
vid_speed_changed,
NULL,
NULL,
vid_config
};
const device_t m_tandy1k_hx_device = {
"Tandy 1000 HX",
0, 0,
NULL, vid_close, NULL,
NULL,
vid_speed_changed,
NULL,
NULL,
vid_config
};
const device_t m_tandy1k_sl2_device = {
"Tandy 1000SL2",
0, 1,
NULL, vid_close, NULL,
NULL,
vid_speed_changed,
NULL,
NULL,
NULL
};
void
machine_tandy1k_init(const machine_t *model, void *arg)
{
@@ -1732,7 +1718,7 @@ machine_tandy1k_init(const machine_t *model, void *arg)
io_sethandler(0x00a0, 1,
tandy_read,NULL,NULL,tandy_write,NULL,NULL,dev);
vid_init(dev);
device_add_ex(&vid_device, dev);
device_add_ex(&m_tandy1k_device, dev);
device_add(&sn76489_device);
break;
@@ -1740,7 +1726,7 @@ machine_tandy1k_init(const machine_t *model, void *arg)
io_sethandler(0x00a0, 1,
tandy_read,NULL,NULL,tandy_write,NULL,NULL,dev);
vid_init(dev);
device_add_ex(&vid_device, dev);
device_add_ex(&m_tandy1k_hx_device, dev);
device_add(&ncr8496_device);
device_add(&eep_device);
break;
@@ -1751,7 +1737,7 @@ machine_tandy1k_init(const machine_t *model, void *arg)
io_sethandler(0xffe8, 8,
tandy_read,NULL,NULL,tandy_write,NULL,NULL,dev);
vid_init(dev);
device_add_ex(&vid_device_sl, dev);
device_add_ex(&m_tandy1k_sl2_device, dev);
device_add(&pssj_device);
device_add(&eep_device);
}

View File

@@ -8,7 +8,7 @@
*
* Implementation of standard IBM PC/XT class machine.
*
* Version: @(#)m_xt.c 1.0.5 2018/03/29
* Version: @(#)m_xt.c 1.0.6 2018/04/03
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -52,8 +52,7 @@
#include "machine.h"
/* Nasty, used by config.sys. Will re-do later. --FvK */
int rom_basic = 0; /* is ROM BASIC enabled? */
static int rom_basic = 0; /* is ROM BASIC enabled? */
static const device_config_t xt_config[] = {
@@ -77,24 +76,13 @@ static const device_config_t xt_config[] = {
};
static const device_t m_xt_device = {
"PC/XT Configuration Device",
MACHINE_ISA,
0,
NULL, NULL, NULL,
NULL,
NULL, NULL, NULL,
xt_config
};
void
machine_xt_init(const machine_t *model, void *arg)
{
machine_common_init(model, arg);
/* Check if we support a BASIC ROM. */
if (model->get_device != NULL) {
if (model->device != NULL) {
pclog("This (%s) machine supports a BASIC ROM.\n", model->name);
rom_basic = machine_get_config_int("rom_basic");
@@ -114,8 +102,12 @@ machine_xt_init(const machine_t *model, void *arg)
}
const device_t *
xt_get_device(void)
{
return(&m_xt_device);
}
const device_t m_xt_device = {
"PC/XT",
MACHINE_ISA,
0,
NULL, NULL, NULL,
NULL,
NULL, NULL, NULL,
xt_config
};

View File

@@ -50,7 +50,7 @@
*
* FIXME: The ROM drive should be re-done using the "option file".
*
* Version: @(#)m_xt_t1000.c 1.0.7 2018/03/31
* Version: @(#)m_xt_t1000.c 1.0.8 2018/04/03
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -135,6 +135,7 @@ enum TC8521_ADDR {
typedef struct {
/* ROM drive */
int rom_dos;
uint8_t *romdrive;
uint8_t rom_ctl;
uint32_t rom_offset;
@@ -861,11 +862,36 @@ t1000_read_roml(uint32_t addr, void *priv)
}
const device_t *
t1000_get_device(void)
static const device_config_t m_xt_t1000_config[] = {
{
return(&t1000_video_device);
"rom_dos", "ROM DOS", CONFIG_SELECTION, "", 0,
{
{
"Disabled", 0
},
{
"Enabled", 1
},
{
""
}
}
},
{
"", "", -1
}
};
const device_t m_xt_t1000_device = {
"Toshiba T1000",
MACHINE_ISA,
0,
NULL, NULL, NULL,
NULL,
NULL, NULL, NULL,
m_xt_t1000_config
};
void
@@ -887,6 +913,8 @@ machine_xt_t1000_init(const machine_t *model, void *arg)
* If the file is missing, continue to boot; the BIOS will
* complain 'No ROM drive' but boot normally from floppy.
*/
t1000.rom_dos = machine_get_config_int("rom_dos");
if (t1000.rom_dos) {
f = plat_fopen(rom_path(T1000_ROMDOS_PATH), L"rb");
if (f != NULL) {
t1000.romdrive = malloc(T1000_ROMDOS_SIZE);
@@ -900,6 +928,7 @@ machine_xt_t1000_init(const machine_t *model, void *arg)
t1000_read_rom,t1000_read_romw,t1000_read_roml,
NULL,NULL,NULL, NULL, MEM_MAPPING_INTERNAL, &t1000);
mem_mapping_disable(&t1000.rom_mapping);
}
/* Map the EMS page frame */
for (pg = 0; pg < 4; pg++) {
@@ -963,13 +992,6 @@ t1200_nvram_write(uint32_t addr, uint8_t value, void *priv)
}
const device_t *
t1200_get_device(void)
{
return(&t1200_video_device);
}
void
machine_xt_t1200_init(const machine_t *model, void *arg)
{

View File

@@ -8,7 +8,7 @@
*
* Definitions for the Toshiba T1000/T1200 machines.
*
* Version: @(#)m_xt_t1000.h 1.0.3 2018/03/15
* Version: @(#)m_xt_t1000.h 1.0.4 2018/04/03
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -40,8 +40,10 @@
# define MACHINE_T1000_H
#ifdef EMU_DEVICE_H
extern const device_t t1000_video_device;
extern const device_t t1200_video_device;
#endif
extern void t1000_video_options_set(uint8_t options);

View File

@@ -8,7 +8,7 @@
*
* Implementation of the Xi8088 open-source machine.
*
* Version: @(#)m_xt_xi8088.c 1.0.4 2018/03/21
* Version: @(#)m_xt_xi8088.c 1.0.5 2018/04/03
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -110,17 +110,6 @@ xi8088_bios_128kb(void)
}
static void *
xi8088_init(const device_t *info)
{
/* even though the bios by default turns the turbo off when controlling by hotkeys, we always start at full speed */
xi8088.turbo = 1;
xi8088.turbo_setting = device_get_config_int("turbo_setting");
return(&xi8088);
}
static const device_config_t xi8088_config[] =
{
{
@@ -146,10 +135,10 @@ static const device_config_t xi8088_config[] =
};
const device_t xi8088_device = {
const device_t m_xi8088_device = {
"Xi8088",
0, 0,
xi8088_init, NULL, NULL,
NULL, NULL, NULL,
NULL,
NULL,
NULL,
@@ -158,21 +147,25 @@ const device_t xi8088_device = {
};
const device_t *
xi8088_get_device(void)
{
return(&xi8088_device);
}
void
machine_xt_xi8088_init(const machine_t *model, void *arg)
{
/* Initialize local state. */
memset(&xi8088, 0x00, sizeof(xi8088_t));
if (biosmask < 0x010000)
xi8088_bios_128kb_set(0);
else
xi8088_bios_128kb_set(1);
/*
* Get the selected Turbo Speed setting.
* Even though the bios by default turns the turbo off when
* controlling by hotkeys, we always start at full speed.
*/
xi8088.turbo = 1;
xi8088.turbo_setting = device_get_config_int("turbo_setting");
/*
* TODO: set UMBs?
* See if PCem always sets when we have > 640KB ram and avoids

View File

@@ -8,7 +8,7 @@
*
* Handling of the emulated machines.
*
* Version: @(#)machine.h 1.0.13 2018/03/29
* Version: @(#)machine.h 1.0.14 2018/04/03
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -216,9 +216,9 @@ typedef struct _machine_ {
int nvrsz;
void (*init)(const struct _machine_ *, void *);
#ifdef EMU_DEVICE_H
const device_t *(*get_device)(void);
const device_t *device;
#else
const void *get_device;
const void *device;
#endif
void (*close)(void);
} machine_t;
@@ -248,7 +248,7 @@ extern const device_t *machine_getdevice(int machine);
#endif
extern int machine_getromset_ex(int m);
extern char *machine_get_internal_name_ex(int m);
extern int machine_get_nvrmask(int m);
//extern int machine_get_nvrmask(int m);
extern void machine_close(void);
@@ -270,6 +270,10 @@ extern void machine_at_t3100e_init(const machine_t *, void *);
extern void machine_at_p54tp4xe_init(const machine_t *, void *);
extern void machine_at_endeavor_init(const machine_t *, void *);
#ifdef EMU_DEVICE_H
extern const device_t s3_phoenix_trio64_onboard_pci_device;
#define m_at_endeavor_device s3_phoenix_trio64_onboard_pci_device
#endif
extern void machine_at_zappa_init(const machine_t *, void *);
extern void machine_at_mb500n_init(const machine_t *, void *);
extern void machine_at_president_init(const machine_t *, void *);
@@ -314,6 +318,9 @@ extern void machine_at_4gpv31_init(const machine_t *, void *);
#endif
extern void machine_pcjr_init(const machine_t *, void *);
#ifdef EMU_DEVICE_H
extern const device_t m_pcjr_device;
#endif
extern void machine_ps1_m2011_init(const machine_t *, void *);
extern void machine_ps1_m2121_init(const machine_t *, void *);
@@ -330,43 +337,40 @@ extern void machine_amstrad_init(const machine_t *, void *);
extern void machine_europc_init(const machine_t *, void *);
#ifdef EMU_DEVICE_H
extern const device_t europc_device,
europc_hdc_device;
extern const device_t europc_device, europc_hdc_device;
#endif
extern void machine_olim24_init(const machine_t *, void *);
extern void machine_olim24_video_init(void);
extern void machine_tandy1k_init(const machine_t *, void *);
#ifdef EMU_DEVICE_H
extern const device_t m_tandy1k_device;
extern const device_t m_tandy1k_hx_device;
extern const device_t m_tandy1k_sl2_device;
#endif
extern int tandy1k_eeprom_read(void);
extern void machine_xt_init(const machine_t *, void *);
#ifdef EMU_DEVICE_H
extern const device_t *xt_get_device(void);
extern const device_t m_xt_device;
#endif
extern void machine_xt_compaq_init(const machine_t *, void *);
#if defined(DEV_BRANCH) && defined(USE_LASERXT)
extern void machine_xt_laserxt_init(const machine_t *, void *);
#endif
extern void machine_xt_t1000_init(const machine_t *, void *);
#ifdef EMU_DEVICE_H
extern const device_t m_xt_t1000_device;
#endif
extern void machine_xt_t1200_init(const machine_t *, void *);
extern void machine_xt_t1x00_close(void);
extern void machine_xt_xi8088_init(const machine_t *, void *);
#ifdef EMU_DEVICE_H
extern const device_t *xi8088_get_device(void);
extern const device_t *pcjr_get_device(void);
extern const device_t *tandy1k_get_device(void);
extern const device_t *tandy1k_hx_get_device(void);
extern const device_t *t1000_get_device(void);
extern const device_t *t1200_get_device(void);
extern const device_t *at_endeavor_get_device(void);
extern const device_t m_xi8088_device;
#endif

View File

@@ -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.15 2018/03/29
* Version: @(#)machine_table.c 1.0.16 2018/04/03
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -53,19 +53,19 @@
const machine_t machines[] = {
{ "[8088] IBM PC", ROM_IBMPC, "ibm_pc", L"ibm/pc", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 64, 640, 32, 0, machine_xt_init, xt_get_device, NULL },
{ "[8088] IBM PCjr", ROM_IBMPCJR, "ibm_pcjr", L"ibm/pcjr", {{"", cpus_pcjr}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA | MACHINE_VIDEO, 128, 640, 128, 0, machine_pcjr_init, pcjr_get_device, NULL },
{ "[8088] IBM XT", ROM_IBMXT, "ibm_xt", L"ibm/xt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 64, 640, 64, 0, machine_xt_init, xt_get_device, NULL },
{ "[8088] OpenXT Generic Clone", ROM_GENXT, "open_xt", L"generic/open_xt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 64, 640, 64, 0, machine_xt_init, xt_get_device, NULL },
{ "[8088] AMI XT clone", ROM_AMIXT, "ami_xt", L"generic/ami/xt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 64, 640, 64, 0, machine_xt_init, xt_get_device, NULL },
{ "[8088] IBM PC", ROM_IBMPC, "ibm_pc", L"ibm/pc", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 64, 640, 32, 0, machine_xt_init, &m_xt_device, NULL },
{ "[8088] IBM PCjr", ROM_IBMPCJR, "ibm_pcjr", L"ibm/pcjr", {{"", cpus_pcjr}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA | MACHINE_VIDEO, 128, 640, 128, 0, machine_pcjr_init, &m_pcjr_device, NULL },
{ "[8088] IBM XT", ROM_IBMXT, "ibm_xt", L"ibm/xt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 64, 640, 64, 0, machine_xt_init, &m_xt_device, NULL },
{ "[8088] OpenXT Generic Clone", ROM_GENXT, "open_xt", L"generic/open_xt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 64, 640, 64, 0, machine_xt_init, &m_xt_device, NULL },
{ "[8088] AMI XT clone", ROM_AMIXT, "ami_xt", L"generic/ami/xt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 64, 640, 64, 0, machine_xt_init, &m_xt_device, NULL },
{ "[8088] Compaq Portable", ROM_PORTABLE, "compaq_portable", L"compaq/portable", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA | MACHINE_VIDEO, 128, 640, 128, 0, machine_xt_compaq_init, NULL, NULL },
{ "[8088] DTK XT clone", ROM_DTKXT, "dtk_xt", L"dtk/xt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 64, 640, 64, 0, machine_xt_init, xt_get_device, NULL },
{ "[8088] DTK XT clone", ROM_DTKXT, "dtk_xt", L"dtk/xt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 64, 640, 64, 0, machine_xt_init, &m_xt_device, NULL },
{ "[8088] Juko XT clone", ROM_JUKOPC, "juko_pc", L"juko/pc", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 64, 640, 64, 0, machine_xt_init, NULL, NULL },
{ "[8088] Phoenix XT clone", ROM_PXXT, "phoenix_xt", L"generic/phoenix/xt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 64, 640, 64, 0, machine_xt_init, NULL, NULL },
{ "[8088] Schneider EuroPC", ROM_EUROPC, "schneider_europc", L"schneider/europc", {{"Siemens", cpus_europc}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA | MACHINE_HDC | MACHINE_VIDEO | MACHINE_MOUSE, 512, 640, 128, 16, machine_europc_init, NULL, NULL },
{ "[8088] Tandy 1000", ROM_TANDY, "tandy_1000", L"tandy/t1000", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA, 128, 640, 128, 0, machine_tandy1k_init, tandy1k_get_device, NULL },
{ "[8088] Tandy 1000 HX", ROM_TANDY1000HX, "tandy_1000hx", L"tandy/t1000hx", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA, 256, 640, 128, 0, machine_tandy1k_init, tandy1k_hx_get_device, NULL },
{ "[8088] Toshiba 1000", ROM_T1000, "toshiba_t1000", L"toshiba/t1000", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA | MACHINE_VIDEO, 512, 1280, 768, 64, machine_xt_t1000_init, NULL, machine_xt_t1x00_close },
{ "[8088] Tandy 1000", ROM_TANDY, "tandy_1000", L"tandy/t1000", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA, 128, 640, 128, 0, machine_tandy1k_init, &m_tandy1k_device, NULL },
{ "[8088] Tandy 1000 HX", ROM_TANDY1000HX, "tandy_1000hx", L"tandy/t1000hx", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA, 256, 640, 128, 0, machine_tandy1k_init, &m_tandy1k_hx_device, NULL },
{ "[8088] Toshiba 1000", ROM_T1000, "toshiba_t1000", L"toshiba/t1000", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA | MACHINE_VIDEO, 512, 1280, 768, 64, machine_xt_t1000_init, &m_xt_t1000_device, machine_xt_t1x00_close },
#if defined(DEV_BRANCH) && defined(USE_LASERXT)
{ "[8088] VTech Laser Turbo XT", ROM_LTXT, "vtech_ltxt", L"vtech/ltxt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 512, 512, 256, 0, machine_xt_laserxt_init, NULL, NULL },
#endif
@@ -77,7 +77,7 @@ const machine_t machines[] = {
{ "[8086] Amstrad PC3086", ROM_PC3086, "amstrad_pc3086", L"amstrad/pc3086", {{"", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA | MACHINE_VIDEO | MACHINE_MOUSE, 640, 640, 0, 64, machine_amstrad_init, NULL, NULL },
{ "[8086] Amstrad PC20(0)", ROM_PC200, "amstrad_pc200", L"amstrad/pc200", {{"", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA | MACHINE_VIDEO | MACHINE_MOUSE, 512, 640, 128, 64, machine_amstrad_init, NULL, NULL },
{ "[8086] Olivetti M24", ROM_OLIM24, "olivetti_m24", L"olivetti/m24", {{"", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA | MACHINE_VIDEO | MACHINE_MOUSE, 128, 640, 128, 0, machine_olim24_init, NULL, NULL },
{ "[8086] Tandy 1000 SL/2", ROM_TANDY1000SL2, "tandy_1000sl2", L"tandy/t1000sl2", {{"", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA, 512, 768, 128, 0, machine_tandy1k_init, NULL, NULL },
{ "[8086] Tandy 1000 SL/2", ROM_TANDY1000SL2, "tandy_1000sl2", L"tandy/t1000sl2", {{"", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA, 512, 768, 128, 0, machine_tandy1k_init, &m_tandy1k_sl2_device, NULL },
{ "[8086] Toshiba 1200", ROM_T1200, "toshiba_t1200", L"toshiba/t1200", {{"", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_ISA | MACHINE_VIDEO, 1024, 2048,1024, 64, machine_xt_t1200_init, NULL, machine_xt_t1x00_close },
#if defined(DEV_BRANCH) && defined(USE_LASERXT)
{ "[8086] VTech Laser XT3", ROM_LXT3, "vtech_lxt3", L"vtech/lxt3", {{"", cpus_8086}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_ISA, 256, 512, 256, 0, machine_xt_laserxt_init, NULL, NULL },
@@ -142,7 +142,7 @@ const machine_t machines[] = {
{ "[Socket 5 NX] Intel Premiere/PCI II", ROM_PLATO, "intel_plato", L"intel/plato", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 2, 128, 2, 128, machine_at_plato_init, NULL, NULL },
{ "[Socket 5 FX] ASUS P/I-P54TP4XE", ROM_P54TP4XE, "asus_p54tp4xe", L"asus/p54tp4xe", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_HDC, 8, 128, 8, 128, machine_at_p54tp4xe_init, NULL, NULL },
{ "[Socket 5 FX] Intel Advanced/EV", ROM_ENDEAVOR, "intel_endeavor", L"intel/endeavor", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC | MACHINE_VIDEO, 8, 128, 8, 128, machine_at_endeavor_init, at_endeavor_get_device, NULL },
{ "[Socket 5 FX] Intel Advanced/EV", ROM_ENDEAVOR, "intel_endeavor", L"intel/endeavor", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC | MACHINE_VIDEO, 8, 128, 8, 128, machine_at_endeavor_init, &m_at_endeavor_device, NULL },
{ "[Socket 5 FX] Intel Advanced/ZP", ROM_ZAPPA, "intel_zappa", L"intel/zappa", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 128, machine_at_zappa_init, NULL, NULL },
{ "[Socket 5 FX] PC Partner MB500N", ROM_MB500N, "pcpartner_mb500n", L"pcpartner/mb500n", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_HDC, 8, 128, 8, 128, machine_at_mb500n_init, NULL, NULL },
{ "[Socket 5 FX] President Award 430FX PCI",ROM_PRESIDENT, "president", L"president/president", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_HDC, 8, 128, 8, 128, machine_at_president_init, NULL, NULL },
@@ -163,7 +163,7 @@ const machine_t machines[] = {
{ "[Socket 5 NX] Intel Premiere/PCI II", ROM_PLATO, "intel_plato", L"intel/plato", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 2, 128, 2, 128, machine_at_plato_init, NULL, NULL },
{ "[Socket 5 FX] ASUS P/I-P54TP4XE", ROM_P54TP4XE, "asus_p54tp4xe", L"asus/p54tp4xe", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_HDC, 8, 128, 8, 128, machine_at_p54tp4xe_init, NULL, NULL },
{ "[Socket 5 FX] Intel Advanced/EV", ROM_ENDEAVOR, "intel_endeavor", L"intel/endeavor", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC | MACHINE_VIDEO, 8, 128, 8, 128, machine_at_endeavor_init, at_endeavor_get_device, NULL },
{ "[Socket 5 FX] Intel Advanced/EV", ROM_ENDEAVOR, "intel_endeavor", L"intel/endeavor", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC | MACHINE_VIDEO, 8, 128, 8, 128, machine_at_endeavor_init, &m_at_endeavor_device, NULL },
{ "[Socket 5 FX] Intel Advanced/ZP", ROM_ZAPPA, "intel_zappa", L"intel/zappa", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 128, machine_at_zappa_init, NULL, NULL },
{ "[Socket 5 FX] PC Partner MB500N", ROM_MB500N, "pcpartner_mb500n", L"pcpartner/mb500n", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_HDC, 8, 128, 8, 128, machine_at_mb500n_init, NULL, NULL },
{ "[Socket 5 FX] President Award 430FX PCI",ROM_PRESIDENT, "president", L"president/president", {{"Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_HDC, 8, 128, 8, 128, machine_at_president_init, NULL, NULL },
@@ -236,10 +236,7 @@ machine_getname(void)
const device_t *
machine_getdevice(int machine)
{
if (machines[machine].get_device)
return(machines[machine].get_device());
return(NULL);
return(machines[machine].device);
}

View File

@@ -12,7 +12,7 @@
* the DYNAMIC_TABLES=1 enables this. Will eventually go
* away, either way...
*
* Version: @(#)mem.c 1.0.11 2018/03/30
* Version: @(#)mem.c 1.0.12 2018/04/03
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -142,11 +142,7 @@ static mem_mapping_t base_mapping;
static mem_mapping_t ram_remapped_mapping;
static mem_mapping_t ram_split_mapping;
#if FIXME
static uint8_t ff_array[0x1000];
#else
static uint8_t ff_pccache[4] = { 0xff, 0xff, 0xff, 0xff };
#endif
static int port_92_reg = 0;
@@ -483,11 +479,7 @@ getpccache(uint32_t a)
pclog("Bad getpccache %08X\n", a);
#if 0
return &ff_array[0-(uintptr_t)(a2 & ~0xfff)];
#else
return (uint8_t *)&ff_pccache;
#endif
}
@@ -1621,9 +1613,7 @@ pclog("MEM: reset: previous pages=%08lx, pages_sz=%i\n", pages, pages_sz);
memset(pages, 0x00, m*sizeof(page_t));
#if DYNAMIC_TABLES
pclog("MEM: reset: new pages=%08lx, pages_sz=%i\n", pages, pages_sz);
#endif
#if DYNAMIC_TABLES
/* Allocate the (new) lookup tables. */
if (page_lookup != NULL) free(page_lookup);
page_lookup = (page_t **)malloc(pages_sz*sizeof(page_t *));
@@ -1731,6 +1721,7 @@ mem_init(void)
/* Perform a one-time init. */
ram = rom = NULL;
pages = NULL;
pages_sz = 0;
#if DYNAMIC_TABLES
page_lookup = NULL;
readlookup2 = NULL;
@@ -1747,10 +1738,6 @@ mem_init(void)
memset(ram_mapped_addr, 0x00, 64 * sizeof(uint32_t));
#if FIXME
memset(ff_array, 0xff, sizeof(ff_array));
#endif
/* Reset the memory state. */
mem_reset();
}
@@ -1806,8 +1793,10 @@ mem_reset_page_blocks(void)
pages[c].write_b = mem_write_ramb_page;
pages[c].write_w = mem_write_ramw_page;
pages[c].write_l = mem_write_raml_page;
pages[c].block[0] = pages[c].block[1] = pages[c].block[2] = pages[c].block[3] = NULL;
pages[c].block_2[0] = pages[c].block_2[1] = pages[c].block_2[2] = pages[c].block_2[3] = NULL;
pages[c].block[0] = pages[c].block[1] =
pages[c].block[2] = pages[c].block[3] = NULL;
pages[c].block_2[0] = pages[c].block_2[1] =
pages[c].block_2[2] = pages[c].block_2[3] = NULL;
}
}