00001 #ifdef USE_TASM
00002
00003 void blit_transparent_noclip_asmbpp(unsigned char *src, unsigned short *dest, unsigned int width)
00004 {
00005 asm
00006 {
00007 ALIGN 8
00008 blit_transparent_noclip_asm_16bpp:
00009 push esi ;; save used registers (5)
00010 push edi
00011 push eax
00012 push ecx
00013 push edx
00014
00015 mov esi, [esp+20+4] ;; load registers
00016 mov edi, [esp+20+8]
00017 mov edx, [esp+20+12]
00018
00019 xor ecx, ecx ;; make sure upper part of register is zero
00020 ALIGN 4
00021 .cmd_copy:
00022 mov cx, [esi] ;; read rep
00023 sub edx, ecx
00024 add esi, 2
00025
00026 shr ecx, 1
00027 rep movsd ;; copy all dwords
00028
00029 jnc .end_copy
00030 mov ax, [esi]
00031 mov [edi], ax
00032 add esi, 2
00033 add edi, 2
00034
00035 .end_copy:
00036 and edx, edx
00037 jz .rle_done
00038
00039 .cmd_skip:
00040 mov cx, [esi] ;; read rep
00041 add edi, ecx ;; do the skip
00042 add esi, 2
00043 add edi, ecx ;; (x2 because dest is word)
00044
00045 sub edx, ecx ;; width -= rep
00046 jnz .cmd_copy
00047
00048 .rle_done:
00049
00050 pop edx ;; restore used registers
00051 pop ecx
00052 pop eax
00053 pop edi
00054 pop esi
00055
00056 ret
00057 }
00058 }
00059
00060
00061 void blit_transparent_noclip_asm_32bpp(unsigned char *src, unsigned int *dest, unsigned int width)
00062 {
00063 asm
00064 {
00065 ALIGN 8
00066 blit_transparent_noclip_asm_32bpp:
00067 push esi ;; save used registers
00068 push edi
00069 push ecx
00070 push edx
00071
00072 mov esi, [esp+16+4] ;; load registers
00073 mov edi, [esp+16+8]
00074 mov edx, [esp+16+12]
00075
00076 xor ecx, ecx ;; make sure upper part of register is zero
00077
00078 .cmd_copy32:
00079 mov cx, [esi] ;; read rep
00080 add esi, 2
00081 sub edx, ecx
00082
00083 rep movsd ;; copy all dwords
00084 jz .rle_done32
00085
00086 .cmd_skip32:
00087 mov cx, [esi] ;; read rep
00088 lea edi, [edi + 4*ecx] ;; do the skip (x4 because dest is word)
00089 add esi, 2
00090
00091 sub edx, ecx ;; width -= rep
00092 jnz .cmd_copy32
00093
00094 .rle_done32:
00095
00096 pop edx ;; restore used registers
00097 pop ecx
00098 pop edi
00099 pop esi
00100
00101 ret
00102 }
00103 }
00104
00105 #endif
00106