Current WIP code.
This commit is contained in:
@@ -28,13 +28,13 @@ PnP registers :
|
||||
#include <wchar.h>
|
||||
#include "86box.h"
|
||||
#include "device.h"
|
||||
#include "io.h"
|
||||
#include "86box_io.h"
|
||||
#include "timer.h"
|
||||
#include "pci.h"
|
||||
#include "lpt.h"
|
||||
#include "serial.h"
|
||||
#include "floppy/fdd.h"
|
||||
#include "floppy/fdc.h"
|
||||
#include "fdd.h"
|
||||
#include "fdc.h"
|
||||
#include "sio.h"
|
||||
|
||||
|
||||
@@ -80,6 +80,8 @@ um8669f_pnp_write(uint16_t port, uint8_t val, void *priv)
|
||||
uint8_t valxor = 0;
|
||||
uint8_t lpt_irq = 0xff;
|
||||
|
||||
pclog("Write %02X at %04X\n", val, port);
|
||||
|
||||
if (port == 0x279)
|
||||
dev->cur_reg = val;
|
||||
else {
|
||||
@@ -181,11 +183,14 @@ um8669f_pnp_read(uint16_t port, void *priv)
|
||||
}
|
||||
|
||||
|
||||
void um8669f_write(uint16_t port, uint8_t val, void *priv)
|
||||
void
|
||||
um8669f_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
um8669f_t *dev = (um8669f_t *) priv;
|
||||
int new_pnp_active;
|
||||
|
||||
pclog("Write %02X at %04X\n", val, port);
|
||||
|
||||
if (dev->locked) {
|
||||
if ((port == 0x108) && (val == 0xaa))
|
||||
dev->locked = 0;
|
||||
@@ -224,7 +229,8 @@ void um8669f_write(uint16_t port, uint8_t val, void *priv)
|
||||
}
|
||||
|
||||
|
||||
uint8_t um8669f_read(uint16_t port, void *priv)
|
||||
uint8_t
|
||||
um8669f_read(uint16_t port, void *priv)
|
||||
{
|
||||
um8669f_t *dev = (um8669f_t *) priv;
|
||||
uint8_t ret = 0xff;
|
||||
@@ -291,13 +297,27 @@ um8669f_close(void *priv)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
um8669f_detect_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
pclog("Write %02X at %04X\n", val, port);
|
||||
}
|
||||
|
||||
|
||||
uint8_t
|
||||
um8669f_detect_read(uint16_t port, void *priv)
|
||||
{
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
|
||||
static void *
|
||||
um8669f_init(const device_t *info)
|
||||
{
|
||||
um8669f_t *dev = (um8669f_t *) malloc(sizeof(um8669f_t));
|
||||
memset(dev, 0, sizeof(um8669f_t));
|
||||
|
||||
dev->fdc = device_add(&fdc_at_device);
|
||||
dev->fdc = device_add(&fdc_at_smc_device);
|
||||
|
||||
dev->uart[0] = device_add_inst(&ns16550_device, 1);
|
||||
dev->uart[1] = device_add_inst(&ns16550_device, 2);
|
||||
@@ -305,6 +325,15 @@ um8669f_init(const device_t *info)
|
||||
io_sethandler(0x0108, 0x0002,
|
||||
um8669f_read, NULL, NULL, um8669f_write, NULL, NULL, dev);
|
||||
|
||||
io_sethandler(0x0370, 0x0002,
|
||||
um8669f_detect_read, NULL, NULL, um8669f_detect_write, NULL, NULL, dev);
|
||||
io_sethandler(0x03bd, 0x0001,
|
||||
um8669f_detect_read, NULL, NULL, um8669f_detect_write, NULL, NULL, dev);
|
||||
io_sethandler(0x03bf, 0x0001,
|
||||
um8669f_detect_read, NULL, NULL, um8669f_detect_write, NULL, NULL, dev);
|
||||
io_sethandler(0x03f0, 0x0002,
|
||||
um8669f_detect_read, NULL, NULL, um8669f_detect_write, NULL, NULL, dev);
|
||||
|
||||
um8669f_reset(dev);
|
||||
|
||||
return dev;
|
||||
|
||||
Reference in New Issue
Block a user