Author Topic: Sprite clipping..need some advise  (Read 238 times)

0 Members and 1 Guest are viewing this topic.

Offline IndyUK

  • CPC464
  • **
  • Posts: 8
  • Country: gb
  • Liked: 0
  • Likes Given: 1
Sprite clipping..need some advise
« on: 14:45, 01 July 19 »
Hi Folks,
I've been experimenting with displaying sprites to the screen using direct screen access. I've got this all working and would now like to implement a technique of wrapping sprites fom one side of the screen to the other, kind of like a continous scroll. I haven't put together any working code but, have been think about how this could be acheived. So that I know that I am on the right track I thought I'd check what the experts would think of my approach.
Since plotting sprites requires each scanline to be written to the screen memory and then dropping to the next line (like a carriage return) until the entire sprite is plotted. Would I be correct in thinking that if I first check to see if the current scanline is within the screen area then plot it otherwise ignore/skip it? Is this effectively "clipping"?

Thanks

Offline SpDizzy

  • CPC464
  • **
  • Posts: 30
  • Country: es
  • Liked: 9
  • Likes Given: 18
Re: Sprite clipping..need some advise
« Reply #1 on: 14:00, 03 July 19 »
Yes, that is true from a basic approach.
Please, consider this thread from user @Arnaud as reference:
http://www.cpcwiki.eu/forum/programming/sprite-clipping-help-for-optimize-asm/
It's #CpcTelera related, but you can find assembly code on  src/asm folder from attached, both for masked and unmasked sprites who need clipping.
« Last Edit: 17:06, 03 July 19 by SpDizzy »