Linux x86_64 implementation of libglitch : https://github.com/erlehmann/libglitch.git
x86-64
nasm
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

yaglitch_ui.asm 881B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. clear_screen:
  2. ; fill screen with a color
  3. mov rdi, [visu_surf]
  4. push rdi
  5. call SDL_LockSurface
  6. %ifdef SDL1
  7. xor rcx, rcx
  8. MOV_surf_w ecx, visu_surf
  9. push rcx
  10. MOV_surf_h ecx, visu_surf
  11. MOV_surf_pixels rdi, visu_surf
  12. ;mov rax, 0xffcc22ff ; magenta
  13. ;mov rax, 0xffffffff ; white
  14. dec rcx
  15. .loop_razh:
  16. push rcx
  17. mov rcx, [rsp+8]
  18. dec rcx
  19. .loop_razw:
  20. stosd
  21. loop .loop_razw
  22. pop rcx
  23. loop .loop_razh
  24. pop rcx
  25. %endif
  26. pop rdi ; surface addr
  27. call SDL_UnlockSurface
  28. mov rdi, [visu_surf]
  29. blitflip_visu:
  30. ; blit a suface on screen and flip screen
  31. ; with rdi the src surface
  32. xor rsi, rsi
  33. mov rdx, [visu_scr]
  34. xor rcx, rcx
  35. call SDL_BlitSurface
  36. test rax, rax
  37. jnz sdl_error
  38. flip_visu:
  39. ; flip screen
  40. %ifdef SDL2
  41. mov rdi, [visu_win]
  42. call SDL_UpdateWindowSurface
  43. %endif
  44. %ifdef SDL1
  45. mov rdi, [visu_scr]
  46. call SDL_Flip
  47. %endif
  48. ret