CPCWiki forum

General Category => Programming => Topic started by: IndyUK on 12:45, 01 July 19

Title: Sprite clipping..need some advise
Post by: IndyUK on 12: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
Title: Re: Sprite clipping..need some advise
Post by: SpDizzy on 12:00, 03 July 19
Yes, that is true from a basic approach.
Please, consider this thread from user @Arnaud (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1424) as reference:
http://www.cpcwiki.eu/forum/programming/sprite-clipping-help-for-optimize-asm/ (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.
Powered by SMFPacks Menu Editor Mod