Log In  


When procedurally generating a map, how can I manipulate a tile's data to flip it as the picotron manual would suggest?



The following code seems to allow you to flip and place a map chip:

poke2({map address}, {flip flag} | {sprite number})

Specifically, it looks like this:

function _init()
  local sp_no = 1
  poke2(0x100000, sp_no)
  poke2(0x100002, 0x2000 | 0x4000 | sp_no)
  poke2(0x100004, 0x4000 | 0x8000 | sp_no)
  poke2(0x100006, 0x2000 | 0x8000 | sp_no)
end

function _draw()
  cls()
  map(0, 0)
end

You should now be able to display map tips that rotate in 90 degree increments.


Thank you!



[Please log in to post a comment]