Re: [MSX] An image moving on a background
Enrico wrote: So, more or less, a thing like this: http://nrgo.altervista.org/sprcopy.zip something like that, yeah... I see the sprite often disappearing, to minimize this effect you could try to put the 'restore background' and 'copy sprite' steps closer together. Another thing is to put these copy commands very early in the interrupt routine. The interrupt routine is executed at the moment the VDP stops drawing the screen, so there is a period (called the Vertical Blanking period) where changes to the display will not be seen happening on the screen. Another question: color number 0 on "sprite-image" allow to show background pixels or covers the background with black color? color 0 is not copied by LMMM command with TIMP logical operation. The R#46 command code for this is &H98. HMMM (command code &HC0) always copies color 0 as black. Also be aware that in SCREEN 8 there is very little speed difference between HMMM and LMMM commands. And, if you're not going to use hardware sprites at all, disabling them by setting bit 1 of R#8 will speed up the VDP copy commands. Greetz, Patriek ___ MSX mailing list ([EMAIL PROTECTED]) Info page: http://lists.stack.nl/mailman/listinfo/msx
Re: [MSX] An image moving on a background
Thank you Patriek! > Second method: > 1. restore previously saved background (with HMMM) So, more or less, a thing like this: http://nrgo.altervista.org/sprcopy.zip Another question: color number 0 on "sprite-image" allow to show background pixels or covers the background with black color? ___ MSX mailing list ([EMAIL PROTECTED]) Info page: http://lists.stack.nl/mailman/listinfo/msx
Re: [MSX] An image moving on a background
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
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