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

[DOS/FAT32] enable selection of auto_tx and the fast write loop via U0>B #306

Merged

Conversation

mooinglemur
Copy link
Collaborator

  • This moves auto_tx to the correct bit of the SPI_CTRL register, also mirroring a recent fix on the emulator side. Now both match hardware
  • Changes the hard defines to a variable switch. sd_fast has bit 6 set for fast reads and bit 7 set for fast writes.
  • Accessible through DOS"U0>B"+CHR$(n) where n is 0 for traditional, 1 for fast reads, 2 for fast writes, 3 for both
  • The default is slow/traditional, as these fast read/write modes have not been well-tested yet. Testers can change the mode by the channel 15 command above.

@mooinglemur mooinglemur requested a review from jburks March 15, 2024 02:39
@start: ; Enable auto-tx mode
@start:
bit sd_fast
bvs @fast
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: since fast is hoped to eventually be the default, perhaps the branch should go to slow and fast should be a cycle faster?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The branch would be too far to jump over the fast routine, so nothing would be saved here.

; .A = 2: fast writes
; .A = 3: fast reads and writes
;-----------------------------------------------------------------------------
sdcard_set_fast_mode:
Copy link
Contributor

Choose a reason for hiding this comment

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

Something for possible consideration: there could be a situation where for some reason the user's system cannot tolerate fast read or write (e.g. the system is overclocked or we enable a slower SPI bus to a Wi-Fi peripheral). It might be good to have a hard override that prevents setting fast reads or writes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How do you see this working?

For now, the variable gets initialized to 0 at boot (with the most recent push) and the user has to explicitly change it.

@mooinglemur mooinglemur merged commit b969c28 into X16Community:master Mar 15, 2024
1 check passed
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.

2 participants