Error accessing buffer on Playdate, but not in the Simulator

I usually structure gameplay data as tab-delimited text files, and I'm experiencing an issue on the hardware when attempting to read these .txt files. It works fine in the playdate Simulator, but when I upload it to device and run it there, I get "Error accessing buffer at 0x20033280". This address is consistent across different projects. I'm attaching a zip file containing a main.lua and a sample text file so that it can be reproduced.

buffer (1.9 KB)

Also seems like just packaging the .txt file into the .pdx will cause the playdate to crash when the pdx is run, but does not cause problems for the simulator.

What line ending type are you using in your file?

1 Like

Looks like you've got CR line endings rather than LF or CRLF. Here's a fixed copy of the file: (951 Bytes)


Thank you so much!

I have tried now with the text file using the correct line endings (LF, not CR), unfortunately I am still having issues on the device. However, I have some clues now about where to continue investigating - and thank you for the reference to the related thread! With this, plus the sample projects, I should be able to figure out how to successfully package and load a text file.

  • Andreas
1 Like