arch gba.thumb // Makes links from other routines not break org $0800733C ldr r3,[$08007374] org $08007374 dd 0x03001244 org $08007342 bl $08006240 org $0800777C ldr r3,[$080077DC] org $080077DC dd 0x03001244 org $080078A4 ldr r3,[$080078B4] // Check whether to accelerate or not org $08006926 ldr r0,[$08006950] // =$030011E8 ldrh r0,[r0] // Load input ldrh r1,[r3,#0x12] // Load direction tst r0,r1 // If not holding forwards beq $08006958 // Go to 8006958 nop #8 // Freespace :) bl $08006240 // Go to 8006240 // Acceleration routine org $08006240 push {r4,lr} // Push r4 and lr mov r2,#0xC // Make r2 12 ldrb r0,[r3,#6] // Load speed boosting switch cmp r0,#0 // If speed boosting bne ++ // Go to Air_check ldr r1,[$080062E0] // =$03001310 ldrb r0,[r1,#0xC] // Load suit + misc. status mov r1,#2 // Make r1 speed booster bit and r0,r1 // AND r1 to r0 mov r8,r0 // Copy result to r8 for later use cmp r0,#0 // If not got speed booster beq + // r2=3 mov r2,#6 // Make r2 6 b Air_check // Go to Air_check + mov r2,#3 // Make r2 3 Air_check: ldrh r1,[r3,#0x1A] // Load horizontal momentum to r1 ldrh r0,[r3,#0x1C] // Load vertical momentum cmp r0,#0 // If on ground beq Direction_check // Go to Direction_check mov r0,#0xC0 // Make r0 192 add r4,r1,r0 // Add 192 to r1 lsl r4,r4,#0x10 // Shift r4 left by 16 lsl r0,r0,#0x11 // Add 192 and shift r0 left by 16 cmp r4,r0 // If r4 is higher than r0 bcs Return // Go to Return Direction_check: ldrb r0,[r3,#0x12] // Load direction cmp r0,#0x20 // If going leftwards beq Accel_left // Go to Accel_left add r1,r1,r2 // Add r2 to r1 strh r1,[r3,#0x1A] // Store r1 to horizontal momentum b Return // Go to Return Accel_left: sub r1,r1,r2 // Subtract r2 from r1 strh r1,[r3,#0x1A] // Store r1 to horizontal momentum nop #6 // Freespace :) Return: pop {r4,pc} // Pop to r4 and pc // Remove speed boosting cap org $08004E08 nop org $08004E14 nop // Remove camera speed cap org $08069C10 nop org $08069C34 nop org $0806A0AE nop org $0806A0C8 nop // Horizontal spark speed org $08009CDC ldr r0,[$08009CF4] // Load 576 to r0 mov r2,#0x10 // Make r2 0x10 tst r2,r1 // If not going rightwards beq + // Go to + b ++ // Go to ++ + neg r0,r0 // Negate r0 ++ strh r0,[r3,#0x1A] // Store r0 to horizontal momentum nop // Freespace org $08009CF4 dw 0x0240 // Diagonal spark speed org $08009CA4 -- neg r0,r0 // Negate r0 - strh r0,[r3,#0x1A] // Store r0 to horizontal momentum org $08009CCA ldr r0,[$08009CF4] // Load 576 to r0 mov r2,#0x10 // Make r2 0x10 tst r2,r1 // If not going rightwards beq -- // Go to -- b - // Go to - org $08009CF4 dw 0x0240 // Wall-jump speed org $080092E8 mov r0,#0xC0 // Make r0 192 org $080092F8 ldr r0,[$08009310] // Load -192 to r0 org $08009310 dw 0xFF40 // Ladder speed org $08008776 mov r5,#0x60 // Make r5 96 org $08008782 ldr r5,[$08008788] // Load -96 to r5 org $08008788 dw 0xFFA0 // Prevent speed boosting without speed booster org $080064FA ldrh r0,[r4,#0x1A] // Load horizontal momentum to r0 mov r2,#0xC0 // Make r2 192 lsl r2,r2,#1 // Double r2 add r0,r0,r2 // Add 384 to r0 lsl r0,r0,#0x10 // Shift r0 left by 16 lsl r2,r2,#0x11 // Add 384 and shift r2 left by 16 cmp r0,r2 // If r0 is lower than r2 bcc + // Go to + cmp r8,r1 // If not got speed booster bne + // Go to + strb r1,[r4,#6] // Store r1 to speed boosting switch nop #3 // Freespace :) +