annotate src/gba_asm.s @ 0:c84446dfb3f5

initial add
author paulo@localhost
date Fri, 13 Mar 2009 00:39:12 -0700
parents
children
rev   line source
paulo@0 1 @ fixed fastfmul(fixed x, fixed y)
paulo@0 2 @ Multiply two 16.16 fixed-point numbers.
paulo@0 3
paulo@0 4 .ARM
paulo@0 5 .ALIGN
paulo@0 6 .GLOBL fastfmul
paulo@0 7
paulo@0 8 fastfmul:
paulo@0 9 smull r1,r2,r0,r1
paulo@0 10 mov r0,r2,LSL#16
paulo@0 11 orr r0,r0,r1,LSR#16
paulo@0 12 bx lr
paulo@0 13
paulo@0 14
paulo@0 15 @ int dv(int num, int den)
paulo@0 16 @ Divide two signed integers.
paulo@0 17
paulo@0 18 .THUMB
paulo@0 19 .THUMB_FUNC
paulo@0 20 .ALIGN
paulo@0 21 .GLOBL dv
paulo@0 22
paulo@0 23 dv:
paulo@0 24 cmp r1, #0
paulo@0 25 beq 0f
paulo@0 26 swi 6
paulo@0 27 bx lr
paulo@0 28 0:
paulo@0 29 ldr r0, =0x7fffffff
paulo@0 30 bx lr
paulo@0 31
paulo@0 32
paulo@0 33 @ int fracmul(signed int x, signed int frac)
paulo@0 34 @ Multiply by a 0.32 fractional number between -0.5 and 0.5.
paulo@0 35 @ Used for fast division by a constant.
paulo@0 36
paulo@0 37 .ARM
paulo@0 38 .ALIGN
paulo@0 39 .GLOBL fracmul
paulo@0 40
paulo@0 41 fracmul:
paulo@0 42 smull r1,r2,r0,r1
paulo@0 43 mov r0, r2
paulo@0 44 bx lr
paulo@0 45
paulo@0 46
paulo@0 47 @ int fracumul(unsigned int x, unsigned int frac)
paulo@0 48 @ Multiply by a 0.32 fractional number between 0 and 1.
paulo@0 49 @ Used for fast division by a constant.
paulo@0 50
paulo@0 51 .ARM
paulo@0 52 .ALIGN
paulo@0 53 .GLOBL fracumul
paulo@0 54
paulo@0 55 fracumul:
paulo@0 56 umull r1,r2,r0,r1
paulo@0 57 mov r0, r2
paulo@0 58 bx lr
paulo@0 59
paulo@0 60
paulo@0 61 @ void gblz_unpack(const void *src, void *dst)
paulo@0 62 @ Unpack GB LZSS format data.
paulo@0 63
paulo@0 64 .THUMB
paulo@0 65 .THUMB_FUNC
paulo@0 66 .ALIGN
paulo@0 67 .GLOBL _gblz_unpack
paulo@0 68
paulo@0 69 _gblz_unpack:
paulo@0 70 swi 0x11 @ LZ77UnCompWRAM
paulo@0 71 bx lr
paulo@0 72
paulo@0 73