software sprite flickers at top of screen (Development MSX Fora)MSX Resource Center            
            
English Nederlands Espa�ol Portugu�s Russian         
 Nieuws
   Voorpagina
  Nieuws archief
  Nieuws onderwerpen

 Informatie
   MSX Fora
  Artikelen
  Recensies
  Beursverslagen
  Fotoreportages
  Beurzen en meetings
  Enquêtes
  Links
  Zoek

 Software
   Downloads
  Webshop

 MRC
   Wie we zijn
  Kom bij ons team
  Doneren
  Policies
  Contact met het MRC
  Link naar Ons
  Statistieken

 Zoek
 
  

  

 Login
 

Gebruikersnaam

Wachtwoord




Ben je nog niet lid? Klik hier en word MSX vriend!


 Statistieken
 

Er zijn 58 gasten en 1 MSX vriend online

Je bent een anonieme bezoeker.
 

MSX Fora


MSX Fora

Development - software sprite flickers at top of screen

Schrijver

software sprite flickers at top of screen

norakomi
msx professional
Berichten: 861
Geplaatst: 28 Januari 2006, 00:39   
Hey,

has anyone ever seen this before:
-screen 5

I have the same background 3 times (page 0, page 1 & page 2)
I switch each frame between page 0 and page 1.

1) I restore the background in the inactive page (using page 2)
2) I copy an enemy (from page 3) (aprx. 34x20 TPSET) in the inactive page (page 0 or 1)
3) I switch page

I repeat this proces, and make this software sprite move using the cursor keys.
Now I increase r#23 each frame, resulting in a background scroll (A loop actually)

Now the strange thing is, that when I stay with my software sprite in the bottom of the screen (using the cursor keys) nothing weird happens, but as soon as i move in the top half of the screen my software-sprite
starts to flicker.

When I use a smaller software sprite (lets say: 20x20) this problem doesnt occur.

Anything I can do to prevent this?
Im using 50 hertz, and want to be able to update the software sprite each frame.
Edwin
msx professional
Berichten: 626
Geplaatst: 28 Januari 2006, 00:49   
Better timing.
- restore background
- wait copy to finish
- copy sprite
- wait for copy to finish
- wait for vblank
- flip page

ARTRAG
msx master
Berichten: 1737
Geplaatst: 28 Januari 2006, 08:59   
I agree, you have timing problems due to the fact that
you swap page while the copy is not finished

Actually the swap page is a the middle of the screen
using the small sprite the copy is faster so you do not see
the problem
norakomi
msx professional
Berichten: 861
Geplaatst: 28 Januari 2006, 10:18   
help me out here:

The problem I described above DOES NOT occur when, EVERY FRAME, I increase r#23 (vertical scrolling register) with a low value, like increasing r#23 with 1,2,3,4,.....

When I want to do a really fast scrolling loop, and I increase r#23 EVERY FRAME with 10,11,12,13,......
only then does this problem occur.
Quote:

you have timing problems due to the fact that
you swap page while the copy is not finished

I see, and am doing my best to resolve this matter
Quote:

Actually the swap page is a the middle of the screen
using the small sprite the copy is faster so you do not see
the problem

I changed this, now the swap page is directly at start of VBLANK
norakomi
msx professional
Berichten: 861
Geplaatst: 28 Januari 2006, 11:15   
another question:

I need to do 2 copies of the same size in 1 frame:

1 copy has cmd = $D0 (fast copy)
1 copy has cmd = $98 (slow TPSET)

how big can these copies be at max.? (can they both be 36x24?)

GhostwriterP
msx addict
Berichten: 313
Geplaatst: 28 Januari 2006, 11:57   
HMMM is 2.8 times faster than LMMM so, you did math... so do the math

Alright it would be around 1 kilobyte so sqrt(1024) -> 32x32

so they can be 36x24 = 864
norakomi
msx professional
Berichten: 861
Geplaatst: 29 Januari 2006, 09:26   
thanx,
another stupid question:

Normally vblank is called at line 212.

At which line is VBLANK called when I load the value 10 into r#23 (verticall screen offset register) ?????
ARTRAG
msx master
Berichten: 1737
Geplaatst: 29 Januari 2006, 09:30   
@norakomi

Hi do you want I do the main loop for the scroll?



GhostwriterP
msx addict
Berichten: 313
Geplaatst: 29 Januari 2006, 11:45   
Quote:

Alright it would be around 1 kilobyte so sqrt(1024) -> 32x32

so they can be 36x24 = 864



Obviously the size in screen5 would be 45x45 in dots.
And this also means you can have two of that 36x24 size pair.

vblank is set during vblank so that will be at line 212+10 then I quess.
norakomi
msx professional
Berichten: 861
Geplaatst: 29 Januari 2006, 17:22   
Quote:

vblank is set during vblank so that will be at line 212+10 then I quess.

that explained the flickering of the (software)sprite in the top of the screen !!!
Thanx, problem solved !!
norakomi
msx professional
Berichten: 861
Geplaatst: 29 Januari 2006, 22:56   
Quote:

@norakomi

Hi do you want I do the main loop for the scroll?

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I'd be honored !
You're welcome
 
 







(c) 1994 - 2008 Stichting MSX Resource Center. MSX is een trademark van MSX Licensing Corporation.