Revert IPL rom optimization.

Something's not quite right with it.
This commit is contained in:
Brandon Wright 2019-03-10 20:19:54 -05:00
parent 0d4ee55824
commit 8624a3d013
5 changed files with 4 additions and 41 deletions

View File

@ -27,15 +27,14 @@ void SMP::op_io(unsigned clocks) {
uint8 SMP::op_read(uint16 addr) {
tick();
if((addr & 0xfff0) == 0x00f0) return mmio_read(addr);
if(addr >= 0xffc0 && status.iplrom_enable) return iplrom[addr & 0x3f];
return apuram[addr];
}
void SMP::op_write(uint16 addr, uint8 data) {
tick();
if((addr & 0xfff0) == 0x00f0 || addr >= 0xffc0)
mmio_write(addr, data);
else
apuram[addr] = data;
if((addr & 0xfff0) == 0x00f0) mmio_write(addr, data);
apuram[addr] = data; //all writes go to RAM, even MMIO writes
}
uint8 SMP::op_readstack()

View File

@ -51,31 +51,10 @@ unsigned SMP::mmio_read(unsigned addr) {
}
void SMP::mmio_write(unsigned addr, unsigned data) {
if (addr >= 0xffc0) {
if (status.iplrom_enable)
highmem[addr & 0x3f] = data;
else
apuram[addr] = data;
return;
}
switch(addr) {
case 0xf1:
if (((data & 0x80) > 0) != status.iplrom_enable) {
if (status.iplrom_enable)
{
status.iplrom_enable = false;
memcpy(&apuram[0xffc0], highmem, 64);
}
else
{
status.iplrom_enable = true;
memcpy(highmem, &apuram[0xffc0], 64);
memcpy(&apuram[0xffc0], iplrom, 64);
}
}
status.iplrom_enable = data & 0x80;
if(data & 0x30) {
if(data & 0x20) {
@ -144,6 +123,4 @@ void SMP::mmio_write(unsigned addr, unsigned data) {
timer2.target = data;
break;
}
apuram[addr] = data; //all writes go to RAM, even MMIO writes
}

View File

@ -50,8 +50,6 @@ void SMP::reset() {
//$00f1
status.iplrom_enable = true;
memset(highmem, 0, 64);
memcpy(&apuram[0xffc0], iplrom, 64);
//$00f2
status.dsp_addr = 0x00;

View File

@ -1,7 +1,6 @@
class SMP : public Processor {
public:
static const uint8 iplrom[64];
uint8 highmem[64];
uint8 *apuram;
unsigned port_read(unsigned port);

View File

@ -73,11 +73,6 @@ void SMP::save_spc (uint8 *block) {
void SMP::save_state(uint8 **block) {
uint8 *ptr = *block;
memcpy(ptr, apuram, 64 * 1024);
if (status.iplrom_enable)
{
memcpy(&ptr[0xffc0], highmem, 64);
}
ptr += 64 * 1024;
#undef INT32
@ -165,11 +160,6 @@ void SMP::load_state(uint8 **block) {
INT32(regs.p.c);
INT32(status.iplrom_enable);
if (status.iplrom_enable)
{
memcpy(highmem, &apuram[0xffc0], 64);
memcpy(&apuram[0xffc0], iplrom, 64);
}
INT32(status.dsp_addr);