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

spi_sdcard: add CMD18 - CMD_READ_MULTIPLE_BLOCK #8913

Merged
merged 13 commits into from Dec 1, 2021
Merged

Conversation

holub
Copy link
Contributor

@holub holub commented Dec 1, 2021

SPI_SDCARD:

  • implement state changes closer to spec
  • CMD18 - CMD_READ_MULTIPLE_BLOCK

@rb6502
Copy link
Contributor

rb6502 commented Dec 1, 2021

Thanks! At a glance this looks like a great cleanup and addition, and I'll do a more in-depth review when I have some time. Are you working on something either inside or outside of MAME that uses CMD_READ_MULTIPLE_BLOCK?

@holub
Copy link
Contributor Author

holub commented Dec 1, 2021 via email

src/devices/machine/spi_sdcard.cpp Outdated Show resolved Hide resolved
src/devices/machine/spi_sdcard.cpp Outdated Show resolved Hide resolved
src/devices/machine/spi_sdcard.h Outdated Show resolved Hide resolved
src/devices/machine/spi_sdcard.h Outdated Show resolved Hide resolved
src/devices/machine/spi_sdcard.cpp Outdated Show resolved Hide resolved
src/devices/machine/spi_sdcard.cpp Outdated Show resolved Hide resolved
src/devices/machine/spi_sdcard.cpp Outdated Show resolved Hide resolved
src/devices/machine/spi_sdcard.cpp Outdated Show resolved Hide resolved
src/devices/machine/spi_sdcard.cpp Outdated Show resolved Hide resolved
src/devices/machine/spi_sdcard.h Outdated Show resolved Hide resolved
src/devices/machine/spi_sdcard.h Outdated Show resolved Hide resolved
src/devices/machine/spi_sdcard.h Outdated Show resolved Hide resolved
@cuavas
Copy link
Member

cuavas commented Dec 1, 2021

Why have you added the m_cmd parameter to do_command in the first place? It’s an instance member function, so the instance data member m_cmd is accessible directly. As it’s an array, it’s implicitly passed as a pointer, so it’s not making a local copy of the command to pass to the function. It just seems like a roundabout and error-prone way of accessing a member.

@holub holub requested a review from cuavas December 1, 2021 19:41
Copy link
Member

@cuavas cuavas left a comment

Choose a reason for hiding this comment

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

The “checklist review” stuff I was looking at has all been addressed. I’ll leave it to @rb6502 to review the actual logic here.

@cuavas cuavas requested a review from rb6502 December 1, 2021 19:44
@holub
Copy link
Contributor Author

holub commented Dec 1, 2021

The “checklist review” stuff I was looking at has all been addressed. I’ll leave it to @rb6502 to review the actual logic here.

Thank your rapid responses and patience!

@rb6502 rb6502 merged commit 12b260e into mamedev:master Dec 1, 2021
@rb6502
Copy link
Contributor

rb6502 commented Dec 2, 2021

Hey @holub, was the change to the CMD8 response intentional? It should be valid for SD version 2 and later - does the Spectrum device assume version 1 and a different response? Anyway, I've merged your changes and reverted the CMD8 response, because the different response was confusing the firmware of the Apple II SD.

@holub
Copy link
Contributor Author

holub commented Dec 2, 2021

Hey @holub, was the change to the CMD8 response intentional? It should be valid for SD version 2 and later - does the Spectrum device assume version 1 and a different response? Anyway, I've merged your changes and reverted the CMD8 response, because the different response was confusing the firmware of the Apple II SD.

Interesting case indeed. Ref (4.3.13 Send Interface Condition Command (CMD8)) respond with voltage info. Weird Apple ll just echos back. I'll take a look what can be missed and where.
UPDATED: It's opposite case. Looks like my fault. Sorry.

@rb6502
Copy link
Contributor

rb6502 commented Dec 2, 2021

You can see what the Apple II firmware's doing at line 249 here:
https://github.com/freitz85/AppleIISd/blob/master/Firmware/src/AppleIISd.s

It wants the first response byte to be 0x01, and it wants R33 to contain 0xAA for the card to pass as version 2.

@holub
Copy link
Contributor Author

holub commented Dec 2, 2021 via email

@holub holub deleted the spi-multi branch March 7, 2022 00:39
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.

None yet

3 participants