Code: Select all
InitSprite() : InitKeyboard()
OpenScreen(800,600, 32,"test")
CreateSprite(0,800,600,0)
;Draw some stuff on sprite(0)
StartDrawing(SpriteOutput(0))
For i=0 To 50
Box (Random(800),Random(600),Random(300),Random(300),Random($ffffff))
Next
StopDrawing ()
Repeat
ExamineKeyboard ()
DisplaySprite (0,-x,0)
x+1
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
End
ok, good news, this is perfectly smooth on my pc (not a powerfull pc) :D
Now, If I use CreateSprite(0,800,600,#PB_Sprite_Memory) instead of CreateSprite(0,800,600,0) it's slower, but it's normal, because copy from vram to vram is faster than from ram to vram.
But when I try tu use asm to copy the sprite from vram to the screen, it's VERY slooooooooooooow :
Code: Select all
InitSprite() : InitKeyboard()
OpenScreen(800,600, 32,"test")
CreateSprite(0,800,600,0)
StartDrawing(SpriteOutput(0))
For i=0 To 50
Box (Random(800),Random(600),Random(300),Random(300),Random($ffffff))
Next
StopDrawing ()
Repeat
ExamineKeyboard ()
StartDrawing(SpriteOutput(0))
StopDrawing ()
*source.l = DrawingBuffer()+4*x
StartDrawing(ScreenOutput())
StopDrawing ()
*dest.l= DrawingBuffer()
MOV esi,*source
MOV edi,*dest
MOV ecx,800*600
REP MOVSD
x+1
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
End
Why this mem copy using asm is so slow ("relatively" slow) ?
"Did I do something wrong" ?
have I to "unlock" the screen, to accelerate the copy ?
(similar to the UnlockBuffer command on Blitz, for high speed pixel operations)