am9517a: added eisa variant

This commit is contained in:
Patrick Mackinlay 2019-01-22 19:18:51 +07:00
parent 752f1a331d
commit 4ce894b05f
2 changed files with 69 additions and 5 deletions

View File

@ -39,6 +39,18 @@
*/
/*
* The EISA_DMA device represents the 82C37A-compatible DMA devices present in
* EISA bus systems, in particular those embedded within the i82357 Integrated
* System Peripheral. The device supports 32 bit addressing, 32 bit data sizes,
* and 24 bit transfer counts, allowing DMA across 64k boundaries. It also adds
* stop registers, supporting ring-buffer memory arrangements.
*
* TODO
* - stop registers
* - 16/32-bit transfer sizes
*/
#include "emu.h"
#include "am9517a.h"
@ -54,6 +66,7 @@
DEFINE_DEVICE_TYPE(AM9517A, am9517a_device, "am9517a", "AM9517A")
DEFINE_DEVICE_TYPE(V5X_DMAU, v5x_dmau_device, "v5x_dmau", "V5X DMAU")
DEFINE_DEVICE_TYPE(PCXPORT_DMAC, pcxport_dmac_device, "pcx_dmac", "PC Transporter DMAC")
DEFINE_DEVICE_TYPE(EISA_DMA, eisa_dma_device, "eisa_dma", "EISA DMA")
//**************************************************************************
@ -290,8 +303,6 @@ inline void am9517a_device::dma_advance()
{
bool msb_changed = false;
m_channel[m_current_channel].m_count--;
if (m_current_channel || !COMMAND_MEM_TO_MEM || !COMMAND_CH0_ADDRESS_HOLD)
{
if (MODE_ADDRESS_DECREMENT)
@ -316,7 +327,7 @@ inline void am9517a_device::dma_advance()
}
}
if (m_channel[m_current_channel].m_count == 0xffff)
if (m_channel[m_current_channel].m_count-- == 0)
{
end_of_process();
}
@ -1298,3 +1309,17 @@ void pcxport_dmac_device::end_of_process()
m_state = STATE_SI;
}
eisa_dma_device::eisa_dma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: am9517a_device(mconfig, EISA_DMA, tag, owner, clock)
{
}
void eisa_dma_device::device_start()
{
am9517a_device::device_start();
m_address_mask = 0xffffffffU;
save_item(NAME(m_stop));
}

View File

@ -95,9 +95,9 @@ protected:
struct
{
uint32_t m_address;
uint16_t m_count;
uint32_t m_count;
uint32_t m_base_address;
uint16_t m_base_count;
uint32_t m_base_count;
uint8_t m_mode;
} m_channel[4];
@ -186,11 +186,50 @@ protected:
virtual void end_of_process() override;
};
class eisa_dma_device : public am9517a_device
{
public:
eisa_dma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <unsigned Channel> u8 get_address_page() { return m_channel[Channel].m_address >> 16; }
template <unsigned Channel> void set_address_page(u8 data)
{
m_channel[Channel].m_base_address = (m_channel[Channel].m_base_address & 0x0000ffffU) | (u32(data) << 16);
m_channel[Channel].m_address = (m_channel[Channel].m_address & 0x0000ffffU) | (u32(data) << 16);
}
template <unsigned Channel> u8 get_address_page_high() { return m_channel[Channel].m_address >> 24; }
template <unsigned Channel> void set_address_page_high(u8 data)
{
m_channel[Channel].m_base_address = (m_channel[Channel].m_base_address & 0x00ffffffU) | (u32(data) << 24);
m_channel[Channel].m_address = (m_channel[Channel].m_address & 0x00ffffffU) | (u32(data) << 24);
}
template <unsigned Channel> u8 get_count_high() { return m_channel[Channel].m_count >> 16; }
template <unsigned Channel> void set_count_high(u8 data)
{
m_channel[Channel].m_base_count = (m_channel[Channel].m_base_count & 0x0000ffffU) | (u32(data) << 16);
m_channel[Channel].m_count = (m_channel[Channel].m_count & 0x0000ffffU) | (u32(data) << 16);
}
template <unsigned Channel> u32 get_stop() { return m_stop[Channel]; }
template <unsigned Channel> void set_stop(offs_t offset, u32 data, u32 mem_mask)
{
mem_mask &= 0x00fffffcU;
COMBINE_DATA(&m_stop[Channel]);
}
protected:
virtual void device_start() override;
private:
u32 m_stop[4];
};
// device type definition
DECLARE_DEVICE_TYPE(AM9517A, am9517a_device)
DECLARE_DEVICE_TYPE(V5X_DMAU, v5x_dmau_device)
DECLARE_DEVICE_TYPE(PCXPORT_DMAC, pcxport_dmac_device)
DECLARE_DEVICE_TYPE(EISA_DMA, eisa_dma_device)
#endif // MAME_MACHINE_AM9517_H