pancelor / p8x8

convert PICO-8 carts into picotron carts (some assembly required)
Other
20 stars 0 forks source link

expose original cart ROM as userdata, for PX9 etc #13

Open pancelor opened 3 months ago

pancelor commented 3 months ago

would be nice to have a userdata of the cart ROM available, in case its PX9 or similar.

note on PX9 - need to change >>> to >> and the "clip out the bits we want" part should be local val=cache<<64-bits>>48-bits (half-tested)

pancelor commented 3 months ago

can instead tell cart authors to run this code inside pico8:

local res='userdata("u8",0x4300,"'
for adr=0,0x42ff do
  res..=sub(tostr(@adr,1),5,6)
end
printh(res..'")', '@clip')
stop"copied"

You can paste the result into picotron p8x8_rom = p64env.userdata("u8",... and then access it with p8x8_rom:get(index) or p8x8_rom[index]