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.

sdl.asm 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. EXTERN SDL_Init
  2. Extern SDL_Quit
  3. Extern SDL_Delay
  4. Extern SDL_OpenAudio
  5. Extern SDL_PauseAudio
  6. Extern SDL_WaitEvent
  7. Extern SDL_GetError
  8. Extern SDL_CreateRGBSurface
  9. Extern SDL_LockSurface
  10. Extern SDL_UnlockSurface
  11. Extern SDL_UpperBlit
  12. %define SDL_BlitSurface SDL_UpperBlit
  13. Extern TTF_OpenFont
  14. Extern TTF_RenderText_Solid
  15. Extern TTF_Init
  16. %ifdef SDL1
  17. %define SDL_QUIT 0x0C
  18. %define SDL_DOUBLEBUF 0x40000000
  19. %define SDL_HWSURFACE 0x1
  20. Extern SDL_GetVideoSurface
  21. Extern SDL_SetVideoMode
  22. Extern SDL_Flip
  23. %endif
  24. %ifdef SDL2
  25. ; events
  26. %define SDL_QUIT 0x100
  27. %define SDL_AUDIODEVICEADDED 0x1100
  28. ; values
  29. %define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000
  30. %define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_MASK | 0 ; display 0
  31. ; function
  32. Extern SDL_CreateWindow
  33. extern SDL_GetWindowSurface
  34. extern SDL_memset
  35. extern SDL_UpdateWindowSurface
  36. %endif
  37. %ifdef MIX_AUDIO
  38. Extern SDL_MixAudio
  39. %define SDL_MAX_VOLUME 128
  40. %endif
  41. %define SDL_SWSURFACE 0
  42. %define AUDIO_U8 0x0008 ; Unsigned 8-bit samples
  43. %define AUDIO_S8 0x8008 ; Signed 8-bit samples
  44. %define AUDIO_U16LSB 0x0010 ; Unsigned 16-bit samples
  45. %define AUDIO_S16LSB 0x8010 ; Signed 16-bit samples
  46. %define AUDIO_U16MSB 0x1010 ; As above, but big-endian byte order
  47. %define AUDIO_S16MSB 0x9010 ; As above, but big-endian byte order
  48. %define AUDIO_U16 AUDIO_U16LSB
  49. %define AUDIO_S16 AUDIO_S16LSB
  50. STRUC SDL_AudioSpec_STRUC
  51. .freq: resw 1
  52. .format: resw 1
  53. .channels: resb 1
  54. .silence: resb 1
  55. .samples: resw 1
  56. .size: resw 1
  57. .callback: resq 1
  58. .userdata: resq 1
  59. ENDSTRUC
  60. %macro def_SDL_AudioSpec 1
  61. %define %1.freq %1+SDL_AudioSpec_STRUC.freq
  62. %define %1.format %1+SDL_AudioSpec_STRUC.format
  63. %define %1.channels %1+SDL_AudioSpec_STRUC.channels
  64. %define %1.silence %1+SDL_AudioSpec_STRUC.silence
  65. %define %1.samples %1+SDL_AudioSpec_STRUC.samples
  66. %define %1.size %1+SDL_AudioSpec_STRUC.size
  67. %define %1.callback %1+SDL_AudioSpec_STRUC.callback
  68. %define %1.userdata %1+SDL_AudioSpec_STRUC.userdata
  69. %1:
  70. ISTRUC SDL_AudioSpec_STRUC
  71. %endmacro
  72. %macro MOV_surf_w 2
  73. mov %1, [%2]
  74. mov %1, [%1 + 16]
  75. %endmacro
  76. %macro MOV_surf_h 2
  77. mov %1, [%2]
  78. mov %1, [%1 + 20]
  79. %endmacro
  80. %macro MOV_surf_pitch 2
  81. mov %1, [%2]
  82. mov %1, [%1 + 24]
  83. %endmacro
  84. %macro MOV_surf_pixels 2
  85. mov %1, [%2]
  86. mov %1, [%1 + 32]
  87. %endmacro
  88. ;fontconfig
  89. Extern FcInitLoadConfigAndFonts
  90. Extern FcPatternCreate
  91. Extern FcObjectSetBuild
  92. Extern FcFontList
  93. Extern FcPatternGetString
  94. Extern FcPatternPrint