source: golgotha/src/render/software/solid_blend_half_asm.cc

Last change on this file was 80, checked in by Sam Hocevar, 12 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.7 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#include "software/r1_software_globals.hh"
10
11void texture_scanline_solid_blend_half(w16 *start_pixel,
12                                       sw32 start_x,
13                                       void *left,//solid_blend_span *left,
14                                       sw32 width)
15{
16  __asm
17  {       
18    mov edi,left
19
20    mov ecx,pre_blend_and
21    mov eax,[edi]solid_blend_span.color
22   
23    mov dword ptr and_patch+2,ecx
24    mov edx,width
25
26    and eax,ecx
27    mov edi,start_pixel
28
29    shr eax,1   
30    add edi,start_x   
31   
32    mov esi,edi   
33    mov  ebx,0
34
35    test edx,1       //even # of pixels?
36    jz   start_loop  //yes, begin looped drawing
37
38    //no, draw single pixel 1st
39    mov bx,[esi]
40    add edi,2
41   
42    and ebx,pre_blend_and   
43    add esi,2
44
45    shr ebx,1   
46    add ebx,eax
47   
48    mov [edi-2],bx
49    dec edx
50
51//enter main loop
52start_loop:
53    shr edx,1
54    jz  end_sbh
55
56bogus_label:   
57    mov ebx,[esi]
58    add edi,4
59   
60and_patch:
61    and ebx,0xDDDDDDDD
62    add esi,4     
63
64    shr ebx,1
65    //nop
66
67    add ebx,eax
68    //nop
69
70    mov [edi-4],ebx
71    dec edx
72   
73    jnz bogus_label
74
75end_sbh:
76  }
77}
Note: See TracBrowser for help on using the repository browser.