diff --git a/gpio/ps_protocol.c b/gpio/ps_protocol.c index 4fb4ee6..68b12e7 100644 --- a/gpio/ps_protocol.c +++ b/gpio/ps_protocol.c @@ -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); } diff --git a/m68kcpu.h b/m68kcpu.h index f10ac97..78fa0d8 100644 --- a/m68kcpu.h +++ b/m68kcpu.h @@ -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; }