Code updated for 5.20+
I played from this idea and obtained this (obtain 25 Mpixels/s, FPS 32, in 1024x768 on my PC) :
Code: Select all
; broken TV
ScreenXSize = GetSystemMetrics_(#SM_CXSCREEN)
ScreenYSize = GetSystemMetrics_(#SM_CYSCREEN)
If InitSprite() And InitKeyboard() And OpenScreen(ScreenXSize, ScreenYSize, 32, "")
Repeat
FlipBuffers()
StartDrawing(ScreenOutput())
Address = DrawingBuffer()
! MOV esi, [v_Address] ; esi = Address. esi is the start address
! MOV edi, [v_ScreenXSize] ; edi = (ScreenXSize * ScreenYSize - ScreenXSize - ScreenYSize) * 4 + 4 + Address which is equivalent to
! IMUL edi, [v_ScreenYSize] ; edi = (ScreenXSize - 1) * (ScreenYSize - 1) * 4 + Address
! SUB edi, [v_ScreenXSize] ; edi is the last address of the drawing buffer
! SUB edi, [v_ScreenYSize] ;
! SAL edi, 2 ;
! ADD edi, 4 ;
! ADD edi, esi ;
! _While_Main: ; While loop
c = Random(255) ; c = Random(255)
! MOV ebx, dword [v_c] ; ebx = c
! MOV ecx, ebx ; ecx = ebx
! SAL ecx, 8 ; ecx << 8
! ADD ecx, ebx ; ecx + ebx
! SAL ecx, 8 ; ecx << 8
! ADD ecx, ebx ; ecx + ebx, which finally corresponds to ecx = ebx << 16 + ebx << 8 + ebx or RGB(ebx, ebx, ebx) meaning RGB(c, c, c)
! CMP esi, edi ; if esi > edi
! JG _Wend_Main ; Break
! MOV [esi], ecx ; PokeL(esi, ecx)
! INC dword [v_NPoints] ; NPoints + 1
! ADD esi, 4 ; esi + 4 meaning Address + 4
! JMP _While_Main ; Wend
! _Wend_Main:
BackColor(RGB(0, 0, 0))
FrontColor(RGB(255, 255, 255))
DrawText(10, 10, Str(FPS))
DrawText(10, 30, Str(Points))
StopDrawing()
If ElapsedMilliseconds() - tz => 1000
FPS = NFrames
tz = ElapsedMilliseconds()
NFrames = 0
Points = NPoints
NPoints = 0
EndIf
NFrames + 1
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
CloseScreen()
EndIf
End
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.