Short: Improved AmiQuake2 from NovaCoder Author: Cosmos Amiga Uploader: cosmos.amiga@gmail.com Type: game Version: 1.15 Requires: AGA & OS 3.0+ & 68060@85+ Architecture: m68k-amigaos URL: http://leblogdecosmos.blogspot.com Improved AmiQuake2 AGA for 68060 AmiQuake2 1.15 - fix 7 compilator bugs - _AngleVectors optimized - _LVOSMul32 inlined - _VectorLength optimized - _VectorMA optimized - _VectorNormalize optimized to death - _VectorScale optimized AmiQuake2 1.14 - by NovaCoder Known bugs in the original 1.14 - problems using TLSFMemPool when you quit the game Installation highly recommended - 68060 mathieeedoubtrans.library 46.00 from Matthias Henze in Sys:Libs/ - install mathieeedoubas.library 45.881 r10 from Peter Keunecke in Sys:Libs/ - for Phase5 boards, install the 68060.library 46.16 in Sys:Libs/ - if using the Workbench 3.1, install the little 68040.library too Microcode 68k is magic _VectorNormalize_164bytes _VectorNormalize_64bytes link a5,#0 move.l 1*4(sp),a0 fmovem.x fp2,-(sp) moveq #%1011,d1 move.l a2,-(sp) fmove.s d1,fp0 move.l 8(a5),a2 .loop_1 fsmove.s (a2),fp0 fmove.s (a0)+,fp1 fsmul.x fp0,fp0 fmul.x fp1,fp1 fsmove.s 4(a2),fp2 fadd.x fp1,fp0 fsmul.x fp2,fp2 lsr.b #1,d1 fsadd.x fp2,fp0 bcs.b .loop_1 fsmove.s 8(a2),fp1 fsqrt.x fp0 fsmul.x fp1,fp1 fmove.s fp0,d0 fsadd.x fp1,fp0 fbeq.w .end fdsqrt.x fp0,fp1 fmove.b d1,fp1 fcmp.x fp1,fp1 fdiv.x fp0,fp1 fbne.w .whatthat? .loop_2 .back fmove.s -(a0),fp0 fsmove.x fp1,fp1 fmul.x fp1,fp0 fbeq.w .end subq.b #1,d1 fmove.s #1,fp0 fmove.s fp0,(a0) fsdiv.x fp1,fp0 bls.b .loop_2 fsmove.s (a2),fp2 .end fsmul.x fp0,fp2 rts fmove.s fp2,(a2) fsmove.s 4(a2),fp2 fsmul.x fp0,fp2 fmove.s fp2,4(a2) fsmul.s 8(a2),fp0 fmove.s fp0,8(a2) bra.b .end .whatthat? fmove.d fp0,-(sp) bsr.l _DPSqrt addq.l #8,sp move.l d1,-(sp) move.l d0,-(sp) fdmove.d (sp)+,fp1 bra.b .back .end fmove.s fp1,d0 move.l -$10(a5),a2 fmovem.x -$C(a5),fp2 unlk a5 rts _VectorMA_86bytes _VectorMA_40bytes link a5,#0 move.l 1*4(sp),a0 move.l a2,-(sp) move.l a2,d0 move.l 8(a5),a2 movem.l 3*4(sp),a1-a2 fsmove.s $C(a5),fp1 moveq #3,d1 move.l $10(a5),a0 .loop move.l $14(a5),a1 fmove.s (a1)+,fp0 fsmove.s (a0),fp0 fmul.s 2*4(sp),fp0 fsmul.x fp1,fp0 subq.b #1,d1 fsadd.s (a2),fp0 fadd.s (a0)+,fp0 fmove.s fp0,(a1) fmove.s fp0,(a2)+ fsmove.s 4(a0),fp0 bne.b .loop fsmul.x fp1,fp0 move.l d0,a2 fsadd.s 4(a2),fp0 rts fmove.s fp0,4(a1) fsmul.s 8(a0),fp1 fsadd.s 8(a2),fp1 fmove.s fp1,8(a1) move.l (sp)+,a2 unlk a5 rts _VectorLength_80bytes _VectorLength_36bytes link a5,#0 move.l 1*4(sp),a0 fmove.s #0,fp1 moveq #3,d0 move.l 8(a5),a0 fmove.s d0,fp0 lea 8(a0),a1 .loop .loop fmove.s (a0)+,fp1 fsmove.s (a0)+,fp0 fmul.x fp1,fp1 fsmul.x fp0,fp0 fadd.x fp1,fp0 fsadd.x fp0,fp1 subq.b #1,d0 cmpa.l a0,a1 bne.b .loop bge.b .loop fsqrt.x fp0 fdsqrt.x fp1,fp0 fmove.s fp0,d0 fcmp.x fp0,fp0 rts fbeq.w .end fmove.d fp1,-(sp) bsr.l _DPSqrt addq.l #8,sp move.l d1,-(sp) move.l d0,-(sp) fdmove.d (sp)+,fp0 .end fsmove.x fp0,fp1 fmove.s fp1,d0 unlk a5 rts AmiQuake2 1.14 is an asm source of 398 214 lines made with : 46 514 move 10 039 fmove 8 536 pea 2 448 fadd 8 011 add 2 377 fmul 6 998 lea 1 291 fcmp 5 961 jsr 1 046 fsub 5 752 beq 581 ftst 5 647 clr 546 fintrz 5 108 bsr 535 fdiv 4 879 bra 465 fmovem 4 876 tst 421 fbne 4 672 moveq 341 fbngt 4 477 cmp 337 fbeq 2 826 bne 302 fbnlt 2 264 rts 232 fblt 2 104 unlk 133 fbgt 2 102 link 132 fneg 1 587 sub 84 fble 1 806 movem 78 fbnge 1 064 btst 65 fbge 1 028 and 60 fbnle 928 ble 53 fabs 687 blt 16 fsqrt 766 mul 718 bge 550 or 536 lsl 517 bgt 513 asr 254 bpl 226 eor 191 div 151 bcs 149 lsr 143 extb 142 not 136 bcc 95 bhi 88 ext 80 bfextu 63 bls 54 neg 48 rol 40 bset 37 bftst 37 st 36 bmi 35 swap 29 seq 28 subx 27 sne 26 jmp 25 bclr 17 bchg 16 dbf 13 addx 10 bfexts 6 bfins 5 asl 4 ror 3 exg 1 sge