Skip to content

mx4sio: read and write buffers that are not word aligned - #4

Merged
techwritescode merged 1 commit into
ps2build:mainfrom
NathanNeurotic:mx4sio-unaligned-buffers
Nov 11, 2026
Merged

techwritescode merged 1 commit into
ps2build:mainfrom
NathanNeurotic:mx4sio-unaligned-buffers

Conversation

@NathanNeurotic

Copy link
Copy Markdown
Member

FatFs passes the caller's buffer to the block device, at any offset: a read from an odd position in a file gives an odd address. The SIO2 DMA and reverse_buffer work on words, so such a buffer ended in an address error exception on the IOP, repeated forever.

Take those a sector at a time through an aligned buffer. Aligned buffers are transferred as before.

Port of ps2dev/ps2sdk 3e59cc20 by Rick Gaiser (ps2dev/ps2sdk PR 959).

AI usage disclosure:
This PR yes - code changes unknown

FatFs passes the caller's buffer to the block device, at any offset: a
read from an odd position in a file gives an odd address. The SIO2 DMA and
reverse_buffer work on words, so such a buffer ended in an address error
exception on the IOP, repeated forever.

Take those a sector at a time through an aligned buffer. Aligned buffers
are transferred as before.

Port of ps2dev/ps2sdk 3e59cc20 by Rick Gaiser (ps2dev/ps2sdk PR 959).
@techwritescode
techwritescode merged commit d22ec71 into ps2build:main Nov 11, 2026
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