-
Notifications
You must be signed in to change notification settings - Fork 0
/
menufon.asm
74 lines (74 loc) · 1.3 KB
/
menufon.asm
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
73
74
.data 0x10090000
lightn: .word 0xffffffc0
darkn: .word 0xffffbbb0
menusquare: .word 0x00000000
darkblue: .word 0x32154367
darkred: .word 0xff880000 #0xff33ee55 - çåëåíûå ïîëîñêè
greenstick: .word 0xffff99a0
white: .word 0xffffffff
text: .asciiz ""
.text
.globl menufon
menufon:
sw $ra -4($sp)
lw $t0 lightn #lightn
lw $t1 darkn #darkn
la $a1 0x10010000
move $a0 $t0
li $t6 1
li $t4 8
li $t5 64
menufonlp:
bgtz $t6 menufonlpsq
move $a0 $t1
menufonlpsq:
jal printsquare
move $a1 $v0
mul $t6 $t6 -1
addi $t5 $t5 -1
beqz $t5 menufonprepare2
addi $t4 $t4 -1
move $a0 $t0
bnez $t4 menufonlp
mul $t6 $t6 -1
addi $a1 $a1 31744 #32768
li $t4 8
j menufonlp
menufonprepare2:
lw $a0 menusquare
lw $a2 greenstick
la $a1 0x10010000
addi $a1 $a1 65664
li $t4 6
li $t5 24
menufonprepare2lp:
jal printmenusquare
move $a1 $v0
addi $t5 $t5 -1
beqz $t5 menufonprepare3
addi $t4 $t4 -1
bnez $t4 menufonprepare2lp
addi $a1 $a1 32000
li $t4 6
j menufonprepare2lp
menufonprepare3:
la $a1 0x10010000
addi $a1 $a1 98496
lw $a0 darkred
jal printmenucircle
move $a1 $v0
lw $a0 darkblue
jal printmenucircle
li $a1 0x10010000
addi $a1 $a1 98496
lw $a2 white
jal menuselect
lw $a0 32896($a1)
beq $a0 0xff880000 startthegame
move $v0 $zero
lw $ra -4($sp)
jr $ra
startthegame:
lw $ra -4($sp)
li $v0 1
jr $ra