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.
16
GLOBAL _ConvertX86p16_32RGB888
17
GLOBAL _ConvertX86p16_32BGR888
18
GLOBAL _ConvertX86p16_32RGBA888
19
GLOBAL _ConvertX86p16_32BGRA888
20
GLOBAL _ConvertX86p16_24RGB888
21
GLOBAL _ConvertX86p16_24BGR888
22
GLOBAL _ConvertX86p16_16BGR565
23
GLOBAL _ConvertX86p16_16RGB555
24
GLOBAL _ConvertX86p16_16BGR555
25
GLOBAL _ConvertX86p16_8RGB332
35
_ConvertX86p16_16BGR565:
96
.L5 mov [edi+ecx*4-4],eax
97
.L6 mov eax,[esi+ecx*4]
116
mov [edi+ecx*4-4],eax
145
_ConvertX86p16_16RGB555:
157
and ebx, 0111111111100000b
158
and eax,BYTE 0000000000011111b
177
and ebx, 0111111111100000b
178
and eax,BYTE 0000000000011111b
195
; point arrays to end
203
.L5 mov eax,[esi+ebp*8] ; agi?
204
mov ecx,[esi+ebp*8+4]
222
mov [edi+ebp*8+4],ecx
235
and ebx, 0111111111100000b
236
and eax,BYTE 0000000000011111b
253
_ConvertX86p16_16BGR555:
270
and edx,0111110000000000b
295
and edx,0111110000000000b
310
; point arrays to end
318
.L5 mov [edi+ecx*4-4],eax
319
.L6 mov eax,[esi+ecx*4]
340
mov [edi+ecx*4-4],eax
355
and edx,0111110000000000b
371
_ConvertX86p16_8RGB332:
383
and eax,BYTE 11000b ; blue
385
and ebx,11100000000b ; green
387
and edx,1110000000000000b ; red
406
and eax,BYTE 11000b ; blue
408
and ebx,11100000000b ; green
410
and edx,1110000000000000b ; red
443
and edx,00011000000110000001100000011000b
447
mov eax,ebx ; setup eax for reds
449
and ebx,00000111000001110000011100000111b
450
and eax,11100000111000001110000011100000b ; reds
459
mov bl,[esi+1] ; greens
462
mov dl,[esi+0] ; blues
480
and eax,BYTE 11000b ; blue
482
and ebx,11100000000b ; green
484
and edx,1110000000000000b ; red