Board index » delphi » Assembler Problems in Pascal

Assembler Problems in Pascal

I wonder if you can help me. I need some help with assembler. A sprite
routine actually. In my routine I have a register, let's say AX which
holds the current Y pixel. Now...The problem is...I need to draw some of
my sprites above the screen so only part of the sprite is on the map.
But what happens is, any thing that's meant to be off the screen (Above
it) is displayed in all funny weird positions. It's meant to clip to
size but that doesn't help :(

Hope you may be able to help me in this matter

Kevin Roberts (Spider)

NB: Please e-mail me a reply to SPI...@GEM.CO.ZA

 

Re:Assembler Problems in Pascal


Quote
Kevin Roberts wrote:

> I wonder if you can help me. I need some help with assembler. A sprite
> routine actually. In my routine I have a register, let's say AX which
> holds the current Y pixel. Now...The problem is...I need to draw some
> of my sprites above the screen so only part of the sprite is on the
> map. But what happens is, any thing that's meant to be off the screen
> (Above it) is displayed in all funny weird positions. It's meant to
> clip to size but that doesn't help :(

> Hope you may be able to help me in this matter

> Kevin Roberts (Spider)

> NB: Please e-mail me a reply to SPI...@GEM.CO.ZA

The problem is, is that your Y value is out of range.  If the Y value is
too large or too samall, it will cause a wrap around effect.  This is
the same as when your x value is too large and it just wraps around to
the left side of the screen.  However, the Y value doesn't just wrap
around to the top side of the screen when it is too big, instead, it
displays the pixels at basically random positions on the screen.  

Sounds like the routine you have is a general sprite blitting routine.
What you need is a routine that checks the x and y values to make sure
they are in range, and if not, ajust acordingly.

Hope this helps,

Greg Brland

Other Threads