Log In  

This s a nifty, but small code snippit I made. Basically it takes the persistent cart data and forces it into your work-ram (starting from the range you specify in the sms_ram_start variable), so 256 values of your work ram will be used, but this is nice. You can save the specified ram storage to persistent data with the other function.

★smsave() - saves memory to cart persistent data
★smload() - loads persistent data into work ram

--smart save manager

--save work-ram to pers
--and load pers to 
--work ram

function ★smsave()
    for i=0,255 do
            local _rs=★sms_ram_start+i
            if _rs>0x5dff then break end
            poke(0x5e00+i, peek(_rs))

function ★smload()
    for i=0,255 do
     local _rs=★sms_ram_start+i
     poke(_rs, peek(0x5e00+i))

Why would you need this? idk, but I was bored and this was fun to make for what ever reason.

P#62919 2019-03-20 21:16 ( Edited 2019-03-20 21:16)

does this work in carts?

P#63505 2019-04-14 17:05

yes, all it really does is save/load persistent cart data in bulk

P#63506 2019-04-14 17:30

[Please log in to post a comment]

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-07-24 07:17 | 0.011s | 2097k | Q:13