;;; Arachnus_Walking ;;;
08024404 (T)  push    r4-r6,r14
08024406 (T)  mov     r6,0h
08024408 (T)  ldr     r4,=EnemyOrientation      ;\
0802440A (T)  ldrh    r1,[r4]                   ;|
0802440C (T)  mov     r0,40h                    ;|
0802440E (T)  and     r0,r1                     ;} If EnemyOrientation has 40h (facing right):
08024410 (T)  cmp     r0,0h                     ;|
08024412 (T)  beq     8024454h                  ;/
08024414 (T)  ldrh    r0,[r4,2h]                ; r0 parameter = EnemyYPosition
08024416 (T)  mov     r2,10h                    ;\
08024418 (T)  ldsh    r1,[r4,r2]                ;|
0802441A (T)  ldrh    r2,[r4,4h]                ;} r1 parameter = EnemyXPosition + EnemyRightBoundryOffset
0802441C (T)  add     r1,r1,r2                  ;/
0802441E (T)  bl      8011390h                  ; Execute subroutine 8011390h (position related)
08024422 (T)  ldr     r5,=30007A5h              ;\
08024424 (T)  ldrb    r1,[r5]                   ;|
08024426 (T)  mov     r0,0F0h                   ;|
08024428 (T)  and     r0,r1                     ;} If [30007A5] has F0h:
0802442A (T)  cmp     r0,0h                     ;|
0802442C (T)  beq     802448Eh                  ;/
0802442E (T)  ldrh    r0,[r4,2h]                ;\
08024430 (T)  sub     r0,48h                    ;} r0 parameter = EnemyYPosition - 48h
08024432 (T)  mov     r2,10h                    ;\
08024434 (T)  ldsh    r1,[r4,r2]                ;|
08024436 (T)  ldrh    r4,[r4,4h]                ;} r1 parameter = EnemyXPosition + EnemyRightBoundryOffset
08024438 (T)  add     r1,r1,r4                  ;/
0802443A (T)  bl      8011390h                  ; Execute subroutine 8011390h (position related)
0802443E (T)  ldrb    r1,[r5]                   ;\
08024440 (T)  mov     r0,0Fh                    ;|
08024442 (T)  and     r0,r1                     ;} If [30007A5] hasn't 0Fh, branch to 80244A0h
08024444 (T)  cmp     r0,0h                     ;|
08024446 (T)  beq     802448Ah                  ;/
08024448 (T)  b       802448Eh
0802444A      dw      00000h
0802444C      dd      0030006BCh,0030007A5h

                                                ; Else (EnemyOrientation hasn't 40h):
08024454 (T)  ldrh    r0,[r4,2h]                ; r0 parameter = EnemyYPosition
08024456 (T)  mov     r2,0Eh                    ;\
08024458 (T)  ldsh    r1,[r4,r2]                ;|
0802445A (T)  ldrh    r2,[r4,4h]                ;} r1 parameter = EnemyXPosition + EnemyLeftBoundryOffset
0802445C (T)  add     r1,r1,r2                  ;/
0802445E (T)  bl      8011390h                  ; Execute subroutine 8011390h (position related)
08024462 (T)  ldr     r5,=30007A5h              ;\
08024464 (T)  ldrb    r1,[r5]                   ;|
08024466 (T)  mov     r0,0F0h                   ;|
08024468 (T)  and     r0,r1                     ;} If [30007A5] has F0h:
0802446A (T)  cmp     r0,0h                     ;|
0802446C (T)  beq     802448Eh                  ;/
0802446E (T)  ldrh    r0,[r4,2h]                ;\
08024470 (T)  sub     r0,48h                    ;} r0 parameter = EnemyYPosition - 48h
08024472 (T)  mov     r2,0Eh                    ;\
08024474 (T)  ldsh    r1,[r4,r2]                ;|
08024476 (T)  ldrh    r4,[r4,4h]                ;} r1 parameter = EnemyXPosition + EnemyLeftBoundryOffset
08024478 (T)  add     r1,r1,r4                  ;/
0802447A (T)  bl      8011390h                  ; Execute subroutine 8011390h (position related)
0802447E (T)  ldrb    r1,[r5]                   ;\
08024480 (T)  mov     r0,0Fh                    ;|
08024482 (T)  and     r0,r1                     ;|
08024484 (T)  cmp     r0,0h                     ;|
08024486 (T)  beq     802448Ah                  ;} If [30007A5] has 0Fh:
08024488 (T)  mov     r6,1h                     ;|
0802448A (T)  cmp     r6,0h                     ;|
0802448C (T)  beq     80244A0h                  ;/

0802448E (T)  ldr     r0,=EnemyOrientation      ;\
08024490 (T)  add     r0,24h                    ;|
08024492 (T)  mov     r1,7h                     ;} EnemyPose = 7 (standing intialisation)
08024494 (T)  strb    r1,[r0]                   ;/
08024496 (T)  b       8024528h                  ; Branch to 8024528h (just before return)
08024498      dd      0030007A5h,0030006BCh

080244A0 (T)  ldr     r1,=EnemyOrientation      ;\ Else ([30007A5] hasn't 0Fh):
080244A2 (T)  ldrh    r0,[r1,16h]               ;|
080244A4 (T)  cmp     r0,1h                     ;|
080244A6 (T)  beq     80244D6h                  ;|
080244A8 (T)  cmp     r0,1h                     ;|
080244AA (T)  bgt     80244B8h                  ;|
080244AC (T)  cmp     r0,0h                     ;|
080244AE (T)  beq     80244C2h                  ;|
080244B0 (T)  b       80244DAh                  ;} Branch to code that handles the current EnemyAnimation
080244B2      dw      00000h                    ;|
080244B4      dd      0030006BCh                ;|
                                                ;|
080244B8 (T)  cmp     r0,2h                     ;|
080244BA (T)  beq     80244D2h                  ;|
080244BC (T)  cmp     r0,3h                     ;|
080244BE (T)  beq     80244D6h                  ;|
080244C0 (T)  b       80244DAh                  ;/

; EnemyAnimation = 0
080244C2 (T)  mov     r4,1h                     ; r4 = 1 (EnemyXSpeed)
080244C4 (T)  ldrb    r0,[r1,1Ch]               ;\
080244C6 (T)  cmp     r0,9h                     ;} If EnemyAnimationCounter = 9:
080244C8 (T)  bne     80244DCh                  ;/
080244CA (T)  mov     r0,0B8h                   ; r0 parameter = B8h
080244CC (T)  bl      800270Ch                  ; Execute subroutine 800270Ch (Sound effect?)
080244D0 (T)  b       80244DCh                  ; Branch to 80244DCh

; EnemyAnimation = 2
080244D2 (T)  mov     r4,3h                     ; r4 = 3 (EnemyXSpeed)
080244D4 (T)  b       80244DCh                  ; Branch to 80244DCh

; EnemyAnimation = 1 or 3
080244D6 (T)  mov     r4,2h                     ; r4 = 2 (EnemyXSpeed)
080244D8 (T)  b       80244DCh                  ; Branch to 80244DCh

; EnemyAnimation > 3
080244DA (T)  mov     r4,0h                     ; r4 = 0 (EnemyXSpeed)

080244DC (T)  ldr     r3,=EnemyOrientation      ;\
080244DE (T)  ldrh    r1,[r3]                   ;|
080244E0 (T)  mov     r0,40h                    ;|
080244E2 (T)  and     r0,r1                     ;} If EnemyOrientation has 40h:
080244E4 (T)  cmp     r0,0h                     ;|
080244E6 (T)  beq     802450Ch                  ;/
080244E8 (T)  ldrh    r0,[r3,4h]                ;\
080244EA (T)  add     r0,r4,r0                  ;} EnemyXPosition += r4 (EnemyXSpeed)
080244EC (T)  strh    r0,[r3,4h]                ;/
080244EE (T)  ldr     r2,=EnemySlot0            ;\
080244F0 (T)  mov     r0,r3                     ;|
080244F2 (T)  add     r0,2Fh                    ;|
080244F4 (T)  ldrb    r1,[r0]                   ;|
080244F6 (T)  lsl     r0,r1,3h                  ;|
080244F8 (T)  sub     r0,r0,r1                  ;} Enemy[EnemyAttachedEnemySlot]XPosition += r4 (EnemyXSpeed)
080244FA (T)  lsl     r0,r0,3h                  ;|
080244FC (T)  add     r0,r0,r2                  ;|
080244FE (T)  ldrh    r1,[r0,4h]                ;|
08024500 (T)  add     r1,r4,r1                  ;|
08024502 (T)  b       8024526h                  ;/
08024504      dd      0030006BCh,003000140h

0802450C (T)  ldrh    r0,[r3,4h]                ;\ Else (EnemyOrientation hasn't 40h):
0802450E (T)  sub     r0,r0,r4                  ;} EnemyXPosition -= r4 (EnemyXSpeed)
08024510 (T)  strh    r0,[r3,4h]                ;/
08024512 (T)  ldr     r2,=EnemySlot0            ;\
08024514 (T)  mov     r0,r3                     ;|
08024516 (T)  add     r0,2Fh                    ;|
08024518 (T)  ldrb    r1,[r0]                   ;|
0802451A (T)  lsl     r0,r1,3h                  ;|
0802451C (T)  sub     r0,r0,r1                  ;|
0802451E (T)  lsl     r0,r0,3h                  ;} Enemy[EnemyAttachedEnemySlot]XPosition +- r4 (EnemyXSpeed)
08024520 (T)  add     r0,r0,r2                  ;|
08024522 (T)  ldrh    r1,[r0,4h]                ;|
08024524 (T)  sub     r1,r1,r4                  ;|
                                                ;|
08024526 (T)  strh    r1,[r0,4h]                ;/

08024528 (T)  bl      80241B0h                  ; Execute subroutine Arachnus_FinishedWalking
0802452C (T)  pop     r4-r6
0802452E (T)  pop     r0
08024530 (T)  bx      r0
08024532      dw      00000h
08024534      dd      003000140h