News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Sprite clipping..need some advise

Started by IndyUK, 12:45, 01 July 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IndyUK

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

SpDizzy

#1
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.

Powered by SMFPacks Menu Editor Mod