clear_screen: ; fill screen with a color mov rdi, [visu_surf] push rdi call SDL_LockSurface %ifdef SDL1 xor rcx, rcx MOV_surf_w ecx, visu_surf push rcx MOV_surf_h ecx, visu_surf MOV_surf_pixels rdi, visu_surf ;mov rax, 0xffcc22ff ; magenta ;mov rax, 0xffffffff ; white dec rcx .loop_razh: push rcx mov rcx, [rsp+8] dec rcx .loop_razw: stosd loop .loop_razw pop rcx loop .loop_razh pop rcx %endif pop rdi ; surface addr call SDL_UnlockSurface mov rdi, [visu_surf] blitflip_visu: ; blit a suface on screen and flip screen ; with rdi the src surface xor rsi, rsi mov rdx, [visu_scr] xor rcx, rcx call SDL_BlitSurface test rax, rax jnz sdl_error flip_visu: ; flip screen %ifdef SDL2 mov rdi, [visu_win] call SDL_UpdateWindowSurface %endif %ifdef SDL1 mov rdi, [visu_scr] call SDL_Flip %endif ret