| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #include "asm_i386.h" |
| #include "quakeasm.h" |
| #include "d_ifacea.h" |
| #include "asm_draw.h" |
|
|
| #if id386 |
|
|
| |
| |
| |
|
|
| |
|
|
| |
| |
| |
|
|
| .text |
|
|
| #define P 12+4 |
|
|
| .align 4 |
| .globl C(D_DrawParticle) |
| C(D_DrawParticle): |
| pushl %ebp |
| pushl %edi |
| pushl %ebx |
|
|
| movl P(%esp),%edi |
|
|
| |
|
|
| |
| |
| flds C(r_origin) |
| fsubrs pt_org(%edi) |
| flds pt_org+4(%edi) |
| fsubs C(r_origin)+4 |
| flds pt_org+8(%edi) |
| fsubs C(r_origin)+8 |
| fxch %st(2) |
|
|
| |
| flds C(r_ppn) |
| fmul %st(1),%st(0) |
| flds C(r_ppn)+4 |
| fmul %st(3),%st(0) |
| flds C(r_ppn)+8 |
| |
| fmul %st(5),%st(0) |
| fxch %st(2) |
| faddp %st(0),%st(1) |
| |
| faddp %st(0),%st(1) |
| fld %st(0) |
| |
| fdivrs float_1 |
| fxch %st(1) |
|
|
| |
| |
| fcomps float_particle_z_clip |
| fxch %st(3) |
|
|
| flds C(r_pup) |
| fmul %st(2),%st(0) |
| flds C(r_pup)+4 |
| |
|
|
| fnstsw %ax |
| testb $1,%ah |
| jnz LPop6AndDone |
|
|
| |
| fmul %st(4),%st(0) |
| flds C(r_pup)+8 |
| |
| fmul %st(3),%st(0) |
| |
| fxch %st(2) |
| |
| faddp %st(0),%st(1) |
| |
| faddp %st(0),%st(1) |
| fxch %st(3) |
|
|
| |
| fmuls C(r_pright)+4 |
| fxch %st(2) |
| fmuls C(r_pright) |
| fxch %st(1) |
| fmuls C(r_pright)+8 |
| fxch %st(2) |
| faddp %st(0),%st(1) |
|
|
| faddp %st(0),%st(1) |
| fxch %st(1) |
|
|
| |
| fmul %st(2),%st(0) |
| fxch %st(1) |
| fmul %st(2),%st(0) |
| fxch %st(1) |
| fsubrs C(ycenter) |
| fxch %st(1) |
| fadds C(xcenter) |
| |
| fxch %st(1) |
| fadds float_point5 |
| fxch %st(1) |
| fadds float_point5 |
| fxch %st(2) |
| fmuls DP_32768 |
| fxch %st(2) |
|
|
| |
| |
| fistpl DP_u |
| fistpl DP_v |
|
|
| movl DP_u,%eax |
| movl DP_v,%edx |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| movl C(d_vrectbottom_particle),%ebx |
| movl C(d_vrectright_particle),%ecx |
| cmpl %ebx,%edx |
| jg LPop1AndDone |
| cmpl %ecx,%eax |
| jg LPop1AndDone |
| movl C(d_vrecty),%ebx |
| movl C(d_vrectx),%ecx |
| cmpl %ebx,%edx |
| jl LPop1AndDone |
|
|
| cmpl %ecx,%eax |
| jl LPop1AndDone |
|
|
| flds pt_color(%edi) |
| |
| fistpl DP_Color |
|
|
| movl C(d_viewbuffer),%ebx |
|
|
| addl %eax,%ebx |
| movl C(d_scantable)(,%edx,4),%edi |
|
|
| imull C(d_zrowbytes),%edx |
|
|
| leal (%edx,%eax,2),%edx |
| movl C(d_pzbuffer),%eax |
|
|
| fistpl izi |
|
|
| addl %ebx,%edi |
| addl %eax,%edx |
|
|
| |
|
|
| movl izi,%eax |
| movl C(d_pix_shift),%ecx |
| shrl %cl,%eax |
| movl izi,%ebp |
|
|
| |
| |
| |
| |
|
|
| movl C(d_pix_min),%ebx |
| movl C(d_pix_max),%ecx |
| cmpl %ebx,%eax |
| jnl LTestPixMax |
| movl %ebx,%eax |
| jmp LTestDone |
|
|
| LTestPixMax: |
| cmpl %ecx,%eax |
| jng LTestDone |
| movl %ecx,%eax |
| LTestDone: |
|
|
| movb DP_Color,%ch |
|
|
| movl C(d_y_aspect_shift),%ebx |
| testl %ebx,%ebx |
| jnz LDefault |
|
|
| cmpl $4,%eax |
| ja LDefault |
|
|
| jmp DP_EntryTable-4(,%eax,4) |
|
|
| |
| .globl DP_1x1 |
| DP_1x1: |
| cmpw %bp,(%edx) |
| jg LDone |
| movw %bp,(%edx) |
| movb %ch,(%edi) |
| jmp LDone |
|
|
| |
| .globl DP_2x2 |
| DP_2x2: |
| pushl %esi |
| movl C(screenwidth),%ebx |
| movl C(d_zrowbytes),%esi |
|
|
| cmpw %bp,(%edx) |
| jg L2x2_1 |
| movw %bp,(%edx) |
| movb %ch,(%edi) |
| L2x2_1: |
| cmpw %bp,2(%edx) |
| jg L2x2_2 |
| movw %bp,2(%edx) |
| movb %ch,1(%edi) |
| L2x2_2: |
| cmpw %bp,(%edx,%esi,1) |
| jg L2x2_3 |
| movw %bp,(%edx,%esi,1) |
| movb %ch,(%edi,%ebx,1) |
| L2x2_3: |
| cmpw %bp,2(%edx,%esi,1) |
| jg L2x2_4 |
| movw %bp,2(%edx,%esi,1) |
| movb %ch,1(%edi,%ebx,1) |
| L2x2_4: |
|
|
| popl %esi |
| jmp LDone |
|
|
| |
| .globl DP_3x3 |
| DP_3x3: |
| pushl %esi |
| movl C(screenwidth),%ebx |
| movl C(d_zrowbytes),%esi |
|
|
| cmpw %bp,(%edx) |
| jg L3x3_1 |
| movw %bp,(%edx) |
| movb %ch,(%edi) |
| L3x3_1: |
| cmpw %bp,2(%edx) |
| jg L3x3_2 |
| movw %bp,2(%edx) |
| movb %ch,1(%edi) |
| L3x3_2: |
| cmpw %bp,4(%edx) |
| jg L3x3_3 |
| movw %bp,4(%edx) |
| movb %ch,2(%edi) |
| L3x3_3: |
|
|
| cmpw %bp,(%edx,%esi,1) |
| jg L3x3_4 |
| movw %bp,(%edx,%esi,1) |
| movb %ch,(%edi,%ebx,1) |
| L3x3_4: |
| cmpw %bp,2(%edx,%esi,1) |
| jg L3x3_5 |
| movw %bp,2(%edx,%esi,1) |
| movb %ch,1(%edi,%ebx,1) |
| L3x3_5: |
| cmpw %bp,4(%edx,%esi,1) |
| jg L3x3_6 |
| movw %bp,4(%edx,%esi,1) |
| movb %ch,2(%edi,%ebx,1) |
| L3x3_6: |
|
|
| cmpw %bp,(%edx,%esi,2) |
| jg L3x3_7 |
| movw %bp,(%edx,%esi,2) |
| movb %ch,(%edi,%ebx,2) |
| L3x3_7: |
| cmpw %bp,2(%edx,%esi,2) |
| jg L3x3_8 |
| movw %bp,2(%edx,%esi,2) |
| movb %ch,1(%edi,%ebx,2) |
| L3x3_8: |
| cmpw %bp,4(%edx,%esi,2) |
| jg L3x3_9 |
| movw %bp,4(%edx,%esi,2) |
| movb %ch,2(%edi,%ebx,2) |
| L3x3_9: |
|
|
| popl %esi |
| jmp LDone |
|
|
|
|
| |
| .globl DP_4x4 |
| DP_4x4: |
| pushl %esi |
| movl C(screenwidth),%ebx |
| movl C(d_zrowbytes),%esi |
|
|
| cmpw %bp,(%edx) |
| jg L4x4_1 |
| movw %bp,(%edx) |
| movb %ch,(%edi) |
| L4x4_1: |
| cmpw %bp,2(%edx) |
| jg L4x4_2 |
| movw %bp,2(%edx) |
| movb %ch,1(%edi) |
| L4x4_2: |
| cmpw %bp,4(%edx) |
| jg L4x4_3 |
| movw %bp,4(%edx) |
| movb %ch,2(%edi) |
| L4x4_3: |
| cmpw %bp,6(%edx) |
| jg L4x4_4 |
| movw %bp,6(%edx) |
| movb %ch,3(%edi) |
| L4x4_4: |
|
|
| cmpw %bp,(%edx,%esi,1) |
| jg L4x4_5 |
| movw %bp,(%edx,%esi,1) |
| movb %ch,(%edi,%ebx,1) |
| L4x4_5: |
| cmpw %bp,2(%edx,%esi,1) |
| jg L4x4_6 |
| movw %bp,2(%edx,%esi,1) |
| movb %ch,1(%edi,%ebx,1) |
| L4x4_6: |
| cmpw %bp,4(%edx,%esi,1) |
| jg L4x4_7 |
| movw %bp,4(%edx,%esi,1) |
| movb %ch,2(%edi,%ebx,1) |
| L4x4_7: |
| cmpw %bp,6(%edx,%esi,1) |
| jg L4x4_8 |
| movw %bp,6(%edx,%esi,1) |
| movb %ch,3(%edi,%ebx,1) |
| L4x4_8: |
|
|
| leal (%edx,%esi,2),%edx |
| leal (%edi,%ebx,2),%edi |
|
|
| cmpw %bp,(%edx) |
| jg L4x4_9 |
| movw %bp,(%edx) |
| movb %ch,(%edi) |
| L4x4_9: |
| cmpw %bp,2(%edx) |
| jg L4x4_10 |
| movw %bp,2(%edx) |
| movb %ch,1(%edi) |
| L4x4_10: |
| cmpw %bp,4(%edx) |
| jg L4x4_11 |
| movw %bp,4(%edx) |
| movb %ch,2(%edi) |
| L4x4_11: |
| cmpw %bp,6(%edx) |
| jg L4x4_12 |
| movw %bp,6(%edx) |
| movb %ch,3(%edi) |
| L4x4_12: |
|
|
| cmpw %bp,(%edx,%esi,1) |
| jg L4x4_13 |
| movw %bp,(%edx,%esi,1) |
| movb %ch,(%edi,%ebx,1) |
| L4x4_13: |
| cmpw %bp,2(%edx,%esi,1) |
| jg L4x4_14 |
| movw %bp,2(%edx,%esi,1) |
| movb %ch,1(%edi,%ebx,1) |
| L4x4_14: |
| cmpw %bp,4(%edx,%esi,1) |
| jg L4x4_15 |
| movw %bp,4(%edx,%esi,1) |
| movb %ch,2(%edi,%ebx,1) |
| L4x4_15: |
| cmpw %bp,6(%edx,%esi,1) |
| jg L4x4_16 |
| movw %bp,6(%edx,%esi,1) |
| movb %ch,3(%edi,%ebx,1) |
| L4x4_16: |
|
|
| popl %esi |
| jmp LDone |
|
|
| |
| LDefault: |
|
|
| |
|
|
| movl %eax,%ebx |
| movl %eax,DP_Pix |
| movb C(d_y_aspect_shift),%cl |
| shll %cl,%ebx |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| LGenRowLoop: |
| movl DP_Pix,%eax |
|
|
| LGenColLoop: |
| cmpw %bp,-2(%edx,%eax,2) |
| jg LGSkip |
| movw %bp,-2(%edx,%eax,2) |
| movb %ch,-1(%edi,%eax,1) |
| LGSkip: |
| decl %eax |
| jnz LGenColLoop |
|
|
| addl C(d_zrowbytes),%edx |
| addl C(screenwidth),%edi |
|
|
| decl %ebx |
| jnz LGenRowLoop |
|
|
| LDone: |
| popl %ebx |
| popl %edi |
| popl %ebp |
| ret |
|
|
| LPop6AndDone: |
| fstp %st(0) |
| fstp %st(0) |
| fstp %st(0) |
| fstp %st(0) |
| fstp %st(0) |
| LPop1AndDone: |
| fstp %st(0) |
| jmp LDone |
|
|
| #endif |
|
|