2 ; x86 format converters for HERMES
3 ; Copyright (c) 1998 Glenn Fielder (gaffer@gaffer.org)
4 ; This source code is licensed under the GNU LGPL
6 ; Please refer to the file COPYING.LIB contained in the distribution for
9 ; Routines adjusted for Hermes by Christian Nentwich (brn@eleet.mcb.at)
10 ; Used with permission.
17 SDL_FUNC _ConvertX86p16_16BGR565
18 SDL_FUNC _ConvertX86p16_16RGB555
19 SDL_FUNC _ConvertX86p16_16BGR555
20 SDL_FUNC _ConvertX86p16_8RGB332
26 _ConvertX86p16_16BGR565:
87 .L5 mov [edi+ecx*4-4],eax
88 .L6 mov eax,[esi+ecx*4]
107 mov [edi+ecx*4-4],eax
136 _ConvertX86p16_16RGB555:
148 and ebx, 0111111111100000b
149 and eax,BYTE 0000000000011111b
168 and ebx, 0111111111100000b
169 and eax,BYTE 0000000000011111b
186 ; point arrays to end
194 .L5 mov eax,[esi+ebp*8] ; agi?
195 mov ecx,[esi+ebp*8+4]
213 mov [edi+ebp*8+4],ecx
226 and ebx, 0111111111100000b
227 and eax,BYTE 0000000000011111b
244 _ConvertX86p16_16BGR555:
261 and edx,0111110000000000b
286 and edx,0111110000000000b
301 ; point arrays to end
309 .L5 mov [edi+ecx*4-4],eax
310 .L6 mov eax,[esi+ecx*4]
331 mov [edi+ecx*4-4],eax
346 and edx,0111110000000000b
362 _ConvertX86p16_8RGB332:
374 and eax,BYTE 11000b ; blue
376 and ebx,11100000000b ; green
378 and edx,1110000000000000b ; red
397 and eax,BYTE 11000b ; blue
399 and ebx,11100000000b ; green
401 and edx,1110000000000000b ; red
434 and edx,00011000000110000001100000011000b
438 mov eax,ebx ; setup eax for reds
440 and ebx,00000111000001110000011100000111b
441 and eax,11100000111000001110000011100000b ; reds
450 mov bl,[esi+1] ; greens
453 mov dl,[esi+0] ; blues
471 and eax,BYTE 11000b ; blue
473 and ebx,11100000000b ; green
475 and edx,1110000000000000b ; red
488 %ifidn __OUTPUT_FORMAT__,elf
489 section .note.GNU-stack noalloc noexec nowrite progbits