The EuroPC now uses a NVR file;

The EuroPC now includes a LPT3 port.
This commit is contained in:
OBattler
2017-08-16 02:33:25 +02:00
parent b9c749066d
commit d4f4a781cf
3 changed files with 47 additions and 4 deletions

View File

@@ -6,8 +6,8 @@
#include "lpt.h" #include "lpt.h"
static uint8_t lpt1_dat, lpt2_dat; static uint8_t lpt1_dat, lpt2_dat, lpt3_dat;
static uint8_t lpt1_ctrl, lpt2_ctrl; static uint8_t lpt1_ctrl, lpt2_ctrl, lpt3_ctrl;
void lpt1_write(uint16_t port, uint8_t val, void *priv) void lpt1_write(uint16_t port, uint8_t val, void *priv)
{ {
@@ -57,7 +57,31 @@ uint8_t lpt2_read(uint16_t port, void *priv)
return 0xff; return 0xff;
} }
uint16_t lpt_addr[2] = { 0x378, 0x278 }; void lpt3_write(uint16_t port, uint8_t val, void *priv)
{
switch (port & 3)
{
case 0:
lpt3_dat = val;
break;
case 2:
lpt3_ctrl = val;
break;
}
}
uint8_t lpt3_read(uint16_t port, void *priv)
{
switch (port & 3)
{
case 0:
return lpt3_dat;
case 2:
return lpt3_ctrl;
}
return 0xff;
}
uint16_t lpt_addr[3] = { 0x378, 0x278, 0x3bc };
void lpt_init() void lpt_init()
{ {
@@ -108,3 +132,19 @@ void lpt2_remove_ams()
io_removehandler(0x0379, 0x0002, lpt2_read, NULL, NULL, lpt2_write, NULL, NULL, NULL); io_removehandler(0x0379, 0x0002, lpt2_read, NULL, NULL, lpt2_write, NULL, NULL, NULL);
} }
} }
void lpt3_init(uint16_t port)
{
if (lpt_enabled)
{
io_sethandler(port, 0x0003, lpt3_read, NULL, NULL, lpt3_write, NULL, NULL, NULL);
lpt_addr[2] = port;
}
}
void lpt3_remove()
{
if (lpt_enabled)
{
io_removehandler(lpt_addr[2], 0x0003, lpt3_read, NULL, NULL, lpt3_write, NULL, NULL, NULL);
}
}

View File

@@ -7,3 +7,5 @@ extern void lpt1_remove();
extern void lpt2_init(uint16_t port); extern void lpt2_init(uint16_t port);
extern void lpt2_remove(); extern void lpt2_remove();
extern void lpt2_remove_ams(); extern void lpt2_remove_ams();
extern void lpt3_init(uint16_t port);
extern void lpt3_remove();

View File

@@ -148,7 +148,7 @@ MODEL models[] =
{"[8088] Generic XT clone", ROM_GENXT, "genxt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 640, 64, 0, xt_init, NULL }, {"[8088] Generic XT clone", ROM_GENXT, "genxt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 640, 64, 0, xt_init, NULL },
{"[8088] Juko XT clone", ROM_JUKOPC, "jukopc", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 640, 64, 0, xt_init, NULL }, {"[8088] Juko XT clone", ROM_JUKOPC, "jukopc", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 640, 64, 0, xt_init, NULL },
{"[8088] Phoenix XT clone", ROM_PXXT, "pxxt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 640, 64, 0, xt_init, NULL }, {"[8088] Phoenix XT clone", ROM_PXXT, "pxxt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 640, 64, 0, xt_init, NULL },
{"[8088] Schneider EuroPC", ROM_EUROPC, "europc", {{"", cpus_europc}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 512, 640, 128, 0, europc_init, NULL }, {"[8088] Schneider EuroPC", ROM_EUROPC, "europc", {{"", cpus_europc}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 512, 640, 128, 63, europc_init, NULL },
{"[8088] Tandy 1000", ROM_TANDY, "tandy", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, 0, 128, 640, 128, 0, tandy1k_init, &tandy1000_device }, {"[8088] Tandy 1000", ROM_TANDY, "tandy", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, 0, 128, 640, 128, 0, tandy1k_init, &tandy1000_device },
{"[8088] Tandy 1000 HX", ROM_TANDY1000HX, "tandy1000hx", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, 0, 256, 640, 128, 0, tandy1k_init, &tandy1000hx_device }, {"[8088] Tandy 1000 HX", ROM_TANDY1000HX, "tandy1000hx", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, 0, 256, 640, 128, 0, tandy1k_init, &tandy1000hx_device },
{"[8088] VTech Laser Turbo XT", ROM_LTXT, "ltxt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 1152, 64, 0, xt_laserxt_init, NULL }, {"[8088] VTech Laser Turbo XT", ROM_LTXT, "ltxt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 1152, 64, 0, xt_laserxt_init, NULL },
@@ -395,6 +395,7 @@ void europc_init(void)
{ {
common_init(); common_init();
mem_add_bios(); mem_add_bios();
lpt3_init();
jim_init(); jim_init();
keyboard_xt_init(); keyboard_xt_init();
nmi_init(); nmi_init();