2016-06-26 00:34:39 +02:00
|
|
|
/*INTEL 82355 MCR emulation
|
|
|
|
|
This chip was used as part of many 386 chipsets
|
|
|
|
|
It controls memory addressing and shadowing*/
|
2017-09-25 04:31:20 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <wchar.h>
|
2017-10-17 01:59:09 -04:00
|
|
|
#include "86box.h"
|
2016-06-26 00:34:39 +02:00
|
|
|
#include "ibm.h"
|
2017-11-02 02:28:00 -05:00
|
|
|
#include "mem.h"
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2017-08-24 01:14:39 -04:00
|
|
|
|
2016-06-26 00:34:39 +02:00
|
|
|
int nextreg6;
|
|
|
|
|
uint8_t mcr22;
|
|
|
|
|
int mcrlock,mcrfirst;
|
2017-08-24 01:14:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
void resetmcr(void)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
|
|
|
|
mcrlock=0;
|
|
|
|
|
mcrfirst=1;
|
|
|
|
|
shadowbios=0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void writemcr(uint16_t addr, uint8_t val)
|
|
|
|
|
{
|
2017-11-02 02:28:00 -05:00
|
|
|
pclog("MCR: write %04X %02X %04X:%04X\n",addr,val,CS,cpu_state.pc);
|
2016-06-26 00:34:39 +02:00
|
|
|
switch (addr)
|
|
|
|
|
{
|
|
|
|
|
case 0x22:
|
|
|
|
|
if (val==6 && mcr22==6) nextreg6=1;
|
|
|
|
|
else nextreg6=0;
|
|
|
|
|
break;
|
|
|
|
|
case 0x23:
|
|
|
|
|
if (nextreg6) shadowbios=!val;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
mcr22=val;
|
|
|
|
|
}
|
|
|
|
|
|