Autor
| software sprite flickers at top of screen
|
norakomi msx professional Mensajes: 861 | Publicado: Enero 28 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 Mensajes: 596 | Publicado: Enero 28 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 Mensajes: 1592 | Publicado: Enero 28 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 Mensajes: 861 | Publicado: Enero 28 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 Mensajes: 861 | Publicado: Enero 28 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 Mensajes: 305 | Publicado: Enero 28 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 Mensajes: 861 | Publicado: Enero 29 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 Mensajes: 1592 | Publicado: Enero 29 2006, 09:30   |
@norakomi
Hi do you want I do the main loop for the scroll?
|
|
GhostwriterP msx addict Mensajes: 305 | Publicado: Enero 29 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 Mensajes: 861 | Publicado: Enero 29 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 Mensajes: 861 | Publicado: Enero 29 2006, 22:56   |
Quote:
| @norakomi
Hi do you want I do the main loop for the scroll?
|  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I'd be honored !
You're welcome |
|
|
|
|