Some stability improvements for Chip fastpath?

This commit is contained in:
beeanyew
2021-08-10 15:41:00 +02:00
parent 9043334114
commit 88c8b9d47c
2 changed files with 31 additions and 2 deletions

View File

@@ -232,7 +232,10 @@ void ps_write_status_reg(unsigned int value) {
*(gpio + 7) = ((value & 0xffff) << 8) | (REG_STATUS << PIN_A0);
*(gpio + 7) = 1 << PIN_WR;
*(gpio + 7) = 1 << PIN_WR; // delay
*(gpio + 7) = 1 << PIN_WR; // delay
#ifdef CHIP_FASTPATH
*(gpio + 7) = 1 << PIN_WR; // delay 210810
#endif
*(gpio + 10) = 1 << PIN_WR;
*(gpio + 10) = 0xffffec;
@@ -247,9 +250,14 @@ unsigned int ps_read_status_reg() {
*(gpio + 7) = 1 << PIN_RD;
*(gpio + 7) = 1 << PIN_RD;
*(gpio + 7) = 1 << PIN_RD;
#ifdef CHIP_FASTPATH
*(gpio + 7) = 1 << PIN_RD; // delay 210810
*(gpio + 7) = 1 << PIN_RD; // delay 210810
#endif
unsigned int value = *(gpio + 13);
while ((value=*(gpio + 13)) & (1 << PIN_TXN_IN_PROGRESS)) {}
*(gpio + 10) = 0xffffec;
return (value >> 8) & 0xffff;
@@ -270,6 +278,7 @@ void ps_pulse_reset() {
unsigned int ps_get_ipl_zero() {
unsigned int value = *(gpio + 13);
while ((value=*(gpio + 13)) & (1 << PIN_TXN_IN_PROGRESS)) {}
return value & (1 << PIN_IPL_ZERO);
}

View File

@@ -1333,6 +1333,9 @@ static inline uint m68ki_read_16_fc(m68ki_cpu_core *state, uint address, uint fc
#ifdef CHIP_FASTPATH
if (!state->ovl && address < 0x200000) {
if (address & 0x01) {
return ((ps_read_8(address) << 8) | ps_read_8(address + 1));
}
return ps_read_16(address);
}
#endif
@@ -1369,6 +1372,12 @@ static inline uint m68ki_read_32_fc(m68ki_cpu_core *state, uint address, uint fc
#ifdef CHIP_FASTPATH
if (!state->ovl && address < 0x200000) {
if (address & 0x01) {
uint32_t c = ps_read_8(address);
c |= (be16toh(ps_read_16(address+1)) << 8);
c |= (ps_read_8(address + 3) << 24);
return htobe32(c);
}
return ps_read_32(address);
}
#endif
@@ -1445,6 +1454,11 @@ static inline void m68ki_write_16_fc(m68ki_cpu_core *state, uint address, uint f
#ifdef CHIP_FASTPATH
if (!state->ovl && address < 0x200000) {
if (address & 0x01) {
ps_write_8(value & 0xFF, address);
ps_write_8((value >> 8) & 0xFF, address + 1);
return;
}
ps_write_16(address, value);
return;
}
@@ -1484,6 +1498,12 @@ static inline void m68ki_write_32_fc(m68ki_cpu_core *state, uint address, uint f
#ifdef CHIP_FASTPATH
if (!state->ovl && address < 0x200000) {
if (address & 0x01) {
ps_write_8(value & 0xFF, address);
ps_write_16(htobe16(((value >> 8) & 0xFFFF)), address + 1);
ps_write_8((value >> 24), address + 3);
return;
}
ps_write_32(address, value);
return;
}