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