Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mirror a sprite
#2
What was the problem Oblo?

Read: <!-- l --><a class="postlink-local" href="http://www.boriel.com/forum/how-to-tutorials/tutorial-how-to-put-inline-assembly-functions-into-zx-basic-t729.html?hilit=mirror">how-to-tutorials/tutorial-how-to-put-inline-assembly-functions-into-zx-basic-t729.html?hilit=mirror</a><!-- l -->

This is the discussion where that came about. The fastest mirror solution is the one at the bottom of the page you linked to - faster and shorter by far than any other solution I've seen, though the maths are a bit brain aching if you try to understand how it does it.

If you want to vertically mirror, it's a matter of swapping the byte order - so instead of first byte to last, you read it last byte to first. Easier if you just peek then poke to your sprite buffer in forward or reverse order when switching the up/down direction.

Left to right you read the bytes into your live sprite buffer poke sprite1, peek (data1) Right to left, you do poke sprite1, hmirror(peek data1)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)