abc1600: Implement RAM parity test bit. [Curt Coder]

This commit is contained in:
Curt Coder 2022-03-30 14:43:33 +03:00
parent bc053a7a4f
commit 25037a43a1
4 changed files with 28 additions and 10 deletions

View File

@ -424,7 +424,7 @@ void abc1600_state::spec_contr_reg_w(uint8_t data)
break;
case 4: // PARTST
m_partst = state;
m_mac->partst_w(state);
break;
case 5: // _DMADIS
@ -815,7 +815,6 @@ void abc1600_state::machine_start()
save_item(NAME(m_dmadis));
save_item(NAME(m_sysscc));
save_item(NAME(m_sysfs));
save_item(NAME(m_partst));
save_item(NAME(m_cs7));
save_item(NAME(m_bus0));
save_item(NAME(m_csb));

View File

@ -149,7 +149,6 @@ private:
int m_dmadis = 0;
int m_sysscc = 0;
int m_sysfs = 0;
int m_partst = 0; // parity test
void abc1600_mem(address_map &map);
void mac_mem(address_map &map);

View File

@ -26,6 +26,8 @@
#define PAGE_WP BIT(page_data, 14)
#define PAGE_NONX BIT(page_data, 15)
#define DMAOK 0x04
//**************************************************************************
@ -107,7 +109,8 @@ abc1600_mac_device::abc1600_mac_device(const machine_config &mconfig, const char
m_boote(0),
m_magic(0),
m_task(0),
m_cause(0)
m_cause(0),
m_partst(0)
{
}
@ -130,6 +133,7 @@ void abc1600_mac_device::device_start()
save_item(NAME(m_task));
save_item(NAME(m_dmamap));
save_item(NAME(m_cause));
save_item(NAME(m_partst));
// HACK fill segment RAM or abcenix won't boot
memset(m_segment_ram, 0xff, 0x200);
@ -183,6 +187,8 @@ inline offs_t abc1600_mac_device::get_physical_offset(offs_t offset, int task, b
nonx = PAGE_NONX;
wp = PAGE_WP;
m_cause = ((offset >> 13) & 0x1f) | DMAOK;
if (LOG && (offset != virtual_offset)) logerror("%s MAC %05x:%06x (SEGA %03x SEGD %02x PGA %03x PGD %04x NONX %u WP %u TASK %u FC %u MAGIC %u)\n",
machine().describe_context(), offset, virtual_offset, sega, segd, pga, page_data, nonx, wp, task, m_read_fc(), m_magic);
@ -313,10 +319,12 @@ uint8_t abc1600_mac_device::cause_r()
*/
uint8_t data = 0x02;
uint8_t data = 0;
// DMA status
data |= m_cause;
if (!m_partst)
{
data = 0x02 | m_cause;
}
m_watchdog->watchdog_reset();
@ -674,6 +682,16 @@ void abc1600_mac_device::dmamap_w(offs_t offset, uint8_t data)
}
//-------------------------------------------------
// partst_w - parity test
//-------------------------------------------------
void abc1600_mac_device::partst_w(int state)
{
m_partst = state;
}
//-------------------------------------------------
// dump - dump MAC mappings
//-------------------------------------------------

View File

@ -56,6 +56,7 @@ public:
uint8_t page_hi_r(offs_t offset);
void page_hi_w(offs_t offset, uint8_t data);
void dmamap_w(offs_t offset, uint8_t data);
void partst_w(int state);
uint8_t dma0_mreq_r(offs_t offset) { return dma_mreq_r(0, DMAMAP_R0_LO, offset); }
void dma0_mreq_w(offs_t offset, uint8_t data) { dma_mreq_w(0, DMAMAP_R0_LO, offset, data); }
@ -122,12 +123,13 @@ private:
devcb_read8::array<3> m_read_tren;
devcb_write8::array<3> m_write_tren;
bool m_boote;
bool m_magic;
int m_task;
bool m_boote = 0;
bool m_magic = 0;
int m_task = 0;
uint8_t m_dmamap[8];
uint8_t m_cause;
bool m_partst = 0;
};