Added new machine (4GPV31)
This commit is contained in:
101
src/machine/m_at_4gpv31.c
Normal file
101
src/machine/m_at_4gpv31.c
Normal file
@@ -0,0 +1,101 @@
|
||||
/* Emulation for C&T 82C206 ("NEAT") chipset. */
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../86box.h"
|
||||
#include "../io.h"
|
||||
#include "machine.h"
|
||||
|
||||
|
||||
static uint8_t neat_regs[256];
|
||||
static int neat_index;
|
||||
static int neat_emspage[4];
|
||||
|
||||
|
||||
static void
|
||||
neat_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
switch (port) {
|
||||
case 0x22:
|
||||
neat_index = val;
|
||||
break;
|
||||
|
||||
case 0x23:
|
||||
neat_regs[neat_index] = val;
|
||||
switch (neat_index) {
|
||||
case 0x6E: /*EMS page extension*/
|
||||
neat_emspage[3] = (neat_emspage[3] & 0x7F) | (( val & 3) << 7);
|
||||
neat_emspage[2] = (neat_emspage[2] & 0x7F) | (((val >> 2) & 3) << 7);
|
||||
neat_emspage[1] = (neat_emspage[1] & 0x7F) | (((val >> 4) & 3) << 7);
|
||||
neat_emspage[0] = (neat_emspage[0] & 0x7F) | (((val >> 6) & 3) << 7);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0208: case 0x0209: case 0x4208: case 0x4209:
|
||||
case 0x8208: case 0x8209: case 0xC208: case 0xC209:
|
||||
neat_emspage[port >> 14] = (neat_emspage[port >> 14] & 0x180) | (val & 0x7F);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
neat_read(uint16_t port, void *priv)
|
||||
{
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
switch (port) {
|
||||
case 0x22:
|
||||
ret = neat_index;
|
||||
break;
|
||||
|
||||
case 0x23:
|
||||
ret = neat_regs[neat_index];
|
||||
break;
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
#if NOT_USED
|
||||
static void
|
||||
neat_writeems(uint32_t addr, uint8_t val)
|
||||
{
|
||||
ram[(neat_emspage[(addr >> 14) & 3] << 14) + (addr & 0x3FFF)] = val;
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
neat_readems(uint32_t addr)
|
||||
{
|
||||
return ram[(neat_emspage[(addr >> 14) & 3] << 14) + (addr & 0x3FFF)];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
neat_init(void)
|
||||
{
|
||||
io_sethandler(0x0022, 2,
|
||||
neat_read,NULL,NULL, neat_write,NULL,NULL, NULL);
|
||||
io_sethandler(0x0208, 2,
|
||||
neat_read,NULL,NULL, neat_write,NULL,NULL, NULL);
|
||||
io_sethandler(0x4208, 2,
|
||||
neat_read,NULL,NULL, neat_write,NULL,NULL, NULL);
|
||||
io_sethandler(0x8208, 2,
|
||||
neat_read,NULL,NULL, neat_write,NULL,NULL, NULL);
|
||||
io_sethandler(0xc208, 2,
|
||||
neat_read,NULL,NULL, neat_write,NULL,NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
machine_at_4gpv31_init(machine_t *model)
|
||||
{
|
||||
machine_at_init(model);
|
||||
|
||||
neat_init();
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Handling of the emulated machines.
|
||||
*
|
||||
* Version: @(#)machine.h 1.0.13 2017/11/22
|
||||
* Version: @(#)machine.h 1.0.14 2017/12/04
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -136,6 +136,8 @@ extern void machine_at_r418_init(machine_t *);
|
||||
|
||||
extern void machine_at_wd76c10_init(machine_t *);
|
||||
|
||||
extern void machine_at_4gpv31_init(machine_t *);
|
||||
|
||||
extern void machine_pcjr_init(machine_t *);
|
||||
|
||||
extern void machine_ps1_m2011_init(machine_t *);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Handling of the emulated machines.
|
||||
*
|
||||
* Version: @(#)machine_table.c 1.0.4 2017/11/22
|
||||
* Version: @(#)machine_table.c 1.0.5 2017/12/04
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -99,6 +99,8 @@ machine_t machines[] = {
|
||||
|
||||
{ "[486 PCI] Rise Computer R418", ROM_R418, "r418", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_VLB | MACHINE_AT | MACHINE_HDC, 1, 255, 1, 127, machine_at_r418_init, NULL, nvr_at_close },
|
||||
|
||||
{ "[Socket 4] Green-B 4GP V3.1", ROM_4GPV31, "4gpv31", {{"Intel", cpus_i486}, {"Intel",cpus_Pentium5V},{"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486},{"", NULL}}, 0, MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_HDC, 1, 128, 1, 127, machine_at_4gpv31_init, NULL, nvr_at_close },
|
||||
|
||||
{ "[Socket 4 LX] Intel Premiere/PCI", ROM_REVENGE, "revenge", {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_PCI | MACHINE_ISA | MACHINE_VLB | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 2, 128, 2, 127, machine_at_batman_init, NULL, nvr_at_close },
|
||||
|
||||
{ "[Socket 5 NX] Intel Premiere/PCI II", ROM_PLATO, "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, 127, machine_at_plato_init, NULL, nvr_at_close },
|
||||
|
||||
Reference in New Issue
Block a user