pcem/src/intel.c
TomW 84ac04d2df Added Intel Premiere/PCI (Batman's Revenge) and Advanced/EV (Endeavor) motherboards.
Added emulation of i430LX and i430FX chipsets.
Added support for PCI configuration type 2, used by i430LX.
Added AT disable keyboard command, and fixed enable keyboard command.
Added emulation of Intel 28F001BXT flash ROM, used by Advanced/EV.
Fixed a bug in REP when using multiple 66/67 prefixes.
2014-11-23 20:27:41 +00:00

80 lines
2 KiB
C

#include "ibm.h"
#include "io.h"
#include "mem.h"
#include "pit.h"
#include "timer.h"
#include "intel.h"
uint8_t batman_brdconfig(uint16_t port, void *p)
{
// pclog("batman_brdconfig read port=%04x\n", port);
switch (port)
{
case 0x73:
return 0xff;
case 0x75:
return 0xdf;
}
return 0;
}
static uint16_t batman_timer_latch;
static int batman_timer = 0;
static void batman_timer_over(void *p)
{
batman_timer = 0;
}
static void batman_timer_write(uint16_t addr, uint8_t val, void *p)
{
if (addr & 1)
batman_timer_latch = (batman_timer_latch & 0xff) | (val << 8);
else
batman_timer_latch = (batman_timer_latch & 0xff00) | val;
batman_timer = batman_timer_latch * TIMER_USEC;
}
static uint8_t batman_timer_read(uint16_t addr, void *p)
{
uint16_t batman_timer_latch;
cycles -= (int)PITCONST;
timer_clock();
if (batman_timer < 0)
return 0;
batman_timer_latch = batman_timer / TIMER_USEC;
if (addr & 1)
return batman_timer_latch >> 8;
return batman_timer_latch & 0xff;
}
void intel_batman_init()
{
io_sethandler(0x0073, 0x0001, batman_brdconfig, NULL, NULL, NULL, NULL, NULL, NULL);
io_sethandler(0x0075, 0x0001, batman_brdconfig, NULL, NULL, NULL, NULL, NULL, NULL);
io_sethandler(0x0078, 0x0002, batman_timer_read, NULL, NULL, batman_timer_write, NULL, NULL, NULL);
timer_add(batman_timer_over, &batman_timer, &batman_timer, NULL);
}
uint8_t endeavor_brdconfig(uint16_t port, void *p)
{
// pclog("endeavor_brdconfig read port=%04x\n", port);
switch (port)
{
case 0x79:
return 0xff;
}
return 0;
}
void intel_endeavor_init()
{
io_sethandler(0x0079, 0x0001, endeavor_brdconfig, NULL, NULL, NULL, NULL, NULL, NULL);
}