Hi guys, I'm working on a tabletop style game and using mset to make tile variations for each different levels (like how you place doors and rocks in games like heroquest). What I would like to do is to be able to reload the map data from the cartridge rom (ideally without iterating through the map and undoing my mset changes).
I've tried to make a very small example below. I am setting the top left orange square through an mset call in _init. I would like to be able to call something that re-reads the map data from the cartridge rom so I can undo in-memory mset changes.
Hope someone can help :)


I managed to solve by creating a duplicate of the board in the map data, and copying it back over to the data I'm using
for col=1, map_w do for row=1, map_h do mset(col, row, mget(col + map_w, row)) end end |
It isn't ideal, I am trying to conserve tokens at this stage of the project. So I'm definitely open to a better suggestion :)



I think what you want is reload() ...?
reload dest_addr source_addr len [filename] Same as memcpy, but copies from cart rom |
And for reloading the map data, would probably be
reload(0x2000, 0x2000, 0x1000) |
[Please log in to post a comment]