-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
317 additions
and
9 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,218 @@ | ||
.thumb | ||
push {lr} | ||
push {r4-r6} | ||
|
||
ldr r6,=drawTile | ||
|
||
@first, figure out which one of the four animations is going to be used, based on snek position | ||
ldr r3,=#0x02000000 | ||
ldrh r2,[r3] | ||
lsl r2,#1 | ||
add r2,#0x20 | ||
sub r2,#2 | ||
ldrb r4,[r3,r2] | ||
add r2,#1 | ||
ldrb r5,[r3,r2] | ||
|
||
@jump to a label based on the snake head position | ||
cmp r4,#0xF | ||
bhi rightSide | ||
cmp r5,#0xC | ||
bhi leftLower | ||
b leftUpper | ||
rightSide: | ||
cmp r5,#0xC | ||
bhi rightLowerTrampolin | ||
b rightUpper | ||
|
||
rightLowerTrampolin: | ||
b rightLower | ||
|
||
leftUpper: | ||
add r5,#1 | ||
mov r0,#1 | ||
ldr r1,=#0x83B | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
add r4,#1 | ||
mov r0,#1 | ||
ldr r1,=#0x83C | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
add r4,#1 | ||
mov r0,#1 | ||
ldr r1,=#0x83D | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
sub r4,#2 | ||
add r5,#1 | ||
mov r0,#1 | ||
ldr r1,=#0x837 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
add r4,#1 | ||
mov r0,#1 | ||
ldr r1,=#0x838 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
add r4,#1 | ||
mov r0,#1 | ||
ldr r1,=#0x839 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
b End | ||
|
||
leftLower: | ||
sub r5,#1 | ||
mov r0,#1 | ||
mov r1,#0x3B | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
add r4,#1 | ||
mov r0,#1 | ||
mov r1,#0x3C | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
add r4,#1 | ||
mov r0,#1 | ||
mov r1,#0x3D | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
sub r4,#2 | ||
sub r5,#1 | ||
mov r0,#1 | ||
mov r1,#0x37 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
add r4,#1 | ||
mov r0,#1 | ||
mov r1,#0x38 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
add r4,#1 | ||
mov r0,#1 | ||
mov r1,#0x39 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
b End | ||
|
||
rightUpper: | ||
add r5,#1 | ||
mov r0,#1 | ||
ldr r1,=#0x846 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
sub r4,#1 | ||
mov r0,#1 | ||
ldr r1,=#0x845 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
sub r4,#1 | ||
mov r0,#1 | ||
ldr r1,=#0x844 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
add r4,#2 | ||
add r5,#1 | ||
mov r0,#1 | ||
ldr r1,=#0x842 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
sub r4,#1 | ||
mov r0,#1 | ||
ldr r1,=#0x841 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
sub r4,#1 | ||
mov r0,#1 | ||
ldr r1,=#0x840 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
b End | ||
|
||
rightLower: | ||
sub r5,#1 | ||
mov r0,#1 | ||
mov r1,#0x46 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
sub r4,#1 | ||
mov r0,#1 | ||
mov r1,#0x45 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
sub r4,#1 | ||
mov r0,#1 | ||
mov r1,#0x44 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
add r4,#2 | ||
sub r5,#1 | ||
mov r0,#1 | ||
mov r1,#0x42 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
sub r4,#1 | ||
mov r0,#1 | ||
mov r1,#0x41 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
sub r4,#1 | ||
mov r0,#1 | ||
mov r1,#0x40 | ||
mov r2,r4 | ||
mov r3,r5 | ||
mov lr,r6 | ||
.short 0xF800 | ||
b End | ||
|
||
End: | ||
pop {r4-r6} | ||
pop {r0} | ||
bx r0 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters