Files
86Box/src/headland.c
OBattler 42ed2920e2 Fixed handling of 86F version 1.50 track offset table reads and writes;
Added handlers for formatting and reading/writting 86F mode 2 and 3 images that rely on sync bytes and address marks like a real FDC would.
2016-09-28 22:56:19 +02:00

50 lines
1.5 KiB
C

/* Copyright holders: Sarah Walker
see COPYING for more details
*/
#include "ibm.h"
#include "io.h"
#include "mem.h"
#include "cpu.h"
#include "headland.h"
static int headland_index;
static uint8_t headland_regs[256];
void headland_write(uint16_t addr, uint8_t val, void *priv)
{
if (addr & 1)
{
if (headland_index == 0xc1 && !is486) val = 0;
headland_regs[headland_index] = val;
// pclog("Headland write %02X %02X\n",headland_index,val);
if (headland_index == 0x82)
{
shadowbios = val & 0x10;
shadowbios_write = !(val & 0x10);
if (shadowbios)
mem_set_mem_state(0xf0000, 0x10000, MEM_READ_INTERNAL | MEM_WRITE_DISABLED);
else
mem_set_mem_state(0xf0000, 0x10000, MEM_READ_EXTERNAL | MEM_WRITE_INTERNAL);
}
}
else
headland_index = val;
}
uint8_t headland_read(uint16_t addr, void *priv)
{
if (addr & 1)
{
if ((headland_index >= 0xc0 || headland_index == 0x20) && cpu_iscyrix)
return 0xff; /*Don't conflict with Cyrix config registers*/
return headland_regs[headland_index];
}
return headland_index;
}
void headland_init()
{
io_sethandler(0x0022, 0x0002, headland_read, NULL, NULL, headland_write, NULL, NULL, NULL);
}