Mercurial > hg > index.fcgi > lj > lj046
comparison src/gba_asm.s @ 0:c84446dfb3f5
initial add
author | paulo@localhost |
---|---|
date | Fri, 13 Mar 2009 00:39:12 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:2fd121800716 |
---|---|
1 @ fixed fastfmul(fixed x, fixed y) | |
2 @ Multiply two 16.16 fixed-point numbers. | |
3 | |
4 .ARM | |
5 .ALIGN | |
6 .GLOBL fastfmul | |
7 | |
8 fastfmul: | |
9 smull r1,r2,r0,r1 | |
10 mov r0,r2,LSL#16 | |
11 orr r0,r0,r1,LSR#16 | |
12 bx lr | |
13 | |
14 | |
15 @ int dv(int num, int den) | |
16 @ Divide two signed integers. | |
17 | |
18 .THUMB | |
19 .THUMB_FUNC | |
20 .ALIGN | |
21 .GLOBL dv | |
22 | |
23 dv: | |
24 cmp r1, #0 | |
25 beq 0f | |
26 swi 6 | |
27 bx lr | |
28 0: | |
29 ldr r0, =0x7fffffff | |
30 bx lr | |
31 | |
32 | |
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. | |
36 | |
37 .ARM | |
38 .ALIGN | |
39 .GLOBL fracmul | |
40 | |
41 fracmul: | |
42 smull r1,r2,r0,r1 | |
43 mov r0, r2 | |
44 bx lr | |
45 | |
46 | |
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. | |
50 | |
51 .ARM | |
52 .ALIGN | |
53 .GLOBL fracumul | |
54 | |
55 fracumul: | |
56 umull r1,r2,r0,r1 | |
57 mov r0, r2 | |
58 bx lr | |
59 | |
60 | |
61 @ void gblz_unpack(const void *src, void *dst) | |
62 @ Unpack GB LZSS format data. | |
63 | |
64 .THUMB | |
65 .THUMB_FUNC | |
66 .ALIGN | |
67 .GLOBL _gblz_unpack | |
68 | |
69 _gblz_unpack: | |
70 swi 0x11 @ LZ77UnCompWRAM | |
71 bx lr | |
72 | |
73 |