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 795B

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