From ddd1a72e45af0625044669acac1fb7b849b6db0e Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Wed, 12 Apr 2017 14:12:18 +0200 Subject: tms32026: Fix status register and banking [O. Galibert] --- src/devices/cpu/tms32025/tms32025.cpp | 36 ++++++++++++++++++----------------- src/devices/cpu/tms32025/tms32025.h | 2 ++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/devices/cpu/tms32025/tms32025.cpp b/src/devices/cpu/tms32025/tms32025.cpp index 3bc8d77938e..c656804fb6d 100644 --- a/src/devices/cpu/tms32025/tms32025.cpp +++ b/src/devices/cpu/tms32025/tms32025.cpp @@ -228,6 +228,7 @@ tms32025_device::tms32025_device(const machine_config &mconfig, const char *tag, , m_dr_in(*this) , m_dx_out(*this) { + m_fixed_STR1 = 0x0180; } @@ -247,12 +248,14 @@ tms32025_device::tms32025_device(const machine_config &mconfig, device_type type , m_dr_in(*this) , m_dx_out(*this) { + m_fixed_STR1 = 0x0180; } tms32026_device::tms32026_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms32025_device(mconfig, TMS32026, "TMS32026", tag, owner, clock, "tms32026", __FILE__, ADDRESS_MAP_NAME(tms32026_data)) { + m_fixed_STR1 = 0x0100; } @@ -332,8 +335,8 @@ WRITE16_MEMBER(tms32025_device::greg_w) void tms32025_device::CLR0(uint16_t flag) { m_STR0 &= ~flag; m_STR0 |= 0x0400; } void tms32025_device::SET0(uint16_t flag) { m_STR0 |= flag; m_STR0 |= 0x0400; } -void tms32025_device::CLR1(uint16_t flag) { m_STR1 &= ~flag; m_STR1 |= 0x0180; } -void tms32025_device::SET1(uint16_t flag) { m_STR1 |= flag; m_STR1 |= 0x0180; } +void tms32025_device::CLR1(uint16_t flag) { m_STR1 &= ~flag; m_STR1 |= m_fixed_STR1; } +void tms32025_device::SET1(uint16_t flag) { m_STR1 |= flag; m_STR1 |= m_fixed_STR1; } void tms32025_device::MODIFY_DP(int data) { @@ -345,13 +348,13 @@ void tms32025_device::MODIFY_PM(int data) { m_STR1 &= ~PM_REG; m_STR1 |= (data & PM_REG); - m_STR1 |= 0x0180; + m_STR1 |= m_fixed_STR1; } void tms32025_device::MODIFY_ARP(int data) { m_STR1 &= ~ARB_REG; m_STR1 |= (m_STR0 & ARP_REG); - m_STR1 |= 0x0180; + m_STR1 |= m_fixed_STR1; m_STR0 &= ~ARP_REG; m_STR0 |= ((data << 13) & ARP_REG); m_STR0 |= 0x0400; @@ -890,7 +893,7 @@ void tms32026_device::conf() /** Need to reconfigure the memory blocks */ if(next < 1 && prev >= 1) { m_program->unmap_readwrite(0xfa00, 0xfbff); m_data->install_ram(0x0200, 0x03ff, m_b0); - } else if(next < 1 && prev >= 1) { + } else if(next >= 1 && prev < 1) { m_program->install_ram(0xfa00, 0xfbff, m_b0); m_data->unmap_readwrite(0x0200, 0x03ff); } @@ -898,7 +901,7 @@ void tms32026_device::conf() /** Need to reconfigure the memory blocks */ if(next < 2 && prev >= 2) { m_program->unmap_readwrite(0xfc00, 0xfdff); m_data->install_ram(0x0400, 0x05ff, m_b1); - } else if(next < 2 && prev >= 2) { + } else if(next >= 2 && prev < 2) { m_program->install_ram(0xfc00, 0xfdff, m_b1); m_data->unmap_readwrite(0x0400, 0x05ff); } @@ -906,7 +909,7 @@ void tms32026_device::conf() /** Need to reconfigure the memory blocks */ if(next < 3 && prev >= 3) { m_program->unmap_readwrite(0xfe00, 0xffff); m_data->install_ram(0x0600, 0x07ff, m_b3); - } else if(next < 3 && prev >= 3) { + } else if(next >= 3 && prev < 3) { m_program->install_ram(0xfe00, 0xffff, m_b3); m_data->unmap_readwrite(0x0600, 0x07ff); } @@ -1014,8 +1017,7 @@ void tms32025_device::lst1() GETDATA(0, 0); m_mHackIgnoreARP = 0; - m_STR1 = m_ALU.w.l; - m_STR1 |= 0x0180; + m_STR1 = m_ALU.w.l | m_fixed_STR1; m_STR0 &= (~ARP_REG); /* ARB also gets copied to ARP */ m_STR0 |= (m_STR1 & ARB_REG); } @@ -1637,7 +1639,7 @@ void tms32025_device::device_start() m_PREVPC = 0; m_PFC = 0; m_STR0 = 0; - m_STR1 = 0; + m_STR1 = m_fixed_STR1; m_ACC.d = 0; m_Preg.d = 0; m_Treg = 0; @@ -1770,13 +1772,13 @@ void tms32025_device::state_string_export(const device_state_entry &entry, std:: ****************************************************************************/ void tms32025_device::common_reset() { - m_PC = 0; /* Starting address on a reset */ - m_STR0 |= 0x0600; /* INTM and unused bit set to 1 */ - m_STR0 &= 0xefff; /* OV cleared to 0. Remaining bits undefined */ - m_STR1 |= 0x07f0; /* SXM, C, HM, FSM, XF and unused bits set to 1 */ - m_STR1 &= 0xeff0; /* CNF, FO, TXM, PM bits cleared to 0. Remaining bits undefined */ - m_RPTC = 0; /* Reset repeat counter to 0 */ - m_IFR = 0; /* IRQ pending flags */ + m_PC = 0; /* Starting address on a reset */ + m_STR0 |= 0x0600; /* INTM and unused bit set to 1 */ + m_STR0 &= 0xefff; /* OV cleared to 0. Remaining bits undefined */ + m_STR1 |= 0x0670 | m_fixed_STR1; /* SXM, C, HM, FSM, XF and unused bits set to 1 */ + m_STR1 &= 0xeff0; /* CNF, FO, TXM, PM bits cleared to 0. Remaining bits undefined */ + m_RPTC = 0; /* Reset repeat counter to 0 */ + m_IFR = 0; /* IRQ pending flags */ m_xf_out(ASSERT_LINE); /* XF flag is high. Must set the pin */ diff --git a/src/devices/cpu/tms32025/tms32025.h b/src/devices/cpu/tms32025/tms32025.h index 61acec97dc5..6806eeba2d0 100644 --- a/src/devices/cpu/tms32025/tms32025.h +++ b/src/devices/cpu/tms32025/tms32025.h @@ -177,6 +177,8 @@ protected: PAIR m_ALU; uint16_t m_drr, m_dxr, m_tim, m_prd, m_imr, m_greg; + uint16_t m_fixed_STR1; + uint8_t m_timerover; /********************** Status data ****************************/ -- cgit v1.2.3