Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 0 additions & 176 deletions code/blitblit.h
Original file line number Diff line number Diff line change
Expand Up @@ -2308,179 +2308,3 @@ class BlitTranslucentWriteAlpha : public Blitter {
T const * TranslateTable;
};


/*
** Assembly versions of some of the templated blitter object functions. Borland and
** Visual C++ support a compatible inline-assembly formats. However, Borland compiler
** does not allow inline-assembly to be part of an inline function -- go figure.
** It will still compile, it just generates warning messages.
*/
#if defined(_MSC_VER)

#pragma optimize("", off)

template <>
inline void BlitTrans<unsigned char>::BlitForward(void * dest, void const * source, int len, int z_min, void *z_buff, void *a_buff, int alpha_level, int warp_offset) const
{
__asm {
mov esi,[source]
mov edi,[dest]
mov ecx,[len]
dec edi
inc ecx

again:
dec ecx
jz fini
mov al,[esi]
inc edi
inc esi
test al,al
jz again
mov [edi],al
jmp again

fini:
}
}


template <>
inline void BlitTransXlat<unsigned short>::BlitForward(void * dest, void const * source, int len, int z_min, void *z_buff, void *a_buff, int alpha_level, int warp_offset) const
{
unsigned short const * xlator = TranslateTable;

__asm {
mov ebx,[xlator]
mov ecx,[len]
inc ecx
mov edi,[dest]
sub edi,2
mov esi,[source]
xor eax,eax

again:
dec ecx
jz over
add edi,2
mov al,[esi]
inc esi
or al,al
jz again
mov dx,[ebx+eax*2]
mov [edi],dx
jmp again

over:
}
}


template <>
inline void BlitTransRemapXlat<unsigned short>::BlitForward(void * dest, void const * source, int len, int z_min, void *z_buff, void *a_buff, int alpha_level, int warp_offset) const
{
unsigned short const * translator = TranslateTable;
unsigned char const * remapper = RemapTable;

__asm {
mov ecx,[len]
mov edi,[dest]
sub edi,2
mov esi,[source]
mov ebx,[remapper]
mov edx,[translator]
xor eax,eax

again:
/*
** This block is 11 cycles per pixel, if not transparent, and 5
** cycles per pixel, if transparent.
*/
dec ecx
jz over
add edi,2
xor eax,eax
lodsb
or al,al
jz again
mov al,[ebx+eax] // First remap step (8 bit to 8 bit).
mov ax,[edx+eax*2] // Second remap step (8 bit to 16 bit).
mov [edi],ax
jmp again

over:
}
}


#if 0
template <>
inline void BlitTransZRemapXlat<unsigned short>::BlitForward(void * dest, void const * source, int len, int z_min, void *z_buff, void *a_buff, int alpha_level, int warp_offset) const
{
unsigned short const * translator = TranslateTable;
unsigned char const * remapper = *RemapTable;

__asm {
mov ecx,[len]
mov edi,[dest]
sub edi,2
mov esi,[source]
mov ebx,[remapper]
mov edx,[translator]
xor eax,eax
}

/*
** This block is 11 cycles per pixel, if not transparent, and 5
** cycles per pixel, if transparent.
*/
again:
__asm {
dec ecx
jz over
add edi,2
xor eax,eax
lodsb
or al,al
jz again
mov al,[ebx+eax] // First remap step (8 bit to 8 bit).
mov ax,[edx+eax*2] // Second remap step (8 bit to 16 bit).
mov [edi],ax
jmp again
}
over:;
}


template <>
inline void BlitPlainXlat<unsigned short>::BlitForward(void * dest, void const * source, int len, int z_min, void *z_buff, void *a_buff, int alpha_level, int warp_offset) const
{
unsigned short const * remapper = TranslateTable;
__asm {
mov ebx,[remapper]
mov ecx,[len]
mov esi,[source]
mov edi,[dest]
sub edi,2
}
again:
/*
** This block processes pixels at 7 clocks per pixel.
*/
__asm {
xor eax,eax
add edi,2
mov al,[esi]
inc esi
mov ax,[ebx+eax*2]
mov [edi],ax
dec ecx
jnz again
}
}


#endif
#endif

#pragma optimize("", on)
Loading
Loading