Skip to content
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

z80dma.cpp: add derivateves ZILOG, UA858D, SPEC_NEXT #12658

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

holub
Copy link
Contributor

@holub holub commented Aug 12, 2024

z80dma.cpp: add derivateves ZILOG, UA858D, SPEC_NEXT
sinclair/spec128.cpp: configuration option for DMA extension

details: https://velesoft.speccy.cz/data-gear.htm

sinclair/spec128.cpp: configuration option for DMA extension
@ajrhacker
Copy link
Contributor

Is there a good way to avoid wedging SpecNext configuration into the base Z80DMA device? (Perhaps UA858D might also be worth supporting as its own type for East German systems such as rt1715.)

@holub
Copy link
Contributor Author

holub commented Aug 14, 2024

I was thinking about it too. The problem is that both zx mod and next itself allows switch between two modes.
Having it separated will make usage on the client's side a bit more complicated.

@angelosa
Copy link
Member

Consider using a virtual sub function that gets overridden in the subclasses?

Comment on lines 430 to 437
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused: why it needs a pre-increment before the transfer occurs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to look at this in combination with block below. Next mode initialized with exact N transfers value, not N+1 as original z80dma

@holub
Copy link
Contributor Author

holub commented Aug 19, 2024

Consider using a virtual sub function that gets overridden in the subclasses?

Not sure it's clear for me. E.g. for Next we have one dma which operates in both modes depending on the port. That means we can init dma in Z80 mode but start in N.

@angelosa
Copy link
Member

Yes, and moving this logic from specnext_dma.cpp/.h to z80dma doesn't sound a solution to me. Consider that anything that don't care about Next will branch false twice for every single transfer byte with this.
What's wrong about do_write being handled in specnext_dma instead?

@holub
Copy link
Contributor Author

holub commented Aug 19, 2024

I can revert specnext_dma files.
What about ua858d? Are we agree to keep it conditional here and just expose extra type which sets desired mode in the constructor?

@holub
Copy link
Contributor Author

holub commented Aug 29, 2024

@ajrhacker @angelosa Better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants