-
Notifications
You must be signed in to change notification settings - Fork 2.2k
z80dma.cpp: add derivateves ZILOG, UA858D, SPEC_NEXT #12658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
c220561
7d25f7b
f915e9f
2315fc9
dabf077
05d0e74
09df03f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,6 +131,8 @@ enum | |
****************************************************************************/ | ||
DEFINE_DEVICE_TYPE(Z80DMA, z80dma_device, "z80dma", "Z80 DMA Controller") | ||
|
||
ALLOW_SAVE_TYPE(z80dma_device::dma_mode); | ||
|
||
/**************************************************************************** | ||
* z80dma_device - constructor | ||
****************************************************************************/ | ||
|
@@ -150,6 +152,7 @@ z80dma_device::z80dma_device(const machine_config &mconfig, device_type type, co | |
, m_out_mreq_cb(*this) | ||
, m_in_iorq_cb(*this, 0) | ||
, m_out_iorq_cb(*this) | ||
, m_dma_mode(dma_mode::ZILOG) | ||
{ | ||
} | ||
|
||
|
@@ -162,6 +165,7 @@ void z80dma_device::device_start() | |
m_timer = timer_alloc(FUNC(z80dma_device::clock_w), this); | ||
|
||
// register for state saving | ||
save_item(NAME(m_dma_mode)); | ||
save_item(NAME(m_regs)); | ||
save_item(NAME(m_regs_follow)); | ||
save_item(NAME(m_num_follow)); | ||
|
@@ -425,6 +429,11 @@ void z80dma_device::do_search() | |
|
||
void z80dma_device::do_write() | ||
{ | ||
if (m_byte_counter && m_dma_mode == dma_mode::SPEC_NEXT) | ||
{ | ||
m_addressB += PORTB_FIXED ? 0 : PORTB_INC ? 1 : -1; | ||
} | ||
|
||
switch(TRANSFER_MODE) | ||
{ | ||
case TM_TRANSFER: | ||
|
@@ -445,10 +454,17 @@ void z80dma_device::do_write() | |
break; | ||
} | ||
|
||
m_addressA += PORTA_FIXED ? 0 : PORTA_INC ? 1 : -1; | ||
m_addressB += PORTB_FIXED ? 0 : PORTB_INC ? 1 : -1; | ||
|
||
m_byte_counter++; | ||
m_addressA += PORTA_FIXED ? 0 : PORTA_INC ? 1 : -1; | ||
if (m_dma_mode == dma_mode::SPEC_NEXT) | ||
{ | ||
if ((m_byte_counter + 1) == m_count) | ||
m_byte_counter++; | ||
} | ||
else | ||
{ | ||
m_addressB += PORTB_FIXED ? 0 : PORTB_INC ? 1 : -1; | ||
} | ||
} | ||
|
||
/**************************************************************************** | ||
|
@@ -670,7 +686,7 @@ void z80dma_device::write(u8 data) | |
if (data & 0x10) | ||
m_regs_follow[m_num_follow++] = GET_REGNUM(MATCH_BYTE); | ||
|
||
if (BIT(data, 6)) | ||
if (BIT(data, 6) && m_dma_mode != dma_mode::UA858D) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still not quite convinced that the base There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I did this on purpose for Next case. It needs to switch type preserving existing state of registers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean, in the context of if somebody else went their own route in subclassing the arch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. Let's assume we keep specnextdma how it was before this commit. |
||
{ | ||
enable(); | ||
} | ||
|
@@ -762,6 +778,10 @@ void z80dma_device::write(u8 data) | |
break; | ||
case COMMAND_ENABLE_DMA: | ||
LOG("Z80DMA Enable DMA\n"); | ||
if (num_follow() == 0 && m_dma_mode == dma_mode::SPEC_NEXT) | ||
{ | ||
m_byte_counter = 0; | ||
} | ||
enable(); | ||
break; | ||
case COMMAND_READ_MASK_FOLLOWS: | ||
|
@@ -875,7 +895,7 @@ TIMER_CALLBACK_MEMBER(z80dma_device::rdy_write_callback) | |
void z80dma_device::rdy_w(int state) | ||
{ | ||
LOG("Z80DMA RDY: %d Active High: %d\n", state, READY_ACTIVE_HIGH); | ||
machine().scheduler().synchronize(timer_expired_delegate(FUNC(z80dma_device::rdy_write_callback),this), state); | ||
machine().scheduler().synchronize(timer_expired_delegate(FUNC(z80dma_device::rdy_write_callback), this), state); | ||
} | ||
|
||
/**************************************************************************** | ||
|
Uh oh!
There was an error while loading. Please reload this page.