I've created a two-cart application that uses two carts, and has two options:
- Use cstore to store data from the main cart into the 2nd cart, then finish the program
- Use reload to load data from the 2nd cart to the main cart
When I bundle both carts using a binary export, the cstore function creates a file named the same as the filename I passed to the cstore function. E.g. I use "cstore(0,0,4,"exporttest_data.p8")" and in AppData\Roaming\pico-8\cstore a file named that shows up, and it has the correct data in it. But when I restart the program and reload from the cart, it only shows the data of the cart as it was when it was bundled into a binary export.
When I don't bundle the 2nd cart, a file called "__(null).p8" appears in the cstore folder, with the correct data, although the program still doesn't appear to be able to read it.
Since there is a cstore folder and p8 carts are being created there I assume cstore is supposed to work in binary exports, but I'm pretty sure given the malformed "__(null).p8" file that there's a bug with it. I've added the main cartridge for testing.
And here's the code:
cls() done=false while not done do if btn(4) then poke(0,8) poke(1,7) poke(2,6) poke(3,5) cstore(0,0,4,"exporttest_data.p8") done=true elseif btn(5) then poke(0,0) poke(0,0) poke(0,0) poke(0,0) reload(0,0,4,"exporttest_data.p8") print(peek(0)) print(peek(1)) print(peek(2)) print(peek(3)) done=true while btn() == 0 do flip() end end flip() end
Oh oops, thanks for the quick reply @zep!
While I have you here and this bug is preventing me from testing the proper functionality, since cstore looks like it uses the cstore AppData folder, does that mean that binary Pico 8 apps can share data via cstore+reload to the same filename?
[Please log in to post a comment]