Re: [MSX] An image moving on a background

2004-06-09 Thread Patriek Lesparre
Enrico wrote:
I've seen some MSX demos for MSX2 that show an image moving on background
without delete the background (so, a kind of sprite...).
How could it be possible? With a COPY command or some register tricks?
Some demos (like the recent Woei demo by Team Bomba) use palette tricks to 
make it seem the background stays the same.

There are basically two ways to solve this with copy commands. Objects 
copied over the background are called 'software sprites'. I will refer to 
them as simply sprites from now on.

First method:
1. rebuild background on previous sprite position (usually with HMMM 
highspeed copy)
2. copy sprite over background with LMMM command in TIMP mode (TPSET in BASIC)
repeat each frame

Second method:
1. restore previously saved background (with HMMM)
2. Use HMMM to save background in non-displayed VRAM for new sprite position.
3. copy sprite over background with LMMM.
repeat each frame
Method 1 is good when you have a background build up from tiles and many 
sprites. Method 2 is good when you have a fixed background and not many 
sprites on screen. Remember many small copies are slower than fewer large 
copies, so it might be a good idea to combine these methods.

To reduce flickering you could use page swapping (aka double buffering): 
Show page 0, draw in page 1. Then show page 1, draw in page 0. Repeat.

Greetz,
Patriek
___
MSX mailing list ([EMAIL PROTECTED])
Info page: http://lists.stack.nl/mailman/listinfo/msx


[MSX] An image moving on a background

2004-06-09 Thread Enrico
Hi,

I've seen some MSX demos for MSX2 that show an image moving on background
without delete the background (so, a kind of sprite...).

How could it be possible? With a COPY command or some register tricks?

Thank you,
Enrico

___
MSX mailing list ([EMAIL PROTECTED])
Info page: http://lists.stack.nl/mailman/listinfo/msx