#171955 - zodiacdagreat - Mon Jan 04, 2010 10:22 am
I've been coding a titlescreen in asm and wanted to add in some animations. Does anyone know proper ways to do animations? According to Tonc, swi 0x5 is better than WaitForVBlank. So, I did something like this:
.WaitVBlank:
push {r2-r3, lr}
mov r3, #0x10 @ Amount of calls
mov r2, #0x0
.Loop:
swi 0x5
add r2, r2, #0x1
cmp r2, r3
ble .Loop
pop {r2-r3, pc}
Is that way, correct or preferable? I also found that another method works better:
swi 0x5
swi 0x5
swi 0x5
...
But according to my friends it's ugly and not good. Anywho, really need some help and guidance here :D
.WaitVBlank:
push {r2-r3, lr}
mov r3, #0x10 @ Amount of calls
mov r2, #0x0
.Loop:
swi 0x5
add r2, r2, #0x1
cmp r2, r3
ble .Loop
pop {r2-r3, pc}
Is that way, correct or preferable? I also found that another method works better:
swi 0x5
swi 0x5
swi 0x5
...
But according to my friends it's ugly and not good. Anywho, really need some help and guidance here :D