Added the Phoenix 486 Jumper Readout port
A must have for Phoenix 486 machines
This commit is contained in:
@@ -100,21 +100,6 @@ acc2168_read(uint16_t addr, void *p)
|
||||
return dev->regs[dev->reg_idx];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Bit 7 = Super I/O chip: 1 = enabled, 0 = disabled;
|
||||
Bit 6 = Graphics card: 1 = standalone, 0 = on-board;
|
||||
Bit 5 = ???? (if 1, siren and hangs).
|
||||
*/
|
||||
static uint8_t
|
||||
acc2168_port_78_read(uint16_t addr, void *p)
|
||||
{
|
||||
acc2168_t *dev = (acc2168_t *)p;
|
||||
|
||||
return dev->port_78;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
acc2168_close(void *priv)
|
||||
{
|
||||
@@ -132,8 +117,6 @@ acc2168_init(const device_t *info)
|
||||
|
||||
io_sethandler(0x00f2, 0x0002,
|
||||
acc2168_read, NULL, NULL, acc2168_write, NULL, NULL, dev);
|
||||
io_sethandler(0x0078, 0x0001,
|
||||
acc2168_port_78_read, NULL, NULL, NULL, NULL, NULL, dev);
|
||||
|
||||
device_add(&port_92_inv_device);
|
||||
|
||||
|
||||
107
src/device/phoenix_486_jumper.c
Normal file
107
src/device/phoenix_486_jumper.c
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of the Phoenix 486 Jumper Readout
|
||||
*
|
||||
* Copyright 2020 Tiseno100
|
||||
*/
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/timer.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/chipset.h>
|
||||
|
||||
/*
|
||||
Bit 7 = Super I/O
|
||||
Bit 6 = ???
|
||||
Bit 5 = ???
|
||||
Bit 4 = ???
|
||||
Bit 3 = ???
|
||||
Bit 2 = ???
|
||||
Bit 1 = ???
|
||||
Bit 0 = ???
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t jumper;
|
||||
} phoenix_486_jumper_t;
|
||||
|
||||
#ifdef ENABLE_PHOENIX_486_JUMPER_LOG
|
||||
int phoenix_486_jumper_do_log = ENABLE_PHOENIX_486_JUMPER_LOG;
|
||||
static void
|
||||
phoenix_486_jumper_log(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (phoenix_486_jumper_do_log) {
|
||||
va_start(ap, fmt);
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define phoenix_486_jumper_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
static void
|
||||
phoenix_486_jumper_write(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
phoenix_486_jumper_t *dev = (phoenix_486_jumper_t *) priv;
|
||||
phoenix_486_jumper_log("Phoenix 486 Jumper: Write %02x\n", val);
|
||||
dev->jumper = val;
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
phoenix_486_jumper_read(uint16_t addr, void *priv)
|
||||
{
|
||||
phoenix_486_jumper_t *dev = (phoenix_486_jumper_t *) priv;
|
||||
phoenix_486_jumper_log("Phoenix 486 Jumper: Read %02x\n", dev->jumper);
|
||||
return dev->jumper;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
phoenix_486_jumper_close(void *priv)
|
||||
{
|
||||
phoenix_486_jumper_t *dev = (phoenix_486_jumper_t *) priv;
|
||||
|
||||
free(dev);
|
||||
}
|
||||
|
||||
static void *
|
||||
phoenix_486_jumper_init(const device_t *info)
|
||||
{
|
||||
phoenix_486_jumper_t *dev = (phoenix_486_jumper_t *) malloc(sizeof(phoenix_486_jumper_t));
|
||||
memset(dev, 0, sizeof(phoenix_486_jumper_t));
|
||||
|
||||
dev->jumper = info->local;
|
||||
|
||||
io_sethandler(0x0078, 0x0001, phoenix_486_jumper_read, NULL, NULL, phoenix_486_jumper_write, NULL, NULL, dev);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
const device_t phoenix_486_jumper_device = {
|
||||
"Phoenix 486 Jumper Readout",
|
||||
0,
|
||||
0,
|
||||
phoenix_486_jumper_init, phoenix_486_jumper_close, NULL,
|
||||
NULL, NULL, NULL,
|
||||
NULL
|
||||
};
|
||||
@@ -131,6 +131,7 @@ extern const device_t vlsi_scamp_device;
|
||||
extern const device_t wd76c10_device;
|
||||
|
||||
/* Miscellaneous Hardware */
|
||||
extern const device_t phoenix_486_jumper_device;
|
||||
extern const device_t vpc2007_device;
|
||||
|
||||
#endif /*EMU_CHIPSET_H*/
|
||||
|
||||
@@ -200,6 +200,8 @@ machine_at_pb410a_init(const machine_t *model)
|
||||
device_add(&acc3221_device);
|
||||
device_add(&acc2168_device);
|
||||
|
||||
device_add(&phoenix_486_jumper_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&ht216_32_pb410a_device);
|
||||
|
||||
|
||||
@@ -656,7 +656,8 @@ DEVOBJ := bugger.o hwm.o hwm_lm75.o hwm_lm78.o hwm_gl518sm.o ibm_5161.o isamem.
|
||||
keyboard_xt.o keyboard_at.o \
|
||||
mouse.o \
|
||||
mouse_bus.o \
|
||||
mouse_serial.o mouse_ps2.o
|
||||
mouse_serial.o mouse_ps2.o \
|
||||
phoenix_486_jumper.o
|
||||
|
||||
SIOOBJ := sio_acc3221.o \
|
||||
sio_f82c710.o sio_82091aa.o \
|
||||
|
||||
Reference in New Issue
Block a user