My favorites | Sign in
Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
@ .section .iwram,"ax",%progbits
.text
.align 4
.code 32

sp_store: .space 4

.type clear_screen_asm,function
.global clear_screen_asm
clear_screen_asm:
@ r0 contains the address of the screen to clear
@ push all registers, store stack pointer in ram
stmfd sp!, {r4-r12,lr}
ldr r1,=sp_store
str sp,[r1]
@ mov r0,r1 @ address of screen
@ now store 0 in registers r0-r14
mov r1,#0
mov r2,#0
mov r3,#0
mov r4,#0
mov r5,#0
mov r6,#0
mov r7,#0
mov r8,#0
mov r9,#0
mov r10,#0
mov r11,#0
mov r12,#0
mov r13,#0
mov r14,#0
@ need to clear (SCREEN_TILE_HEIGHT*SCREEN_TILE_WIDTH * 8*8) / (2*4)
@ = 24*32*8*8/8 = 20*32*8 = 6144 "counts"
@ 6144 / 14 = 438 (438*14 = 6132)
.rept 438
stmia r0!, {r1-r14}
.endr
@ the last 12 words
stmia r0!, {r1-r12}
@ get all the regs back again
ldr r0,=sp_store
ldr sp,[r0]
ldmfd sp!,{r4-r12,lr}
bx lr

.global clear_lollipop_asm
.type clear_lollipop_asm,function

clear_lollipop_asm:
@ clear 32 words for the lollipop
@ r0 contains address
stmfd sp!, {r4-r12}
mov r1,#0
mov r2,#0
mov r3,#0
mov r4,#0
mov r5,#0
mov r6,#0
mov r7,#0
mov r8,#0
mov r9,#0
mov r10,#0
mov r11,#0
mov r12,#0
stmia r0!, {r1-r12} @ 12
stmia r0!, {r1-r12} @ 24
stmia r0!, {r1-r8} @ 32
ldmfd sp!, {r4-r12}
bx lr


.pool
Show details Hide details

Change log

r58 by richard.quirk on Dec 08, 2007   Diff
Start hacking on the VRAM.
Go to: 
Project members, sign in to write a code review

Older revisions

r14 by richard.quirk on Nov 20, 2007   Diff
Port to the DS stage 1 - code
compiles.

The code now compiles for the DS -
change all the GBA register values
...
r2 by richard.quirk on Nov 12, 2007   Diff
Initial import of the GBA code.
All revisions of this file

File info

Size: 1437 bytes, 72 lines
Hosted by Google Code