The current URL is datacrystal.tcrf.net.
Magical Vacation/ROM map: Difference between revisions
mNo edit summary |
m (Xkeeper moved page Magical Vacation:ROM map to Magical Vacation/ROM map: normalize subpages and titles) |
(No difference)
|
Latest revision as of 02:42, 24 January 2024
The following article is a ROM map for Magical Vacation.
$08000438 - Main Loop
$02000330 contains the number of the Address Table Entry this subroutine jumps the program to.
08000438: 4819 ldr r0, =#0x02000330 0800043A: 8800 ldrh r0, [r0] ; Load Table Entry Number to jump to 0800043C: 2818 cmp r0, #0x18 0800043E: D8FB bhi 0x08000438 ; If Table Entry Number is higher than #$18, LOOP INFINITELY 08000440: 0080 lsl r0, r0, #0x2 ; Multiply by 4 (each entry is 4 bytes in size) 08000442: 491A ldr r1, =#0x080004B0 ; Offset of the Table 08000444: 1840 add r0, r0, r1 ; Add Table Offset to Entry Number 08000446: 6800 ldr r0, [r0] ; Load Address 08000448: 4687 mov pc, r0 ; Go To Address ;0800044A: 0000 lsl r0, r0, #0x0
$080004B0 - Address Table for Main Loop
Used in $08000438.
$08000514 - Entry #$00 $08000514 - Entry #$01 $08000514 - Entry #$02 $08000524 - Entry #$03 $0800052E - Entry #$04 $08000648 - Entry #$05 $0800069C - Entry #$06 $080006EC - Entry #$07 $080006FC - Entry #$08 $08000738 - Entry #$09 $080007AC - Entry #$0A $080007C8 - Entry #$0B - Brownie Brown Logo $08000514 - Entry #$0C $08000748 - Entry #$0D $08000814 - Entry #$0E $080008AC - Entry #$0F $080008E8 - Entry #$10 $08000848 - Entry #$11 $080007E0 - Entry #$12 $08000878 - Entry #$13 $08000758 - Entry #$14 $0800077C - Entry #$15 $0800078C - Entry #$16 $08000514 - Entry #$17 $08000934 - Entry #$18
$08000514 - ?
08000514: 4802 ldr r0, =#0x02000330 08000516: 8800 ldrh r0, [r0] 08000518: F000 bl 0800051A: FA1A bl 0x08000950 0800051C: E78C b 0x08000438 0800051E: 0000 lsl r0, r0, #0x0 08000520: 0330 lsl r0, r6, #0xC 08000522: 0200 lsl r0, r0, #0x8
$08000524 - ?
One of the Addresses the Main Loop jumps to.
08000524: F000 bl 08000526: FE10 bl 0x08001148 08000528: F01C bl 0800052A: FE8C bl 0x0801D244 0800052C: E784 b 0x08000438 ; Return to Main Loop
$0800052E - ?
One of the Addresses the Main Loop jumps to.
0800052E: F013 bl 08000530: FEB7 bl 0x080142A0 ; (Sets $#0001, $#00FF and #$FFFF in registers) 08000532: F096 bl 08000534: FEBF bl 0x080972B4 ; ? 08000536: 0400 lsl r0, r0, #0x10 08000538: 0C00 lsr r0, r0, #0x10 ; Remove upper Double Byte 0800053A: 2806 cmp r0, #0x06 ; Is the number in r0 a valid Jump Table Entry Number? 0800053C: D866 bhi 0x0800060C ; If not, go to Entry 0 0800053E: 0080 lsl r0, r0, #0x2 08000540: 4901 ldr r1, =#0x0800054C 08000542: 1840 add r0, r0, r1 ; Add Table Entry Number * 4 to the Table Offset 08000544: 6800 ldr r0, [r0] ; Load Address from there 08000546: 4687 mov pc, r0 ; Jump there ;DATA ;========== ;08000548: 054C lsl r4, r1, #0x15 ;0800054A: 0800 lsr r0, r0, #0x0 ;JUMP TABLE ;========== ; Entry #$00: #$0800060C ; Entry #$01: #$080005CC ; Entry #$02: #$08000604 ; Entry #$03: #$080005E4 ; Entry #$04: #$080005D8 ; Entry #$05: #$08000568 ; Entry #$06: #$080005F4 ;0800054C: 060C lsl r4, r1, #0x18 ;0800054E: 0800 lsr r0, r0, #0x0 ;08000550: 05CC lsl r4, r1, #0x17 ;08000552: 0800 lsr r0, r0, #0x0 ;08000554: 0604 lsl r4, r0, #0x18 ;08000556: 0800 lsr r0, r0, #0x0 ;08000558: 05E4 lsl r4, r4, #0x17 ;0800055A: 0800 lsr r0, r0, #0x0 ;0800055C: 05D8 lsl r0, r3, #0x17 ;0800055E: 0800 lsr r0, r0, #0x0 ;08000560: 0568 lsl r0, r5, #0x15 ;08000562: 0800 lsr r0, r0, #0x0 ;08000564: 05F4 lsl r4, r6, #0x17 ;08000566: 0800 lsr r0, r0, #0x0
$08000568 - ($0800054C Jump Table Entry #$05)
08000568: 4D13 ldr r5, =#0x020326F0 0800056A: 78A8 ldrb r0, [r5, #0x02] 0800056C: 2602 mov r6, #0x02 0800056E: 4330 orr r0, r6 08000570: 70A8 strb r0, [r5, #0x02] 08000572: 2001 mov r0, #0x01 08000574: F09C bl 08000576: F9A4 bl 0x0809C8C0 08000578: 0400 lsl r0, r0, #0x10 0800057A: 0C00 lsr r0, r0, #0x10 0800057C: 2802 cmp r0, #0x02 0800057E: D000 beq 0x08000582 08000580: E0C5 b 0x0800070E 08000582: F01B bl 08000584: F9B3 bl 0x0801B8EC 08000586: F001 bl 08000588: FA85 bl 0x08001A94 0800058A: F01C bl 0800058C: FE17 bl 0x0801D1BC 0800058E: F023 bl 08000590: F803 bl 0x08023598 08000592: F009 bl 08000594: FFBB bl 0x0800A50C 08000596: 4809 ldr r0, =#0x02000348 08000598: 2100 mov r1, #0x00 0800059A: 8001 strh r1, [r0] 0800059C: 4808 ldr r0, =#0x020298E0 0800059E: 8001 strh r1, [r0] 080005A0: 4808 ldr r0, =#0x0200033C 080005A2: 8001 strh r1, [r0] 080005A4: 4C08 ldr r4, =#0x02000330 080005A6: 2017 mov r0, #0x17 080005A8: 8020 strh r0, [r4] 080005AA: 2017 mov r0, #0x17 080005AC: F000 bl 080005AE: F9D0 bl 0x08000950 080005B0: 78A8 ldrb r0, [r5, #0x02] 080005B2: 4330 orr r0, r6 080005B4: 70A8 strb r0, [r5, #0x02] 080005B6: E1B0 b 0x0800091A ;DATA ;============ ;080005B8: 26F0 mov r6, #0xF0 ;080005BA: 0203 lsl r3, r0, #0x8 ;080005BC: 0348 lsl r0, r1, #0xD ;080005BE: 0200 lsl r0, r0, #0x8 ;080005C0: 98E0 ldr r0, [sp, #0x380] ;080005C2: 0202 lsl r2, r0, #0x8 ;080005C4: 033C lsl r4, r7, #0xC ;080005C6: 0200 lsl r0, r0, #0x8 ;080005C8: 0330 lsl r0, r6, #0xC ;080005CA: 0200 lsl r0, r0, #0x8
$080005CC - ($0800054C Jump Table Entry #$01)
080005CC: 4901 ldr r1, =#0x02000330 080005CE: 2005 mov r0, #0x05 080005D0: E166 b 0x080008A0 ;DATA ;====== ;080005D2: 0000 lsl r0, r0, #0x0 ;080005D4: 0330 lsl r0, r6, #0xC ;080005D6: 0200 lsl r0, r0, #0x8
$080005D8 - ($0800054C Jump Table Entry #$04)
080005D8: 4901 ldr r1, =#0x02000330 080005DA: 200E mov r0, #0x0E 080005DC: E160 b 0x080008A0 ;DATA ;========= ;080005DE: 0000 lsl r0, r0, #0x0 ;080005E0: 0330 lsl r0, r6, #0xC ;080005E2: 0200 lsl r0, r0, #0x8
$080005E4 - ($0800054C Jump Table Entry #$03)
080005E4: 2008 mov r0, #0x08 080005E6: F09C bl 080005E8: F96B bl 0x0809C8C0 080005EA: 4901 ldr r1, =#0x02000330 080005EC: 2004 mov r0, #0x04 080005EE: E157 b 0x080008A0 080005F0: 0330 lsl r0, r6, #0xC 080005F2: 0200 lsl r0, r0, #0x8 080005F4: 2009 mov r0, #0x09 080005F6: F09C bl 080005F8: F963 bl 0x0809C8C0 080005FA: 4901 ldr r1, =#0x02000330 080005FC: 2004 mov r0, #0x04 080005FE: E14F b 0x080008A0 ;DATA ;======== ;08000600: 0330 lsl r0, r6, #0xC ;08000602: 0200 lsl r0, r0, #0x8
$08000604 - ($0800054C Jump Table Entry #$02)
08000604: 2002 mov r0, #0x02 08000606: F09C bl 08000608: F95B bl 0x0809C8C0 0800060A: E080 b 0x0800070E
$0800060C - ($0800054C Jump Table Entry #$00)
0800060C: F01B bl 0800060E: F96E bl 0x0801B8EC 08000610: F001 bl 08000612: FA40 bl 0x08001A94 08000614: F01C bl 08000616: FDD2 bl 0x0801D1BC 08000618: F022 bl 0800061A: FFBE bl 0x08023598 0800061C: F009 bl 0800061E: FF76 bl 0x0800A50C 08000620: 4805 ldr r0, =#0x02000348 08000622: 2100 mov r1, #0x00 08000624: 8001 strh r1, [r0] 08000626: 4805 ldr r0, =#0x020298E0 08000628: 8001 strh r1, [r0] 0800062A: 4805 ldr r0, =#0x0200033C 0800062C: 8001 strh r1, [r0] 0800062E: 4905 ldr r1, =#0x02000330 ; Let Main Loop Jump at Table Entry #$08 08000630: 2008 mov r0, #0x08 08000632: 8008 strh r0, [r1] 08000634: E700 b 0x08000438 ; Return to Main Loop ;DATA ;============ ;08000636: 0000 lsl r0, r0, #0x0 ;08000638: 0348 lsl r0, r1, #0xD ;0800063A: 0200 lsl r0, r0, #0x8 ;0800063C: 98E0 ldr r0, [sp, #0x380] ;0800063E: 0202 lsl r2, r0, #0x8 ;08000640: 033C lsl r4, r7, #0xC ;08000642: 0200 lsl r0, r0, #0x8 ;08000644: 0330 lsl r0, r6, #0xC ;08000646: 0200 lsl r0, r0, #0x8
$080007C8 - Brownie Brown Logo
080007C8: F01B bl 080007CA: FFBA bl 0x0801C740 ; Brownie Brown Logo 080007CC: 4903 ldr r1, =#0x02000330 080007CE: 2004 mov r0, #0x04 080007D0: 8008 strh r0, [r1] 080007D2: F000 bl 080007D4: FF65 bl 0x080016A0 ; Register Setup 080007D6: F000 bl 080007D8: FFA5 bl 0x08001724 ; (Value Transfer to WRAM) 080007DA: E62D b 0x08000438 ; Return to Main Loop ;DATA ;============ ;080007DC: 0330 lsl r0, r6, #0xC ;080007DE: 0200 lsl r0, r0, #0x8
$080016A0 - Register Setup after Brownie Brown Logo
080016A0: 4A06 ldr r2, =#0x04000200 080016A2: 8810 ldrh r0, [r2] ; Load Interrupt Setup Register into r0 080016A4: 4B06 ldr r3, =#0x00002001 080016A6: 1C19 add r1, r3, #0x0 ; Load $00002001 into r1 080016A8: 4308 orr r0, r1 ; Logical OR r0 with r1 080016AA: 8010 strh r0, [r2] ; Store it back in the Interrupt Setup Register 080016AC: 4905 ldr r1, =#0x04000004 080016AE: 2008 mov r0, #0x08 080016B0: 8008 strh r0, [r1] ; VBlank IRQ Enable 080016B2: 3904 sub r1, #0x04 ; r1 = $04000000 080016B4: 2000 mov r0, #0x00 080016B6: 8008 strh r0, [r1] ; Video Mode 0, GBA-Mode, No access to OAM during H-Blank 080016B8: 4770 bx lr ;DATA ;============ ;080016BA: 0000 lsl r0, r0, #0x0 ;080016BC: 0200 lsl r0, r0, #0x8 ;080016BE: 0400 lsl r0, r0, #0x10 ;080016C0: 2001 mov r0, #0x01 ;080016C2: 0000 lsl r0, r0, #0x0 ;080016C4: 0004 lsl r4, r0, #0x0 ;080016C6: 0400 lsl r0, r0, #0x10
$080016C8 - ?
080016C8: 4A05 ldr r2, =#0x02000344 080016CA: 6811 ldr r1, [r2] 080016CC: 0049 lsl r1, r1, #0x1 080016CE: 4805 ldr r0, =#0x04000006 080016D0: 7800 ldrb r0, [r0] ; Load Current Scanline 080016D2: 1808 add r0, r1, r0 080016D4: 0A09 lsr r1, r1, #0x8 080016D6: 1840 add r0, r0, r1 080016D8: 6010 str r0, [r2] 080016DA: 0400 lsl r0, r0, #0x10 080016DC: 0C00 lsr r0, r0, #0x10 080016DE: 4770 bx lr ;DATA ;============ ;080016E0: 0344 lsl r4, r0, #0xD ;080016E2: 0200 lsl r0, r0, #0x8 ;080016E4: 0006 lsl r6, r0, #0x0 ;080016E6: 0400 lsl r0, r0, #0x10
$080016E8 - (DMA to clear BG/OBJ Palette RAM, with DMA-Repeat)
080016E8: B081 add sp, #-0x004 ; Add 4 bytes to stack 080016EA: 2000 mov r0, #0x00 080016EC: 9000 str r0, [sp] ; Clear new stack bytes 080016EE: 4905 ldr r1, =#0x040000D4 080016F0: 4668 mov r0, sp 080016F2: 6008 str r0, [r1] ; DMA Source address: Clear stack entry 080016F4: 20A0 mov r0, #0xA0 080016F6: 04C0 lsl r0, r0, #0x13 080016F8: 6048 str r0, [r1, #0x04] ; DMA Destination: $05000000 (BG/OBJ Palette RAM) 080016FA: 4803 ldr r0, =#0x85000100 ; Fixed DMA, $400 bytes, DMA-Repeat on(?) 080016FC: 6088 str r0, [r1, #0x08] 080016FE: 6888 ldr r0, [r1, #0x08] 08001700: B001 add sp, #0x004 ; Remove added stack bytes 08001702: 4770 bx lr ;DATA ;============ ;08001704: 00D4 lsl r4, r2, #0x3 ;08001706: 0400 lsl r0, r0, #0x10 ;08001708: 0100 lsl r0, r0, #0x4 ;0800170A: 8500 strh r0, [r0, #0x28]
$0800170C - (Jump to $0805B58C)
This is used at the end of the title screen
0800170C: B500 push {lr} 0800170E: F059 bl 08001710: FF3D bl 0x0805B58C 08001712: BC01 pop {r0} 08001714: 4700 bx r0 ;08001716: 0000 lsl r0, r0, #0x0
$08001724 - (Value transfer to WRAM after Brownie Brown Logo)
08001724: B510 push {r4, lr} 08001726: 4C06 ldr r4, =#0x04000208 08001728: 2000 mov r0, #0x00 0800172A: 8020 strh r0, [r4] 0800172C: 4805 ldr r0, =#0x020000D0 ; Store Address 0800172E: 4906 ldr r1, =#0x080C5590 ; Load Address 08001730: 2238 mov r2, #0x38 ; Counter 08001732: F0C0 bl 08001734: FC57 bl 0x080C1FE4 ; DATA TRANSFER 08001736: 2001 mov r0, #0x01 08001738: 8020 strh r0, [r4] 0800173A: BC10 pop {r4} 0800173C: BC01 pop {r0} 0800173E: 4700 bx r0 ; DATA ; ======== ;08001740: 0208 lsl r0, r1, #0x8 ;08001742: 0400 lsl r0, r0, #0x10 ; Address: 04000208 ;08001744: 00D0 lsl r0, r2, #0x3 ;08001746: 0200 lsl r0, r0, #0x8 ; Address: 020000D0 ;08001748: 5590 strb r0, [r2, r6] ;0800174A: 080C lsr r4, r1, #0x0 ; Address: 080C5590
$08008E98 - ?
08008E98: B5F0 push {r4, r5, r6, r7, lr} 08008E9A: 4657 mov r7, r10 08008E9C: 464E mov r6, r9 08008E9E: 4645 mov r5, r8 08008EA0: B4E0 push {r5, r6, r7} 08008EA2: 1C05 add r5, r0, #0x0 ; r5 = r0 08008EA4: 2000 mov r0, #0x00 ; Clear r0 08008EA6: C501 stmia r5!, {r0} ; ??? 08008EA8: 48A0 ldr r0, =#0x02000340 08008EAA: 8801 ldrh r1, [r0] 08008EAC: 48A0 ldr r0, =#0x02000108 08008EAE: 8800 ldrh r0, [r0] 08008EB0: 0400 lsl r0, r0, #0x10 ; Combine both Double-Bytes (to form an ADDRESS!?) 08008EB2: 4301 orr r1, r0 08008EB4: C502 stmia r5!, {r1} ; ??? 08008EB6: 2480 mov r4, #0x80 08008EB8: 00A4 lsl r4, r4, #0x2 ; r4 = #$0200 08008EBA: C510 stmia r5!, {r4} ; ??? 08008EBC: 499D ldr r1, =#0x02029CB0 : Load address 08008EBE: 1C28 add r0, r5, #0x0 ; ??? Store address 08008EC0: 1C22 add r2, r4, #0x0 ; Counter 08008EC2: F0B9 bl 08008EC4: F88F bl 0x080C1FE4 ; Data Transfer 08008EC6: 192D add r5, r5, r4 ; ??? 08008EC8: 499B ldr r1, =#0x020096B0 ; Load address 08008ECA: 1C28 add r0, r5, #0x0 ; ??? Store address 08008ECC: 220A mov r2, #0x0A ; Counter 08008ECE: F0B9 bl 08008ED0: F889 bl 0x080C1FE4 ; Data Transfer 08008ED2: 350C add r5, #0x0C 08008ED4: 1C29 add r1, r5, #0x0 08008ED6: 4899 ldr r0, =#0x02008678 08008ED8: C80C ldmia r0!, {r2, r3} 08008EDA: C10C stmia r1!, {r2, r3} 08008EDC: 3508 add r5, #0x08 08008EDE: 2020 mov r0, #0x20 08008EE0: C501 stmia r5!, {r0} 08008EE2: 46AC mov r12, r5 08008EE4: 4C96 ldr r4, =#0x02000360 08008EE6: 2700 mov r7, #0x00 08008EE8: 200F mov r0, #0x0F 08008EEA: 4680 mov r8, r0 08008EEC: 2107 mov r1, #0x07 08008EEE: 468A mov r10, r1 08008EF0: 1C2B add r3, r5, #0x0 08008EF2: 330C add r3, #0x0C 08008EF4: 1C26 add r6, r4, #0x0 08008EF6: 3644 add r6, #0x44 08008EF8: 2201 mov r2, #0x01 08008EFA: 4691 mov r9, r2 08008EFC: 88E0 ldrh r0, [r4, #0x06] 08008EFE: 4661 mov r1, r12 08008F00: 8008 strh r0, [r1] 08008F02: 8920 ldrh r0, [r4, #0x08] 08008F04: 8048 strh r0, [r1, #0x02] 08008F06: 8960 ldrh r0, [r4, #0x0A] 08008F08: 8088 strh r0, [r1, #0x04] 08008F0A: 89A0 ldrh r0, [r4, #0x0C] 08008F0C: 80C8 strh r0, [r1, #0x06] 08008F0E: 8B60 ldrh r0, [r4, #0x1A] 08008F10: 8108 strh r0, [r1, #0x08] 08008F12: 8F20 ldrh r0, [r4, #0x38] 08008F14: 8148 strh r0, [r1, #0x0A] 08008F16: 8F60 ldrh r0, [r4, #0x3A] 08008F18: 0500 lsl r0, r0, #0x14 08008F1A: 0D00 lsr r0, r0, #0x14 08008F1C: 4989 ldr r1, =#0x00000FFF 08008F1E: 4001 and r1, r0 08008F20: 881A ldrh r2, [r3] 08008F22: 4889 ldr r0, =#0xFFFFF000 08008F24: 4010 and r0, r2 08008F26: 4308 orr r0, r1 08008F28: 8018 strh r0, [r3] 08008F2A: 1C20 add r0, r4, #0x0 08008F2C: 303B add r0, #0x3B 08008F2E: 7801 ldrb r1, [r0] 08008F30: 0909 lsr r1, r1, #0x4 08008F32: 0109 lsl r1, r1, #0x4 08008F34: 785A ldrb r2, [r3, #0x01] 08008F36: 4640 mov r0, r8 08008F38: 4010 and r0, r2 08008F3A: 4308 orr r0, r1 08008F3C: 7058 strb r0, [r3, #0x01] 08008F3E: 8FA0 ldrh r0, [r4, #0x3C] 08008F40: 0500 lsl r0, r0, #0x14 08008F42: 0D00 lsr r0, r0, #0x14 08008F44: 497F ldr r1, =#0x00000FFF 08008F46: 4001 and r1, r0 08008F48: 885A ldrh r2, [r3, #0x02] 08008F4A: 487F ldr r0, =#0xFFFFF000 08008F4C: 4010 and r0, r2 08008F4E: 4308 orr r0, r1 08008F50: 8058 strh r0, [r3, #0x02] 08008F52: 1C20 add r0, r4, #0x0 08008F54: 303D add r0, #0x3D 08008F56: 7801 ldrb r1, [r0] 08008F58: 0909 lsr r1, r1, #0x4 08008F5A: 0109 lsl r1, r1, #0x4 08008F5C: 78DA ldrb r2, [r3, #0x03] 08008F5E: 4640 mov r0, r8 08008F60: 4010 and r0, r2 08008F62: 4308 orr r0, r1 08008F64: 70D8 strb r0, [r3, #0x03] 08008F66: 7A30 ldrb r0, [r6, #0x08] 08008F68: 7118 strb r0, [r3, #0x04] 08008F6A: 7A70 ldrb r0, [r6, #0x09] 08008F6C: 7158 strb r0, [r3, #0x05] 08008F6E: 88A0 ldrh r0, [r4, #0x04] 08008F70: 7198 strb r0, [r3, #0x06] 08008F72: 89E0 ldrh r0, [r4, #0x0E] 08008F74: 71D8 strb r0, [r3, #0x07] 08008F76: 78B0 ldrb r0, [r6, #0x02] 08008F78: 7218 strb r0, [r3, #0x08] 08008F7A: 79B0 ldrb r0, [r6, #0x06] 08008F7C: 7258 strb r0, [r3, #0x09] 08008F7E: 7DB0 ldrb r0, [r6, #0x16] 08008F80: 7298 strb r0, [r3, #0x0A] 08008F82: 7DF0 ldrb r0, [r6, #0x17] 08008F84: 72D8 strb r0, [r3, #0x0B] 08008F86: 6D20 ldr r0, [r4, #0x50] 08008F88: 60D8 str r0, [r3, #0x0C] 08008F8A: 8B21 ldrh r1, [r4, #0x18] 08008F8C: 4A6F ldr r2, =#0x000003FF 08008F8E: 1C10 add r0, r2, #0x0 08008F90: 4001 and r1, r0 08008F92: 8A1A ldrh r2, [r3, #0x10] 08008F94: 486E ldr r0, =#0xFFFFFC00 08008F96: 4010 and r0, r2 08008F98: 4308 orr r0, r1 08008F9A: 8218 strh r0, [r3, #0x10] 08008F9C: 8832 ldrh r2, [r6] 08008F9E: 486B ldr r0, =#0x000003FF 08008FA0: 4002 and r2, r0 08008FA2: 0292 lsl r2, r2, #0xA 08008FA4: 6918 ldr r0, [r3, #0x10] 08008FA6: 496B ldr r1, =#0xFFF003FF 08008FA8: 4008 and r0, r1 08008FAA: 4310 orr r0, r2 08008FAC: 6118 str r0, [r3, #0x10] 08008FAE: 8821 ldrh r1, [r4] 08008FB0: 0109 lsl r1, r1, #0x4 08008FB2: 7C9A ldrb r2, [r3, #0x12] 08008FB4: 4640 mov r0, r8 08008FB6: 4010 and r0, r2 08008FB8: 4308 orr r0, r1 08008FBA: 7498 strb r0, [r3, #0x12] 08008FBC: 8861 ldrh r1, [r4, #0x02] 08008FBE: 200F mov r0, #0x0F 08008FC0: 4001 and r1, r0 08008FC2: 7CDA ldrb r2, [r3, #0x13] 08008FC4: 381F sub r0, #0x1F 08008FC6: 4010 and r0, r2 08008FC8: 4308 orr r0, r1 08008FCA: 74D8 strb r0, [r3, #0x13] 08008FCC: 8A21 ldrh r1, [r4, #0x10] 08008FCE: 0109 lsl r1, r1, #0x4 08008FD0: 4642 mov r2, r8 08008FD2: 4010 and r0, r2 08008FD4: 4308 orr r0, r1 08008FD6: 74D8 strb r0, [r3, #0x13] 08008FD8: 8C20 ldrh r0, [r4, #0x20] 08008FDA: 7518 strb r0, [r3, #0x14] 08008FDC: 8C61 ldrh r1, [r4, #0x22] 08008FDE: 203F mov r0, #0x3F 08008FE0: 4001 and r1, r0 08008FE2: 7D5A ldrb r2, [r3, #0x15] 08008FE4: 2040 mov r0, #0x40 08008FE6: 4240 neg r0, r0 08008FE8: 4010 and r0, r2 08008FEA: 4308 orr r0, r1 08008FEC: 7558 strb r0, [r3, #0x15] 08008FEE: 7DE2 ldrb r2, [r4, #0x17] 08008FF0: 4640 mov r0, r8 08008FF2: 4002 and r2, r0 08008FF4: 0392 lsl r2, r2, #0xE 08008FF6: 6958 ldr r0, [r3, #0x14] 08008FF8: 4957 ldr r1, =#0xFFFC3FFF 08008FFA: 4008 and r0, r1 08008FFC: 4310 orr r0, r2 08008FFE: 6158 str r0, [r3, #0x14] 08009000: 7F21 ldrb r1, [r4, #0x1C] 08009002: 220F mov r2, #0x0F 08009004: 4011 and r1, r2 08009006: 0089 lsl r1, r1, #0x2 08009008: 7D9A ldrb r2, [r3, #0x16] 0800900A: 203D mov r0, #0x3D 0800900C: 4240 neg r0, r0 0800900E: 4010 and r0, r2 08009010: 4308 orr r0, r1 08009012: 7598 strb r0, [r3, #0x16] 08009014: 8E21 ldrh r1, [r4, #0x30] 08009016: 4650 mov r0, r10 08009018: 4001 and r1, r0 0800901A: 0189 lsl r1, r1, #0x6 0800901C: 8ADA ldrh r2, [r3, #0x16] 0800901E: 484F ldr r0, =#0xFFFFFE3F 08009020: 4010 and r0, r2 08009022: 4308 orr r0, r1 08009024: 82D8 strh r0, [r3, #0x16] 08009026: 8E60 ldrh r0, [r4, #0x32] 08009028: 4651 mov r1, r10 0800902A: 4008 and r0, r1 0800902C: 0040 lsl r0, r0, #0x1 0800902E: 7DD9 ldrb r1, [r3, #0x17] 08009030: 220F mov r2, #0x0F 08009032: 4252 neg r2, r2 08009034: 400A and r2, r1 08009036: 4302 orr r2, r0 08009038: 75DA strb r2, [r3, #0x17] 0800903A: 8EA1 ldrh r1, [r4, #0x34] 0800903C: 4650 mov r0, r10 0800903E: 4001 and r1, r0 08009040: 0109 lsl r1, r1, #0x4 08009042: 2071 mov r0, #0x71 08009044: 4240 neg r0, r0 08009046: 4010 and r0, r2 08009048: 4308 orr r0, r1 0800904A: 75D8 strb r0, [r3, #0x17] 0800904C: 8EE2 ldrh r2, [r4, #0x36] 0800904E: 01D2 lsl r2, r2, #0x7 08009050: 217F mov r1, #0x7F 08009052: 4008 and r0, r1 08009054: 4310 orr r0, r2 08009056: 75D8 strb r0, [r3, #0x17] 08009058: 79F0 ldrb r0, [r6, #0x07] 0800905A: 4651 mov r1, r10 0800905C: 4008 and r0, r1 0800905E: 7E1A ldrb r2, [r3, #0x18] 08009060: 2108 mov r1, #0x08 08009062: 4249 neg r1, r1 08009064: 4011 and r1, r2 08009066: 4301 orr r1, r0 08009068: 7619 strb r1, [r3, #0x18] 0800906A: 7DA0 ldrb r0, [r4, #0x16] 0800906C: 464A mov r2, r9 0800906E: 4010 and r0, r2 08009070: 00C0 lsl r0, r0, #0x3 08009072: 2209 mov r2, #0x09 08009074: 4252 neg r2, r2 08009076: 400A and r2, r1 08009078: 4302 orr r2, r0 0800907A: 761A strb r2, [r3, #0x18] 0800907C: 78F1 ldrb r1, [r6, #0x03] 0800907E: 4648 mov r0, r9 08009080: 4001 and r1, r0 08009082: 0109 lsl r1, r1, #0x4 08009084: 2011 mov r0, #0x11 08009086: 4240 neg r0, r0 08009088: 4010 and r0, r2 0800908A: 4308 orr r0, r1 0800908C: 7618 strb r0, [r3, #0x18] 0800908E: 7972 ldrb r2, [r6, #0x05] 08009090: 4649 mov r1, r9 08009092: 400A and r2, r1 08009094: 0152 lsl r2, r2, #0x5 08009096: 2121 mov r1, #0x21 08009098: 4249 neg r1, r1 0800909A: 4008 and r0, r1 0800909C: 4310 orr r0, r2 0800909E: 7618 strb r0, [r3, #0x18] 080090A0: 8A60 ldrh r0, [r4, #0x12] 080090A2: 7758 strb r0, [r3, #0x1D] 080090A4: 8AA0 ldrh r0, [r4, #0x14] 080090A6: 7798 strb r0, [r3, #0x1E] 080090A8: 8CE2 ldrh r2, [r4, #0x26] 080090AA: 01D2 lsl r2, r2, #0x7 080090AC: 6998 ldr r0, [r3, #0x18] 080090AE: 492C ldr r1, =#0xFF80007F 080090B0: 4008 and r0, r1 080090B2: 4310 orr r0, r2 080090B4: 6198 str r0, [r3, #0x18] 080090B6: 7F61 ldrb r1, [r4, #0x1D] 080090B8: 464A mov r2, r9 080090BA: 4011 and r1, r2 080090BC: 0189 lsl r1, r1, #0x6 080090BE: 7E1A ldrb r2, [r3, #0x18] 080090C0: 2041 mov r0, #0x41 080090C2: 4240 neg r0, r0 080090C4: 4010 and r0, r2 080090C6: 4308 orr r0, r1 080090C8: 7618 strb r0, [r3, #0x18] 080090CA: 2000 mov r0, #0x00 080090CC: 77D8 strb r0, [r3, #0x1F] 080090CE: 4660 mov r0, r12 080090D0: 302C add r0, #0x2C 080090D2: 2100 mov r1, #0x00 080090D4: 7001 strb r1, [r0] 080090D6: 1C78 add r0, r7, #0x1 080090D8: 0400 lsl r0, r0, #0x10 080090DA: 0C07 lsr r7, r0, #0x10 080090DC: 365C add r6, #0x5C 080090DE: 345C add r4, #0x5C 080090E0: 3330 add r3, #0x30 080090E2: 2230 mov r2, #0x3 080090E4: 4494 add r12, r2 080090E6: 2F1F cmp r7, #0x1F 080090E8: D800 bhi 0x080090EC 080090EA: E707 b 0x08008EFC 080090EC: 23C0 mov r3, #0xC0 080090EE: 00DB lsl r3, r3, #0x3 080090F0: 18ED add r5, r5, r3 080090F2: 481C ldr r0, =#0x02007700 080090F4: 8800 ldrh r0, [r0] 080090F6: C501 stmia r5!, {r0} 080090F8: 1C29 add r1, r5, #0x0 080090FA: 2700 mov r7, #0x00 080090FC: 4B1A ldr r3, =#0x02029AF4 080090FE: 4A1B ldr r2, =#0x02007680 08009100: 00B8 lsl r0, r7, #0x2 08009102: 1880 add r0, r0, r2 08009104: 8800 ldrh r0, [r0] 08009106: 8008 strh r0, [r1] 08009108: 3102 add r1, #0x02 0800910A: 1C78 add r0, r7, #0x1 0800910C: 0400 lsl r0, r0, #0x10 0800910E: 0C07 lsr r7, r0, #0x10 08009110: 2F1F cmp r7, #0x1F 08009112: D9F5 bls 0x08009100 08009114: 3540 add r5, #0x40 08009116: 8818 ldrh r0, [r3] 08009118: C501 stmia r5!, {r0} 0800911A: 1C28 add r0, r5, #0x0 0800911C: BC38 pop {r3, r4, r5} 0800911E: 4698 mov r8, r3 08009120: 46A1 mov r9, r4 08009122: 46AA mov r10, r5 08009124: BCF0 pop {r4, r5, r6, r7} 08009126: BC02 pop {r1} 08009128: 4708 bx r1 ;0800912A: 0000 lsl r0, r0, #0x0 ;0800912C: 0340 lsl r0, r0, #0xD ;0800912E: 0200 lsl r0, r0, #0x8 ;08009130: 0108 lsl r0, r1, #0x4 ;08009132: 0200 lsl r0, r0, #0x8 ;08009134: 9CB0 ldr r4, [sp, #0x2C0] ;08009136: 0202 lsl r2, r0, #0x8 ;08009138: 96B0 str r6, [sp, #0x2C0] ;0800913A: 0200 lsl r0, r0, #0x8 ;0800913C: 8678 strh r0, [r7, #0x32] ;0800913E: 0200 lsl r0, r0, #0x8 ;08009140: 0360 lsl r0, r4, #0xD ;08009142: 0200 lsl r0, r0, #0x8 ;08009144: 0FFF lsr r7, r7, #0x1F ;08009146: 0000 lsl r0, r0, #0x0 ;08009148: F000 bl ;0800914A: FFFF bl 0x0800A14A ;0800914C: 03FF lsl r7, r7, #0xF ;0800914E: 0000 lsl r0, r0, #0x0 ;08009150: FC00 bl 0x08009952 ;08009152: FFFF bl 0x07C0A152 ;08009154: 03FF lsl r7, r7, #0xF ;08009156: FFF0 bl 0x08409138 ;08009158: 3FFF sub r7, #0xFF ;0800915A: FFFC bl 0x08009154 ;0800915C: FE3F bl 0x08005DDC ;0800915E: FFFF bl 0x07E4915E ;08009160: 007F lsl r7, r7, #0x1 ;08009162: FF80 bl 0x08089064 ;08009164: 7700 strb r0, [r0, #0x1C] ;08009166: 0200 lsl r0, r0, #0x8 ;08009168: 9AF4 ldr r2, [sp, #0x3D0] ;0800916A: 0202 lsl r2, r0, #0x8 ;0800916C: 7680 strb r0, [r0, #0x1A] ;0800916E: 0200 lsl r0, r0, #0x8
$0800E794 - Color "Scaler"
This calculates a fade-out effect
3C-3F r5 (subroutine above) 38-3B r5 (subroutine above) 34-37 r5 (subroutine above) 30-33 r4 2C-2F r5 28-2B r6 24-27 r7 20-23 Link Register 1C-1F r8 18-1B r9 14-17 r10 10-13 new 5 0C-0F new 4 08-0B new 3 04-07 new 2 00-03 new 1
At start: r0 = "where to load" address, gets stored in [sp] r1 = "where to store" address, gets stored in r5 r2 = "darkening factor", gets stored in r6 r3 = number of colors to do, gets stored [sp, #0x004]
[sp, #0x008] contains the counter of how many colors have already been edited
r4 contains the value out of [#0x03C] (halfword, 16 bits)
r7 contains the value out of [#0x038] (halfword, 16 bits)
r12 contains the value out of [#0x034] (halfword, 16 bits)
normally, r4, r7 and r12 are zero. Its the color to (or, from) which everything should fade, so if they are all zero, it's black
0800E794: B5F0 push {r4, r5, r6, r7, lr} 0800E796: 4657 mov r7, r10 0800E798: 464E mov r6, r9 0800E79A: 4645 mov r5, r8 0800E79C: B4E0 push {r5, r6, r7} ; Push r4, r5, r6, r7, Link Register, r8, r9, r10 0800E79E: B085 add sp, #-0x014 ; Add additional 20 bytes (5 stack entries) to stack pointer 0800E7A0: 9000 str r0, [sp] ; Add the address "where to work" in current stack pointer pointed register 0800E7A2: 1C0D add r5, r1, #0x0 ; r5 = r1 = Address where to store data 0800E7A4: 980D ldr r0, [sp, #0x034] 0800E7A6: 990E ldr r1, [sp, #0x038] 0800E7A8: 9C0F ldr r4, [sp, #0x03C] 0800E7AA: 0412 lsl r2, r2, #0x10 ; r2 contains "the darkening factor". 0800E7AC: 0C16 lsr r6, r2, #0x10 ; value gets kinda ANDed with #$0000FFFF and than stored in r6 0800E7AE: 041B lsl r3, r3, #0x10 ; r3 contains the number of colors to do 0800E7B0: 0C1B lsr r3, r3, #0x10 ; r3 gets kinda AND #$0000FFFF 0800E7B2: 9301 str r3, [sp, #0x004] ; Store r3 in [sp, #0x004] 0800E7B4: 0400 lsl r0, r0, #0x10 0800E7B6: 0C00 lsr r0, r0, #0x10 ; r0 = AND #$00FF 0800E7B8: 4684 mov r12, r0 ; r12 = r0 0800E7BA: 0409 lsl r1, r1, #0x10 ; From the old r1 value, r1 contains the lower bytes in the higher bytes 0800E7BC: 0C0F lsr r7, r1, #0x10 ; From the old r1 value, r7 contains the lower bytes, the higher bytes are =0 0800E7BE: 0424 lsl r4, r4, #0x10 0800E7C0: 0C24 lsr r4, r4, #0x10 ; r4 = AND #$00FF 0800E7C2: 2000 mov r0, #0x00 0800E7C4: 9002 str r0, [sp, #0x008] ; clear color counter 0800E7C6: 4298 cmp r0, r3 ; compare r0 = cleared counter with number of colors to do 0800E7C8: D300 bcc 0x0800E7CC ; branch if r3 is bigger (there are more than 0 colors to do) 0800E7CA: E08D b 0x0800E8E8 ; if not, EXIT 0800E7CC: 0430 lsl r0, r6, #0x10 0800E7CE: 1403 asr r3, r0, #0x10 ; r3 contains the darkening factor + AND #$0000FFFF 0800E7D0: 46E0 mov r8, r12 ; r8 := r12 0800E7D2: 4641 mov r1, r8 0800E7D4: 201F mov r0, #0x1F 0800E7D6: 4001 and r1, r0 0800E7D8: 4688 mov r8, r1 ; r8 := r12 + AND #0000001F 0800E7DA: 1C38 add r0, r7, #0x0 0800E7DC: 211F mov r1, #0x1F 0800E7DE: 4008 and r0, r1 0800E7E0: 0140 lsl r0, r0, #0x5 0800E7E2: 9003 str r0, [sp, #0x00C] ; [sp, #0x00C] := (r7 + AND #$0000001F) << 5 0800E7E4: 1C20 add r0, r4, #0x0 0800E7E6: 4008 and r0, r1 0800E7E8: 0080 lsl r0, r0, #0x2 0800E7EA: 9004 str r0, [sp, #0x010] ; [sp, #0x010] := (r4 + AND #$00000001F) << 2 0800E7EC: 207D mov r0, #0x7D ; r0 = #$0000007D 0800E7EE: 4240 neg r0, r0 ; r0 = #$FFFFFF83 = %....1111.1000.0011 0800E7F0: 4682 mov r10, r0 ; Repeat jumps here 0800E7F2: 9900 ldr r1, [sp] ; [sp] contains the address of the base color 0800E7F4: 6808 ldr r0, [r1] ; r0 = base color ; First: Compare lowest color segment ;? 0800E7F6: 06C2 lsl r2, r0, #0x1B ; r1 = r0 + AND #$001F 0800E7F8: 0ED1 lsr r1, r2, #0x1B ; Separate the lowest color segment 0800E7FA: 4681 mov r9, r0 ; Conservate base color in r9 0800E7FC: 4561 cmp r1, r12 ; Compare Color Segment with, eh, sumthin' 0800E7FE: D206 bcs 0x0800E80E ; Branch if r1 is greater ;? 0800E800: 1C08 add r0, r1, #0x0 0800E802: 18C0 add r0, r0, r3 0800E804: 4560 cmp r0, r12 0800E806: DA12 bge 0x0800E82E ;? 0800E808: 0ED0 lsr r0, r2, #0x1B 0800E80A: 1980 add r0, r0, r6 0800E80C: E007 b 0x0800E81E ; Second: Compare lowest color segment again ;? 0800E80E: 0ED0 lsr r0, r2, #0x1B ; r0 = color segment of the base color 0800E810: 4560 cmp r0, r12 0800E812: D90C bls 0x0800E82E ; branches if equal, passes if r0 is greater than r12 ;? 0800E814: 1AC0 sub r0, r0, r3 ; subtract the darkening factor from the base color segment ; r0 is negative if the color segment is smaller than the darkening factor 0800E816: 4560 cmp r0, r12 0800E818: DD09 ble 0x0800E82E ; branches if r0 is negative and r12 = 0 ; Store lowest color segment ; IF BASE COLOR SEGMENT is greater than darkening factor 0800E81A: 0ED0 lsr r0, r2, #0x1B ; r0 = base color segment 0800E81C: 1B80 sub r0, r0, r6 ; r0 = minus darkening factor 0800E81E: 211F mov r1, #0x1F ; r1 = AND mask 0800E820: 4008 and r0, r1 ; remove everything but the color segment 0800E822: 782A ldrb r2, [r5] 0800E824: 393F sub r1, #0x3F ; r1 = #$FFFFFFE0 = %....1111.1110.0000 0800E826: 4011 and r1, r2 0800E828: 4301 orr r1, r0 ; remove old color segment, store new one back 0800E82A: 7029 strb r1, [r5] ; store it 0800E82C: E006 b 0x0800E83C ; ? 0800E82E: 7829 ldrb r1, [r5] ; r1 = 0800E830: 2020 mov r0, #0x20 ; r0 = #$00000020 0800E832: 4240 neg r0, r0 ; r0 = #$FFFFFFE0 = %...1111.1110.0000 0800E834: 4008 and r0, r1 ; removes the lower five bits from r1. 0800E836: 4641 mov r1, r8 0800E838: 4308 orr r0, r1 0800E83A: 7028 strb r0, [r5] ; Calculate middle color segment 0800E83C: 4648 mov r0, r9 ; r9 contains the "100% color", the base color 0800E83E: 0581 lsl r1, r0, #0x16 0800E840: 0EC8 lsr r0, r1, #0x1B ; separates the middle color segment: "AND $00003E0" + >> 5 0800E842: 42B8 cmp r0, r7 0800E844: D205 bcs 0x0800E852 ; branches when equal, and if r0 is greater ;? 0800E846: 18C0 add r0, r0, r3 0800E848: 42B8 cmp r0, r7 0800E84A: DA15 bge 0x0800E878 0800E84C: 0EC8 lsr r0, r1, #0x1B 0800E84E: 1980 add r0, r0, r6 0800E850: E007 b 0x0800E862 ;? 0800E852: 0EC8 lsr r0, r1, #0x1B ; r0 = middle color segment 0800E854: 42B8 cmp r0, r7 0800E856: D90F bls 0x0800E878 ; branches when equal, passes if r0 is greater ;? 0800E858: 1AC0 sub r0, r0, r3 ; subtract the darkening factor from the base color middle segment ; r0 is negative if the color segment is smaller than the darkening factor 0800E85A: 42B8 cmp r0, r7 0800E85C: DD0C ble 0x0800E878 ; branches if r0 is negative and r7 is 0 0800E85E: 0EC8 lsr r0, r1, #0x1B ; Fitting in newly calculated middle color segment into result color value 0800E860: 1B80 sub r0, r0, r6 ; subtract "darkening factor" 0800E862: 211F mov r1, #0x1F ; AND mask 0800E864: 4008 and r0, r1 ; remove all bits that do not belong to the five color bits 0800E866: 0140 lsl r0, r0, #0x5 ; shift the color back in position 0800E868: 882A ldrh r2, [r5] ; load color as it is 0800E86A: 4902 ldr r1, =#0xFFFFFC1F ; load AND mask to remove the middle color value 0800E86C: 4011 and r1, r2 ; remove 0800E86E: 4301 orr r1, r0 ; add new color piece 0800E870: 8029 strh r1, [r5] ; store it 0800E872: E007 b 0x0800E884 ; Data ; 0800E874: FC1F bl 0x080160B4 ; 0800E876: FFFF bl 0x07C2E876 ; ? 0800E878: 8829 ldrh r1, [r5] 0800E87A: 4808 ldr r0, =#0xFFFFFC1F 0800E87C: 4008 and r0, r1 ; AND #$1111.1111.1111.1111.1111.1100.0001.1111 0800E87E: 9903 ldr r1, [sp, #0x00C] 0800E880: 4308 orr r0, r1 0800E882: 8028 strh r0, [r5] ; calculate new highest color segment 0800E884: 4648 mov r0, r9 ; load "base" color 0800E886: 0441 lsl r1, r0, #0x11 0800E888: 0EC8 lsr r0, r1, #0x1B ; separate highest color segment: $00007E00 0800E88A: 42A0 cmp r0, r4 0800E88C: D208 bcs 0x0800E8A0 ; branches when equal and r0 is greater ;? 0800E88E: 18C0 add r0, r0, r3 0800E890: 42A0 cmp r0, r4 0800E892: DA16 bge 0x0800E8C2 ; branches when equal ; ? 0800E894: 0EC8 lsr r0, r1, #0x1B 0800E896: 1980 add r0, r0, r6 0800E898: E00A b 0x0800E8B0 ; Data ; 0800E89A: 0000 lsl r0, r0, #0x0 ; 0800E89C: FC1F bl 0x0800F0DC ; 0800E89E: FFFF bl 0x07C2E89E ; ? 0800E8A0: 0EC8 lsr r0, r1, #0x1B ; restore the base color segment value 0800E8A2: 42A0 cmp r0, r4 0800E8A4: D90D bls 0x0800E8C2 ; passes if r0 is greater than r4 ; ? 0800E8A6: 1AC0 sub r0, r0, r3 ; subtract the darkening factor from the base color higher segment ; r0 is negative if the color segment is smaller than the darkening factor 0800E8A8: 42A0 cmp r0, r4 0800E8AA: DD0A ble 0x0800E8C2 ; branches if r0 is negative and r4 is empty ; Fitting in newly calculated high color segment into result color value 0800E8AC: 0EC8 lsr r0, r1, #0x1B ; restore the base color segment value 0800E8AE: 1B80 sub r0, r0, r6 ; subtract "darkening factor" 0800E8B0: 211F mov r1, #0x1F ; AND mask 0800E8B2: 4008 and r0, r1 ; separate the color bits 0800E8B4: 0080 lsl r0, r0, #0x2 ; shift back in the right position 0800E8B6: 786A ldrb r2, [r5, #0x01] ; load the high byte of the color 0800E8B8: 4651 mov r1, r10 ; Load AND mask in r1 0800E8BA: 4011 and r1, r2 ; Remove old five color segment bits from the color's high byte 0800E8BC: 4301 orr r1, r0 ; add new color segment 0800E8BE: 7069 strb r1, [r5, #0x01] ; Store back high byte 0800E8C0: E005 b 0x0800E8CE ; ? 0800E8C2: 7869 ldrb r1, [r5, #0x01] 0800E8C4: 4650 mov r0, r10 ; Load AND mask in r0 0800E8C6: 4008 and r0, r1 0800E8C8: 9904 ldr r1, [sp, #0x010] 0800E8CA: 4308 orr r0, r1 0800E8CC: 7068 strb r0, [r5, #0x01] ; Color done, should another one be done or should this be exited? 0800E8CE: 9802 ldr r0, [sp, #0x008] 0800E8D0: 3001 add r0, #0x01 ; Increase Colors-Done-Counter 0800E8D2: 0400 lsl r0, r0, #0x10 0800E8D4: 0C00 lsr r0, r0, #0x10 ; remove two high-bytes from Colors-Done-Counter 0800E8D6: 9002 str r0, [sp, #0x008] ; Store back Colors-Done-Counter 0800E8D8: 9800 ldr r0, [sp] ; Load address of next color-to-be-done 0800E8DA: 3002 add r0, #0x02 ; increment the address (address = 16 bit) 0800E8DC: 9000 str r0, [sp] ; store back 0800E8DE: 3502 add r5, #0x02 ; increment address in r5 (the same as right above) 0800E8E0: 9902 ldr r1, [sp, #0x008] 0800E8E2: 9801 ldr r0, [sp, #0x004] 0800E8E4: 4281 cmp r1, r0 ; all colors done? 0800E8E6: D384 bcc 0x0800E7F2 ; if not, branch ; Restore and Exit 0800E8E8: B005 add sp, #0x014 0800E8EA: BC38 pop {r3, r4, r5} 0800E8EC: 4698 mov r8, r3 0800E8EE: 46A1 mov r9, r4 0800E8F0: 46AA mov r10, r5 0800E8F2: BCF0 pop {r4, r5, r6, r7} 0800E8F4: BC01 pop {r0} 0800E8F6: 4700 bx r0
$0800EBE4 - ?
0800EBE4: B570 push {r4, r5, r6, lr} 0800EBE6: 1C04 add r4, r0, #0x0 ; r4 = Orig. r0 0800EBE8: 0409 lsl r1, r1, #0x10 0800EBEA: 0C09 lsr r1, r1, #0x10 ; r1 AND #$0000FFFF 0800EBEC: 0412 lsl r2, r2, #0x10 0800EBEE: 0C15 lsr r5, r2, #0x10 ; r5 = Orig. r2 AND #$0000FFFF 0800EBF0: 041B lsl r3, r3, #0x10 0800EBF2: 0C1E lsr r6, r3, #0x10 ; r6 = Orig. r3 AND #$0000FFFF 0800EBF4: 7D20 ldrb r0, [r4, #0x14] 0800EBF6: 4281 cmp r1, r0 0800EBF8: D21B bcs 0x0800EC32 0800EBFA: 2300 mov r3, #0x00 0800EBFC: 84E1 strh r1, [r4, #0x26] 0800EBFE: 6922 ldr r2, [r4, #0x10] 0800EC00: 1850 add r0, r2, r1 0800EC02: 7841 ldrb r1, [r0, #0x01] 0800EC04: 7880 ldrb r0, [r0, #0x02] 0800EC06: 1852 add r2, r2, r1 0800EC08: 1A40 sub r0, r0, r1 0800EC0A: 0FC1 lsr r1, r0, #0x1F 0800EC0C: 1840 add r0, r0, r1 0800EC0E: 1040 asr r0, r0, #0x1 0800EC10: 8520 strh r0, [r4, #0x28] 0800EC12: 62E2 str r2, [r4, #0x2C] 0800EC14: 8623 strh r3, [r4, #0x30] 0800EC16: 7810 ldrb r0, [r2] 0800EC18: 8660 strh r0, [r4, #0x32] 0800EC1A: 7850 ldrb r0, [r2, #0x01] 0800EC1C: 80A0 strh r0, [r4, #0x04] 0800EC1E: 1C20 add r0, r4, #0x0 0800EC20: 3037 add r0, #0x37 0800EC22: 7005 strb r5, [r0] 0800EC24: 3001 add r0, #0x01 0800EC26: 7006 strb r6, [r0] 0800EC28: 1C20 add r0, r4, #0x0 0800EC2A: F000 bl 0800EC2C: F807 bl 0x0800EC3C 0800EC2E: 2001 mov r0, #0x01 0800EC30: E000 b 0x0800EC34 0800EC32: 2000 mov r0, #0x00 0800EC34: BC70 pop {r4, r5, r6} 0800EC36: BC02 pop {r1} 0800EC38: 4708 bx r1 ;0800EC3A: 0000 lsl r0, r0, #0x0
$080142A0 - ?
This changes the following registers:
- $0001 = $02009D28, $02009D9C, $02009E10, $02009E84, $02009EF8, $02009F6C
- $00FF = $02009D2A, $02009D9E, $02009E12, $02009E86, $02009EFA, $02009F6E
- $FFFF = $0200A240, $0200A242, $0200A244, $0200A246, $0200A248, $0200A24A
080142A0: B5F0 push {r4, r5, r6, r7, lr} 080142A2: 2200 mov r2, #0x00 080142A4: 480E ldr r0, =#0x02009CD0 080142A6: 4684 mov r12, r0 080142A8: 2774 mov r7, #0x74 080142AA: 4E0E ldr r6, =#0x0200A240 080142AC: 2501 mov r5, #0x01 080142AE: 24FF mov r4, #0xFF 080142B0: 480D ldr r0, =#0x0000FFFF 080142B2: 1C03 add r3, r0, #0x0 080142B4: 1C10 add r0, r2, #0x0 ; Load Loop Counter in r0 080142B6: 4378 mul r0, r7 ; Multiply it with #$74 080142B8: 4460 add r0, r12 ; r0 = #$02009CD0 + Result of above 080142BA: 1C01 add r1, r0, #0x0 080142BC: 3158 add r1, #0x58 ; Add #$58 to that address 080142BE: 800D strh r5, [r1] ; Store #$01 there 080142C0: 305A add r0, #0x5A ; Add #$5A to the address 080142C2: 8004 strh r4, [r0] ; Store #$FF there 080142C4: 0051 lsl r1, r2, #0x1 080142C6: 1989 add r1, r1, r6 080142C8: 8808 ldrh r0, [r1] 080142CA: 4318 orr r0, r3 080142CC: 8008 strh r0, [r1] 080142CE: 1C50 add r0, r2, #0x1 ; Increment Loop Counter 080142D0: 0400 lsl r0, r0, #0x10 080142D2: 0C02 lsr r2, r0, #0x10 080142D4: 2A05 cmp r2, #0x05 080142D6: D9ED bls 0x080142B4 ; Loop until r2 reaches #$06 080142D8: BCF0 pop {r4, r5, r6, r7} 080142DA: BC01 pop {r0} 080142DC: 4700 bx r0 ;DATA ;============ ;080142DE: 0000 lsl r0, r0, #0x0 ;080142E0: 9CD0 ldr r4, [sp, #0x340] ;080142E2: 0200 lsl r0, r0, #0x8 ;080142E4: A240 add r2, =#0xF7F22101 ;080142E6: 0200 lsl r0, r0, #0x8 ;080142E8: FFFF bl 0x082152E8 ;080142EA: 0000 lsl r0, r0, #0x0
$0801C52C - Nintendo Logo
0801C52C: B500 push {lr} 0801C52E: F7FF bl 0801C530: FF7F bl 0x0801C430 ; Nintendo Logo Data Transfer 0801C532: F000 bl 0801C534: F807 bl 0x0801C544 ; Fade Nintendo Logo in and keep it on screen 0801C536: F000 bl 0801C538: F83D bl 0x0801C5B4 ; (Unnecessary) Transfer of the palette 0801C53A: F7FF bl 0801C53C: FFC5 bl 0x0801C4C8 ; Fade Nintendo Logo out 0801C53E: BC01 pop {r0} 0801C540: 4700 bx r0
$0801C544 - Fade Nintendo Logo in and keep it on screen
0801C544: B530 push {r4, r5, lr} 0801C546: B08B add sp, #-0x02C ; adds eleven new entries to stack ; the last three are for other values, ; the first eight are for a palette 0801C548: 241F mov r4, #0x1F ; Counter for the coming loop 0801C54A: 2500 mov r5, #0x00 ; --- ; Fade out loop 0801C54C: 0420 lsl r0, r4, #0x10 0801C54E: 1404 asr r4, r0, #0x10 ; Remove both upper bytes AND #$0000FFFF 0801C550: 9500 str r5, [sp] 0801C552: 9501 str r5, [sp, #0x004] 0801C554: 9502 str r5, [sp, #0x008] 0801C556: 4816 ldr r0, =#0x08625E0C ; Address of the base colors 0801C558: A903 add r1, sp, #0x00C ; "Where to store" address 0801C55A: 1C22 add r2, r4, #0x0 ; darkening factor = r4, the counter for this loop 0801C55C: 2310 mov r3, #0x10 ; Number of colors to do 0801C55E: F7F2 bl 0801C560: F919 bl 0x0800E794 ; Color "Scaler" 0801C562: A803 add r0, sp, #0x00C 0801C564: 21A0 mov r1, #0xA0 0801C566: 04C9 lsl r1, r1, #0x13 ; r1 = #$05000000 0801C568: 2210 mov r2, #0x10 ; r2 = #$00000010 0801C56A: F0A3 bl 0801C56C: FA1B bl 0x080BF9A4 ; SWI cpuset 0801C56E: F000 bl 0801C570: FA3B bl 0x0801C9E8 ; Button stuff 0801C572: 0400 lsl r0, r0, #0x10 ; r0 = 1 if A or START is pushed, else r0 = 0 0801C574: 2800 cmp r0, #0x00 0801C576: D117 bne 0x0801C5A8 ; branch to the exit if A or START is pushed. 0801C578: F000 bl ; EXECUTED TWICE, TWO FRAMES PER COLOR SET 0801C57A: FA36 bl 0x0801C9E8 ; Button stuff 0801C57C: 0400 lsl r0, r0, #0x10 ; r0 = 1 if A or START is pushed, else r0 = 0 0801C57E: 2800 cmp r0, #0x00 0801C580: D112 bne 0x0801C5A8 ; branch to the exit if A or START is pushed. 0801C582: 1E60 sub r0, r4, #0x1 ; Decrement r4 0801C584: 0400 lsl r0, r0, #0x10 0801C586: 0C04 lsr r4, r0, #0x10 0801C588: 2800 cmp r0, #0x00 0801C58A: DADF bge 0x0801C54C ; Fade in Nintendo Logo ; --- 0801C58C: 2400 mov r4, #0x00 ; clear counter ; --- ; Loop 0801C58E: F000 bl 0801C590: FA2B bl 0x0801C9E8 0801C592: 0400 lsl r0, r0, #0x10 ; r0 = 1 if A or START is pushed, else r0 = 0 0801C594: 2800 cmp r0, #0x00 0801C596: D107 bne 0x0801C5A8 ; branch to the exit if A or START is pushed. 0801C598: 0420 lsl r0, r4, #0x10 0801C59A: 2180 mov r1, #0x80 0801C59C: 0249 lsl r1, r1, #0x9 ; r1 = #$00010000 0801C59E: 1840 add r0, r0, r1 0801C5A0: 0C04 lsr r4, r0, #0x10 0801C5A2: 1400 asr r0, r0, #0x10 0801C5A4: 2877 cmp r0, #0x77 0801C5A6: DDF2 ble 0x0801C58E ; Loop end ; --- 0801C5A8: B00B add sp, #0x02C 0801C5AA: BC30 pop {r4, r5} 0801C5AC: BC01 pop {r0} 0801C5AE: 4700 bx r0 ; 0801C5B0: 5E0C ldsh r4, [r1, r0] ; 0801C5B2: 0862 lsr r2, r4, #0x1
$0801C5B4 - Transfer Nintendo Logo Color Palette
0801C5B4: B500 push {lr} 0801C5B6: 4804 ldr r0, =#0x08625E0C ; r0 = $08625E0C 0801C5B8: 21A0 mov r1, #0xA0 0801C5BA: 04C9 lsl r1, r1, #0x13 ; r1 = $05000000 0801C5BC: 2210 mov r2, #0x10 ; r2 = $00000010 0801C5BE: F0A3 bl 0801C5C0: F9F1 bl 0x080BF9A4 ; swi CpuSet 0801C5C2: BC01 pop {r0} 0801C5C4: 4700 bx r0 ; DATA ; 0801C5C6: 0000 lsl r0, r0, #0x0 ; 0801C5C8: 5E0C ldsh r4, [r1, r0] ; 0801C5CA: 0862 lsr r2, r4, #0x1
$0801C5CC - Transfer Brownie Brown Logo Data
0801C5CC: B570 push {r4, r5, r6, lr} 0801C5CE: B084 add sp, #-0x010 0801C5D0: F7E5 bl 0801C5D2: F802 bl 0x080015D8 ; Collect button Data 0801C5D4: 2180 mov r1, #0x80 0801C5D6: 04C9 lsl r1, r1, #0x13 ; r1 = #$04000000 0801C5D8: 2286 mov r2, #0x86 0801C5DA: 0112 lsl r2, r2, #0x4 ; r2 = #$00000860 = #%... 0000.1000.0110.0000 0801C5DC: 1C10 add r0, r2, #0x0 0801C5DE: 8008 strh r0, [r1] ; Store #$0860 into #$04000000/1 ; Allow Access to OAM during H-Blank ; OBJ Character VRAM Mapping: One dimensional ; Screen Display BG3: on 0801C5E0: 310E add r1, #0x0E ; r1 = #$0400000E 0801C5E2: 4A30 ldr r2, =#0x0000030B ; r2 = #$0000030B = #%... 0000.0011.0000.1011 0801C5E4: 1C10 add r0, r2, #0x0 0801C5E6: 8008 strh r0, [r1] ; Store #$030B into #$0400000E/F ; BG3 on lowest priority = BG3 is the BG ; Character Base Block = %10 (BG3 Tiles at $06008000) ; Screen Base block = %0011 (BG3 Map at $06001800) 0801C5E8: 3906 sub r1, #0x06 ; r1 = #$04000008 0801C5EA: 2008 mov r0, #0x08 ; r0 = #$00000008 = #%... 0000.1000 0801C5EC: 8008 strh r0, [r1] ; Store #$0008 into #$04000008/9 ; BG0 on lowest priority = BG0 is the Brownie Brown Logo ; Character Base Block = %10 (BG0 Tiles at $06008000) ; Screen Base Block = %0000 (BG0 Map at $06000000) 0801C5EE: 2100 mov r1, #0x00 0801C5F0: 4D2D ldr r5, =#0x04000010 ; BG 0 X-Offset 0801C5F2: 2300 mov r3, #0x00 0801C5F4: 4C2D ldr r4, =#0x04000012 ; BG 0 Y-Offset ;---- ; Some loop to clear registers 0801C5F6: 0408 lsl r0, r1, #0x10 0801C5F8: 1400 asr r0, r0, #0x10 0801C5FA: 0082 lsl r2, r0, #0x2 ; clear registers 0801C5FC: 1951 add r1, r2, r5 0801C5FE: 800B strh r3, [r1] ; store #$0000 into $04000010 (BG1 control) ; in the other runs of this loop, it clears: ; $04000014 - BG1 X-Offset ; $04000018 - BG2 X-Offset ; $0400001C - BG3 X-Offset 0801C600: 1912 add r2, r2, r4 0801C602: 8013 strh r3, [r2] ; store #$0000 into $04000012 (BG2 control) ; in the other runs of this loop, it clears: ; $04000016 - BG1 Y-Offset ; $0400001A - BG2 Y-Offset ; $0400001E - BG3 Y-Offset 0801C604: 3001 add r0, #0x01 0801C606: 0400 lsl r0, r0, #0x10 0801C608: 0C01 lsr r1, r0, #0x10 0801C60A: 1400 asr r0, r0, #0x10 0801C60C: 2803 cmp r0, #0x03 0801C60E: DDF2 ble 0x0801C5F6 ;---- 0801C610: 4827 ldr r0, =#0x04000050 0801C612: 2100 mov r1, #0x00 0801C614: 8001 strh r1, [r0] ; store #$0000 into $04000050/1 : Turn off special effects 0801C616: 3002 add r0, #0x02 0801C618: 8001 strh r1, [r0] ; store #$0000 into $04000052/3 : Turn off Alpha blending coefficients 0801C61A: 4A26 ldr r2, =#0x04000054 0801C61C: 201F mov r0, #0x1F 0801C61E: 8010 strh r0, [r2] ; store #$001F into $04000054/5 : Turn highest screen brightness on 0801C620: A803 add r0, sp, #0x00C 0801C622: 8001 strh r1, [r0] ; I expect this to be an empty space 0801C624: 21A0 mov r1, #0xA0 0801C626: 04C9 lsl r1, r1, #0x13 ; transfer to $05000000 = Palette 0801C628: 4A23 ldr r2, =#0x01000010 ; transfer 10 bytes, fixed transfer 0801C62A: F0A3 bl 0801C62C: F9BB bl 0x080BF9A4 ; swi CPUset 0801C62E: 4823 ldr r0, =#0x086242AC ; Brownie-Brown-Logo and BG 0801C630: 4923 ldr r1, =#0x06008000 ; where to store address: VRAM 0801C632: 22C2 mov r2, #0xC2 0801C634: 00D2 lsl r2, r2, #0x3 ; r2 = $00000610 0801C636: F0A3 bl 0801C638: F9B5 bl 0x080BF9A4 ; swi CPUset 0801C63A: F7E9 bl 0801C63C: FE27 bl 0x0800628C ; Clear two Registers for this Sprite Automatic 0801C63E: 2100 mov r1, #0x00 0801C640: 2604 mov r6, #0x04 ; r6 = #$00000004 ; --- ; Outer Loop: 0801C642: 2000 mov r0, #0x00 0801C644: 040D lsl r5, r1, #0x10 ; r5 = #$00000000 ; --- ; Inner Loop: ; this loop is run 8 times ; always makes a 4x4 BG map square, the tile numbers are (first line) $01-$04, (second line) $05-08 ; First loop run: $01 is written in $06001800 ; Second loop run: $01 is written in $06001808 ; Third loop run: $01 is written in $06001810 0801C646: 0404 lsl r4, r0, #0x10 ; r4 = #$00000000 0801C648: 0C23 lsr r3, r4, #0x10 ; r3 = #$00000000 0801C64A: 0C28 lsr r0, r5, #0x10 0801C64C: 9000 str r0, [sp] ; [sp] = #$00000000 0801C64E: 9601 str r6, [sp, #0x004] ; [sp, #0x004] = #$00000004 0801C650: 9602 str r6, [sp, #0x008] ; [sp, #0x008] = #$00000004 0801C652: 481C ldr r0, =#0x06001800 ; r0 = #$06001800 0801C654: 491C ldr r1, =#0x0000FFFF ; r1 = #$0000FFFF 0801C656: 2201 mov r2, #0x01 ; r2 = #$00000001 0801C658: F000 bl 0801C65A: F92C bl 0x0801C8B4 ; rectangle BG mapper ; makes a 4x4 square, starting at 06001800 0801C65C: 2080 mov r0, #0x80 0801C65E: 02C0 lsl r0, r0, #0xB ; r0 = #$00040000 0801C660: 1824 add r4, r4, r0 ; increment Inner Loop counter 0801C662: 0C20 lsr r0, r4, #0x10 0801C664: 1424 asr r4, r4, #0x10 0801C666: 2C1F cmp r4, #0x1F 0801C668: DDED ble 0x0801C646 ; End if Inner Loop ; --- 0801C66A: 2180 mov r1, #0x80 0801C66C: 02C9 lsl r1, r1, #0xB 0801C66E: 1868 add r0, r5, r1 0801C670: 0C01 lsr r1, r0, #0x10 0801C672: 1400 asr r0, r0, #0x10 0801C674: 281F cmp r0, #0x1F 0801C676: DDE4 ble 0x0801C642 ; Inner loop writes one line of the BG map, the outer loop shifts the line for the inner loop ; --- 0801C678: 20C0 mov r0, #0xC0 0801C67A: 04C0 lsl r0, r0, #0x13 ; r0 = #$06000000 0801C67C: 210C mov r1, #0x0C 0801C67E: 9100 str r1, [sp] ; [sp] = #$0000000C 0801C680: 2114 mov r1, #0x14 0801C682: 9101 str r1, [sp, #0x004] ; [sp, #0x004] = #$00000014 0801C684: 2104 mov r1, #0x04 0801C686: 9102 str r1, [sp, #0x008] ; [sp, #0x008] = #$00000004 0801C688: 2100 mov r1, #0x00 ; r1 = #$00000000 0801C68A: 2211 mov r2, #0x11 ; r2 = #$00000011 0801C68C: 2305 mov r3, #0x05 ; r3 = #$00000005 0801C68E: F000 bl 0801C690: F911 bl 0x0801C8B4 ; rectangle BG mapper ; counting from #$11 (r2) on, 4 (sp, 8) lines, 14 (sp, 4) tiles long, starting in row 5 (r3), column C (sp). 0801C692: F7E9 bl 0801C694: FE05 bl 0x080062A0 ; Sprite enable/disable 0801C696: F000 bl 0801C698: F969 bl 0x0801C96C ; Enable VBLANK 0801C69A: B004 add sp, #0x010 0801C69C: BC70 pop {r4, r5, r6} 0801C69E: BC01 pop {r0} 0801C6A0: 4700 bx r0
$0801C6CC - Fade Brownie Brown Logo out
0801C6CC: B530 push {r4, r5, lr} 0801C6CE: 4C19 ldr r4, =#0xFFFFFDF0 0801C6D0: 44A5 add sp, r4 0801C6D2: 2400 mov r4, #0x00 0801C6D4: 2500 mov r5, #0x00 ;BEGIN LOOP 0801C6D6: 0422 lsl r2, r4, #0x10 0801C6D8: 1412 asr r2, r2, #0x10 0801C6DA: 9500 str r5, [sp] 0801C6DC: 9501 str r5, [sp, #0x004] 0801C6DE: 9502 str r5, [sp, #0x008] 0801C6E0: 4815 ldr r0, =#0x08624ECC ; r0 = Source Address for Palette 0801C6E2: A903 add r1, sp, #0x00C 0801C6E4: 2310 mov r3, #0x10 0801C6E6: F7F2 bl 0801C6E8: F855 bl 0x0800E794 ; Color "Scaler" 0801C6EA: A803 add r0, sp, #0x00C 0801C6EC: 21A0 mov r1, #0xA0 0801C6EE: 04C9 lsl r1, r1, #0x13 0801C6F0: 2210 mov r2, #0x10 0801C6F2: F0A3 bl 0801C6F4: F957 bl 0x080BF9A4 ; SWI CpuCet 0801C6F6: F000 bl 0801C6F8: F98B bl 0x0801CA10 ; Some-kind-of-Reset, r0, r2, button data 0801C6FA: F7E9 bl 0801C6FC: FDD1 bl 0x080062A0 ; Enable/Disable Sprites 0801C6FE: F000 bl 0801C700: F987 bl 0x0801CA10 ; Some-kind-of-Reset, r0, r2, button data 0801C702: F7E9 bl 0801C704: FDCD bl 0x080062A0 ; Enable/Disable Sprites 0801C706: 1C60 add r0, r4, #0x1 0801C708: 0400 lsl r0, r0, #0x10 0801C70A: 0C04 lsr r4, r0, #0x10 ; Increment counter 0801C70C: 2C1F cmp r4, #0x1F 0801C70E: D9E2 bls 0x0801C6D6 0801C710: 2080 mov r0, #0x80 0801C712: 04C0 lsl r0, r0, #0x13 ; $4000000 0801C714: 2100 mov r1, #0x00 0801C716: 8001 strh r1, [r0] 0801C718: A883 add r0, sp, #0x20C 0801C71A: 8001 strh r1, [r0] 0801C71C: 21A0 mov r1, #0xA0 0801C71E: 04C9 lsl r1, r1, #0x13 0801C720: 4A06 ldr r2, =#0x01000010 0801C722: F0A3 bl 0801C724: F93F bl 0x080BF9A4 ; swi cpuset 0801C726: 2384 mov r3, #0x84 0801C728: 009B lsl r3, r3, #0x2 0801C72A: 449D add sp, r3 0801C72C: BC30 pop {r4, r5} 0801C72E: BC01 pop {r0} 0801C730: 4700 bx r0 ;0801C732: 0000 lsl r0, r0, #0x0 ;0801C734: FDF0 bl 0x0801D316 ;0801C736: FFFF bl 0x07E0D736 ;0801C738: 4ECC ldr r6, =#0x28018818 ;0801C73A: 0862 lsr r2, r4, #0x1 ;0801C73C: 0010 lsl r0, r2, #0x0 ;0801C73E: 0100 lsl r0, r0, #0x4
$0801C740 - Brownie Brown Logo
0801C740: B500 push {lr} 0801C742: F7FF bl 0801C744: FF43 bl 0x0801C5CC ; Transfer Brownie Brown Logo Data 0801C746: F000 bl 0801C748: F807 bl 0x0801C758 ; Fade Brownie Brown Logo in and keep it on Screen 0801C74A: F000 bl 0801C74C: F875 bl 0x0801C838 ; Transfer Brownie Brown Logo Color Palette (again) 0801C74E: F7FF bl 0801C750: FFBD bl 0x0801C6CC ; Fade Brownie Brown Logo Out 0801C752: BC01 pop {r0} 0801C754: 4700 bx r0
$0801C758 - Fade Brownie Brown Logo in and keep it on Screen
0801C758: B530 push {r4, r5, lr} 0801C75A: B08B add sp, #-0x02C 0801C75C: 241F mov r4, #0x1F 0801C75E: 2500 mov r5, #0x00 0801C760: 0420 lsl r0, r4, #0x10 ; (Begin of loop) 0801C762: 1404 asr r4, r0, #0x10 ; cleared upper two bytes of r4 0801C764: 9500 str r5, [sp] 0801C766: 9501 str r5, [sp, #0x004] 0801C768: 9502 str r5, [sp, #0x008] 0801C76A: 482F ldr r0, =#0x08624ECC ; "where to load" address 0801C76C: A903 add r1, sp, #0x00C ; "where to store" address 0801C76E: 1C22 add r2, r4, #0x0 ; "darkening factor" = loop counter value (darkening factor gets lower = colors become brighter) 0801C770: 2310 mov r3, #0x10 ; number of colors to do 0801C772: F7F2 bl 0801C774: F80F bl 0x0800E794 ; Color Scaler 0801C776: A803 add r0, sp, #0x00C 0801C778: 21A0 mov r1, #0xA0 0801C77A: 04C9 lsl r1, r1, #0x13 ; r1 = #$05000000 0801C77C: 2210 mov r2, #0x10 ; r2 = #$00000010 0801C77E: F0A3 bl 0801C780: F911 bl 0x080BF9A4 ; SWI CpuSet (Transfers Colors from TEMP into $05000000) 0801C782: F000 bl 0801C784: F8DF bl 0x0801C944 ; Some-kind-of-reset, r0, r2, button data 0801C786: 0400 lsl r0, r0, #0x10 0801C788: 2800 cmp r0, #0x00 0801C78A: D149 bne 0x0801C820 ; Branch if A or Start was pushed 0801C78C: F000 bl 0801C78E: F8DA bl 0x0801C944 ; Some-kind-of-reset, r0, r2, button data 0801C790: 0400 lsl r0, r0, #0x10 ; EXECUTED TWICE, TWO FRAMES PER COLOR SET 0801C792: 0C03 lsr r3, r0, #0x10 0801C794: 2B00 cmp r3, #0x00 0801C796: D143 bne 0x0801C820 ; Branch if A or Start was pushed 0801C798: 1E60 sub r0, r4, #0x1 ; decrement counter (r4) 0801C79A: 0400 lsl r0, r0, #0x10 0801C79C: 0C04 lsr r4, r0, #0x10 0801C79E: 2800 cmp r0, #0x00 ; has the counter gone under 0? 0801C7A0: DADE bge 0x0801C760 ; If not yet, branch (loop) 0801C7A2: 2280 mov r2, #0x80 ; TURN ON BG0 AND OBJ 0801C7A4: 04D2 lsl r2, r2, #0x13 ; 04000000 0801C7A6: 8810 ldrh r0, [r2] ; load BG Mode 'n stuff 0801C7A8: 2484 mov r4, #0x84 0801C7AA: 01A4 lsl r4, r4, #0x6 ; r4 = #$00002100 0801C7AC: 1C21 add r1, r4, #0x0 0801C7AE: 4308 orr r0, r1 ; OR it (Turns BG0 and OBJ on) 0801C7B0: 8010 strh r0, [r2] ; store back 0801C7B2: 491E ldr r1, =#0x04000040 ; ACTIVATE WINDOW 0801C7B4: 20EF mov r0, #0xEF 0801C7B6: 8008 strh r0, [r1] ; Window X coordinates: $00-$EF 0801C7B8: 3104 add r1, #0x04 0801C7BA: 2060 mov r0, #0x60 0801C7BC: 8008 strh r0, [r1] ; Window Y coordinates: $00-$60 0801C7BE: 3104 add r1, #0x04 0801C7C0: 2009 mov r0, #0x09 0801C7C2: 8008 strh r0, [r1] ; Enable BG0 and OBJ inside of the Window 0801C7C4: 3102 add r1, #0x02 0801C7C6: 2008 mov r0, #0x08 0801C7C8: 8008 strh r0, [r1] ; Enable BG3 outside of the Window 0801C7CA: 4819 ldr r0, =#0x04000050 0801C7CC: 8003 strh r3, [r0] ; Clears BLDCNT - Color Special Effects Selection 0801C7CE: 3002 add r0, #0x02 ; r3 is empty; r3 contains the pushed button data, and this is not executed if r3 isn't 0 0801C7D0: 8003 strh r3, [r0] ; Clears BLDALPHA - Alpha Blending Coefficients 0801C7D2: 3002 add r0, #0x02 0801C7D4: 8003 strh r3, [r0] ; Clears BLDY - Brightness (Fade-In/Out) Coefficient 0801C7D6: 2400 mov r4, #0x00 0801C7D8: 4816 ldr r0, =#0x04000012 ; BEGIN OF LOOP 0801C7DA: 8004 strh r4, [r0] ; BG0VOFS 0801C7DC: F000 bl 0801C7DE: F8B2 bl 0x0801C944 ; Some-kind-of-reset, r0, r2, button data 0801C7E0: 0400 lsl r0, r0, #0x10 0801C7E2: 2800 cmp r0, #0x00 0801C7E4: D11C bne 0x0801C820 ; Branch if A or Start was pushed 0801C7E6: F000 bl 0801C7E8: F8AD bl 0x0801C944 ; Some-kind-of-reset, r0, r2, button data 0801C7EA: 0400 lsl r0, r0, #0x10 ; EXECUTED TWICE, TWO FRAMES PER COLOR SET 0801C7EC: 2800 cmp r0, #0x00 0801C7EE: D117 bne 0x0801C820 ; Branch if A or Start was pushed 0801C7F0: 0420 lsl r0, r4, #0x10 ; r0 = r4 * #$10000 0801C7F2: 2180 mov r1, #0x80 0801C7F4: 0249 lsl r1, r1, #0x9 ; r1 = #$10000 0801C7F6: 1840 add r0, r0, r1 ; "increment" r0 0801C7F8: 0C04 lsr r4, r0, #0x10 0801C7FA: 1400 asr r0, r0, #0x10 0801C7FC: 2820 cmp r0, #0x20 0801C7FE: DDEB ble 0x0801C7D8 ; loop as long as r0/r4 isn't greater than #$20 0801C800: 2400 mov r4, #0x00 0801C802: F000 bl 0801C804: F89F bl 0x0801C944 ; Some-kind-of-reset, r0, r2, button data 0801C806: 0400 lsl r0, r0, #0x10 0801C808: 2800 cmp r0, #0x00 0801C80A: D109 bne 0x0801C820 ; Branch if A or Start was pushed 0801C80C: F7E9 bl 0801C80E: FD48 bl 0x080062A0 ; Enable / Disable Sprites 0801C810: 0420 lsl r0, r4, #0x10 ; r0 = r4 * #$10000 0801C812: 2480 mov r4, #0x80 0801C814: 0264 lsl r4, r4, #0x9 ; r4 = #$10000 0801C816: 1900 add r0, r0, r4 ; "Increment" r0 0801C818: 0C04 lsr r4, r0, #0x10 ; r4 = r0 : #$10000 0801C81A: 1400 asr r0, r0, #0x10 ; r0 : #$10000 0801C81C: 2877 cmp r0, #0x77 0801C81E: DDF0 ble 0x0801C802 ; loop as long as r0/r4 isn't greater than #$77 0801C820: B00B add sp, #0x02C 0801C822: BC30 pop {r4, r5} 0801C824: BC01 pop {r0} 0801C826: 4700 bx r0
$0801C838 - Transfer Brownie Brown Logo Color Palette
0801C838: B570 push {r4, r5, r6, lr} 0801C83A: 4918 ldr r1, =#0x0400000E 0801C83C: 4A18 ldr r2, =#0x0000030B 0801C83E: 1C10 add r0, r2, #0x0 0801C840: 8008 strh r0, [r1] ; Store #$030B into #$0400000E/F ; BG3 on lowest priority = BG3 is the BG ; Character Base Block = %10 (BG3 Tiles at $06008000) ; Screen Base block = %0011 (BG3 Map at $06001800) 0801C842: 3906 sub r1, #0x06 0801C844: 2008 mov r0, #0x08 0801C846: 8008 strh r0, [r1] ; Store #$0008 into #$04000008/9 ; BG0 on lowest priority = BG0 is the Brownie Brown Logo ; Character Base Block = %10 (BG0 Tiles at $06008000) ; Screen Base Block = %0000 (BG0 Map at $06000000) 0801C848: 2201 mov r2, #0x01 0801C84A: 4E16 ldr r6, =#0x08624ECC 0801C84C: 4D16 ldr r5, =#0x04000010 ; BG 0 X-Offset 0801C84E: 2300 mov r3, #0x00 0801C850: 4C16 ldr r4, =#0x04000012 ; BG 0 Y-Offset ; Clear BG X/Y-Offsets with a loop 0801C852: 0091 lsl r1, r2, #0x2 0801C854: 1948 add r0, r1, r5 0801C856: 8003 strh r3, [r0] 0801C858: 1909 add r1, r1, r4 0801C85A: 800B strh r3, [r1] 0801C85C: 1C50 add r0, r2, #0x1 0801C85E: 0400 lsl r0, r0, #0x10 0801C860: 0C02 lsr r2, r0, #0x10 0801C862: 2A03 cmp r2, #0x03 0801C864: D9F5 bls 0x0801C852 0801C866: 4810 ldr r0, =#0x04000010 ; BG0 X-Offset 0801C868: 2100 mov r1, #0x00 0801C86A: 8001 strh r1, [r0] ; Clear BG0 X-Offset 0801C86C: 4A0F ldr r2, =#0x04000012 ; BG0 Y-Offset 0801C86E: 2020 mov r0, #0x20 0801C870: 8010 strh r0, [r2] ; Clear BG0 Y-Offset 0801C872: 480F ldr r0, =#0x04000050 0801C874: 8001 strh r1, [r0] ; Clear Special Effects 0801C876: 3002 add r0, #0x02 0801C878: 8001 strh r1, [r0] ; Clear Alpha Blending Coefficients 0801C87A: 3002 add r0, #0x02 0801C87C: 8001 strh r1, [r0] ; Clear Brightness Coefficient ; Transfer BrownieBrown Palette 0801C87E: 21A0 mov r1, #0xA0 0801C880: 04C9 lsl r1, r1, #0x13 ; $5000000 0801C882: 1C30 add r0, r6, #0x0 0801C884: 2210 mov r2, #0x10 0801C886: F0A3 bl 0801C888: F88D bl 0x080BF9A4 ; Swi CpuSet 0801C88A: 2180 mov r1, #0x80 0801C88C: 04C9 lsl r1, r1, #0x13 ; $4000000 0801C88E: 2296 mov r2, #0x96 0801C890: 0112 lsl r2, r2, #0x4 ; $0960 = %0000.1001.0110.0000 0801C892: 1C10 add r0, r2, #0x0 0801C894: 8008 strh r0, [r1] 0801C896: BC70 pop {r4, r5, r6} 0801C898: BC01 pop {r0} 0801C89A: 4700 bx r0 ; DATA ; 0801C89C: 000E lsl r6, r1, #0x0 ; 0801C89E: 0400 lsl r0, r0, #0x10 ; 0801C8A0: 030B lsl r3, r1, #0xC ; 0801C8A2: 0000 lsl r0, r0, #0x0 ; 0801C8A4: 4ECC ldr r6, =#0x29004001 ; 0801C8A6: 0862 lsr r2, r4, #0x1 ; 0801C8A8: 0010 lsl r0, r2, #0x0 ; 0801C8AA: 0400 lsl r0, r0, #0x10 ; 0801C8AC: 0012 lsl r2, r2, #0x0 ; 0801C8AE: 0400 lsl r0, r0, #0x10 ; 0801C8B0: 0050 lsl r0, r2, #0x1 ; 0801C8B2: 0400 lsl r0, r0, #0x10
$0801C8B4 - Rectangle BG mapper
THIS SUBROUTINE can set a certain space to one value (this feature is optional) and can set a rectangle shaped field in this place. Something like this:
$0A, $0A, $0A, $0A, $0A $0A, $20, $21, $22, $0A $0A, $23, $24, $25, $0A $0A, $0A, $0A, $0A, $0A
The length and the number of lines is set on the stack. I think the value that's the starting value for the increment (I mean, in my example, $20) gets transfered into this subroutine, too
1C-1F r4 18-1B r5 14-17 r6 10-13 r7 0C-0F Link Register 08-0B r8 04-07 r9 00-03 new entry
r0 contains a destination address for a "swi CpuSet" r1 contains a half-word-value that gets fixed-transfered --- the one value that fills the space r2 contains the value the upcounting should begin with (half-word size!)
0801C8B4: B5F0 push {r4, r5, r6, r7, lr} 0801C8B6: 464F mov r7, r9 0801C8B8: 4646 mov r6, r8 0801C8BA: B4C0 push {r6, r7} 0801C8BC: B081 add sp, #-0x004 0801C8BE: 1C07 add r7, r0, #0x0 0801C8C0: 9808 ldr r0, [sp, #0x020] ; Loads the last thing that was pushed on the stack *before* this starts 0801C8C2: 9C09 ldr r4, [sp, #0x024] ; Loads the second last thing that was pushed on the stack *before* this starts 0801C8C4: 9D0A ldr r5, [sp, #0x028] ; Loads the third last thing that was pushed on the stack *before* this starts 0801C8C6: 0409 lsl r1, r1, #0x10 0801C8C8: 0C09 lsr r1, r1, #0x10 ; Remove upper half of r1 value 0801C8CA: 0412 lsl r2, r2, #0x10 0801C8CC: 0C16 lsr r6, r2, #0x10 ; Remove upper half of r2 value and store it in r6 0801C8CE: 041B lsl r3, r3, #0x10 0801C8D0: 0C1B lsr r3, r3, #0x10 ; Remove upper half of r3 value 0801C8D2: 4699 mov r9, r3 ; Store that r3 value in r9 0801C8D4: 0400 lsl r0, r0, #0x10 0801C8D6: 0C00 lsr r0, r0, #0x10 ; Remove upper half of r0 value 0801C8D8: 4680 mov r8, r0 ; Store that r0 value in r8 0801C8DA: 0424 lsl r4, r4, #0x10 0801C8DC: 0C24 lsr r4, r4, #0x10 ; Remove upper half of r4 value 0801C8DE: 042D lsl r5, r5, #0x10 0801C8E0: 0C2D lsr r5, r5, #0x10 ; Remove upper half of r5 value 0801C8E2: 4816 ldr r0, =#0x0000FFFF 0801C8E4: 4281 cmp r1, r0 ; No transfer if r1 = #$0000FFFF 0801C8E6: D005 beq 0x0801C8F4 ; This Swi CpuSet does a fixed transfer of the value that is in r1 into the address that is in r7 0801C8E8: 4668 mov r0, sp ; r0 = Address in the Stack Pointer 0801C8EA: 8001 strh r1, [r0] ; Store r1 in the current Stack Pointer register 0801C8EC: 4A14 ldr r2, =#0x01000400 ; fixed transfer 0801C8EE: 1C39 add r1, r7, #0x0 ; destination address 0801C8F0: F0A3 bl 0801C8F2: F858 bl 0x080BF9A4 ; Swi CpuSet ; This calculates the address where to start a new line ; r8 contains the row number, r9 the column number, r7 the overall offset ; Each row consists of 32 tiles; 32 = $20 = 1 << 5 ; That is why the number of rows in r8 is LSLed with five. ; Afterwards, the number of tiles-to-skip that is stored in r9 is added to that value ; each BG-Map-entry is two bytes long, thus the LSL << 1 ; After that, the overall offset (r7) is added and the result is stored in r7 0801C8F4: 4641 mov r1, r8 ; r1 = r8 0801C8F6: 0148 lsl r0, r1, #0x5 ; r0 = r1 << 5 0801C8F8: 4448 add r0, r9 ; r0 = r0 + r9 0801C8FA: 0040 lsl r0, r0, #0x1 ; r0 = r0 << 1 0801C8FC: 183F add r7, r7, r0 ; r7 = r7 + r0 0801C8FE: 2000 mov r0, #0x00 0801C900: 42A8 cmp r0, r5 ; is r5 = #$00? 0801C902: D214 bcs 0x0801C92E ; Exit this ; --- ; This loop writes the BG map, i think ; It writes a incrementing line of doublebytes in an area around $060001C0 0801C904: 2100 mov r1, #0x00 ; r1 = #$00000000 0801C906: 1C43 add r3, r0, #0x1 ; increase counter for the line number 0801C908: 42A1 cmp r1, r4 ; check if line is full 0801C90A: D20C bcs 0x0801C926 ; branch if line is full 0801C90C: 0182 lsl r2, r0, #0x6 ; --- ; Little Loop ; r7 contains the beginning of the rectangle as offset ; r2 contains the offset of the beginning of the current line to the beginning of the rectangle ; r1 is the counter, how many tiles are already placed ; r0 is the destination address (consisting out of r1<<1, r2 and r7) ; r6 contains the value that is stored in that address ; r4 is the limit of tiles per line ; r5 is the limit of lines 0801C90E: 0048 lsl r0, r1, #0x1 ; r1 = number of tiles placed. Each tile entry in the BG map is 2 bytes in size, hence the <<1 0801C910: 19C0 add r0, r0, r7 0801C912: 1810 add r0, r2, r0 0801C914: 8006 strh r6, [r0] 0801C916: 1C48 add r0, r1, #0x1 0801C918: 0400 lsl r0, r0, #0x10 0801C91A: 0C01 lsr r1, r0, #0x10 0801C91C: 1C70 add r0, r6, #0x1 0801C91E: 0400 lsl r0, r0, #0x10 0801C920: 0C06 lsr r6, r0, #0x10 0801C922: 42A1 cmp r1, r4 0801C924: D3F3 bcc 0x0801C90E ; --- 0801C926: 0418 lsl r0, r3, #0x10 ; After finishing one line, the counter (r3) is compared to the limit value (r5) 0801C928: 0C00 lsr r0, r0, #0x10 0801C92A: 42A8 cmp r0, r5 0801C92C: D3EA bcc 0x0801C904 0801C92E: B001 add sp, #0x004 0801C930: BC18 pop {r3, r4} 0801C932: 4698 mov r8, r3 0801C934: 46A1 mov r9, r4 0801C936: BCF0 pop {r4, r5, r6, r7} 0801C938: BC01 pop {r0} 0801C93A: 4700 bx r0
$080428D0 - ?
080428D0: B570 push {r4, r5, r6, lr} 080428D2: 0400 lsl r0, r0, #0x10 080428D4: 2123 mov r1, #0x23 080428D6: 2523 mov r5, #0x23 080428D8: 0C06 lsr r6, r0, #0x10 080428DA: 1400 asr r0, r0, #0x10 080428DC: 2801 cmp r0, #0x01 080428DE: DD0E ble 0x080428FE 080428E0: 1E44 sub r4, r0, #0x1 080428E2: 200B mov r0, #0x0B 080428E4: 4348 mul r0, r1 080428E6: 210A mov r1, #0x0A 080428E8: F07D bl 080428EA: FE5A bl 0x080C05A0 080428EC: 1C01 add r1, r0, #0x0 080428EE: 4807 ldr r0, =#0x0001869F 080428F0: 4281 cmp r1, r0 080428F2: DD00 ble 0x080428F6 080428F4: 1C01 add r1, r0, #0x0 080428F6: 186D add r5, r5, r1 080428F8: 3C01 sub r4, #0x01 080428FA: 2C00 cmp r4, #0x00 080428FC: D1F1 bne 0x080428E2 080428FE: 2E00 cmp r6, #0x00 08042900: D100 bne 0x08042904 08042902: 2500 mov r5, #0x00 08042904: 1C28 add r0, r5, #0x0 08042906: BC70 pop {r4, r5, r6} 08042908: BC02 pop {r1} 0804290A: 4708 bx r1 ;0804290C: 869F strh r7, [r3, #0x34] ;0804290E: 0001 lsl r1, r0, #0x0
$08042910 - ?
08042910: B5F0 push {r4, r5, r6, r7, lr} 08042912: 4657 mov r7, r10 08042914: 464E mov r6, r9 08042916: 4645 mov r5, r8 08042918: B4E0 push {r5, r6, r7} 0804291A: 4B7E ldr r3, =#0x02029F50 0804291C: 4C7E ldr r4, =#0x0202D7A0 0804291E: 2190 mov r1, #0x90 08042920: 0089 lsl r1, r1, #0x2 ; r1 = #$00000240 08042922: 1860 add r0, r4, r1 ; r0 = #$0202D9E0 08042924: 2200 mov r2, #0x00 08042926: 5E81 ldsh r1, [r0, r2] ; ??? ("Load Sign Extended Halfword") 08042928: 0108 lsl r0, r1, #0x4 ; Loaded Byte * #16 0804292A: 1840 add r0, r0, r1 ; Loaded Byte * #17 0804292C: 0100 lsl r0, r0, #0x4 ; Loaded Byte * #272 (= #$110) 0804292E: 18C0 add r0, r0, r3 ; r0 = #$02029F50 + Loaded Byte * #272 08042930: 7801 ldrb r1, [r0] 08042932: 2240 mov r2, #0x40 08042934: 4311 orr r1, r2 08042936: 7001 strb r1, [r0] ; Set Bit 6 in $02029F50 + Loaded Byte * #272 08042938: 4F78 ldr r7, =#0x08103C48 0804293A: 61DF str r7, [r3, #0x1C] ; $02029F6C = #$08103C48 0804293C: 2596 mov r5, #0x96 0804293E: 006D lsl r5, r5, #0x1 ; r5 = #$0000012C 08042940: 1959 add r1, r3, r5 ; r1 = #$0202A07C 08042942: 4E77 ldr r6, =#0x00000242 08042944: 19A4 add r4, r4, r6 ; r4 = #$0202DC22 08042946: 2200 mov r2, #0x00 08042948: 5EA0 ldsh r0, [r4, r2] ; ??? ("Load Sign Extended Halfword") 0804294A: 0080 lsl r0, r0, #0x2 ; Loaded Byte * #4 0804294C: 1C3A add r2, r7, #0x0 0804294E: 3A30 sub r2, #0x30 08042950: 1880 add r0, r0, r2 08042952: 6008 str r0, [r1] 08042954: 258F mov r5, #0x8F 08042956: 00AD lsl r5, r5, #0x2 08042958: 1959 add r1, r3, r5 0804295A: 2600 mov r6, #0x00 0804295C: 5FA0 ldsh r0, [r4, r6] 0804295E: 0080 lsl r0, r0, #0x2 08042960: 1880 add r0, r0, r2 08042962: 6008 str r0, [r1] 08042964: 21D3 mov r1, #0xD3 08042966: 0089 lsl r1, r1, #0x2 08042968: 1858 add r0, r3, r1 0804296A: 6002 str r2, [r0] 0804296C: 4C6D ldr r4, =#0x0000045C 0804296E: 1919 add r1, r3, r4 08042970: 1C38 add r0, r7, #0x0 08042972: 3808 sub r0, #0x08 08042974: 6008 str r0, [r1] 08042976: 4D6C ldr r5, =#0x0000056C 08042978: 1958 add r0, r3, r5 0804297A: 4E6C ldr r6, =#0x08103C30 0804297C: 6006 str r6, [r0] 0804297E: 496C ldr r1, =#0x0000067C 08042980: 1858 add r0, r3, r1 08042982: 242C mov r4, #0x2C 08042984: 4264 neg r4, r4 08042986: 19E4 add r4, r4, r7 08042988: 46A1 mov r9, r4 0804298A: 6004 str r4, [r0] 0804298C: 4D69 ldr r5, =#0x0000078C 0804298E: 1958 add r0, r3, r5 08042990: 1D3E add r6, r7, #0x4 08042992: 46B4 mov r12, r6 08042994: 6006 str r6, [r0] 08042996: 4968 ldr r1, =#0x0000089C 08042998: 1858 add r0, r3, r1 0804299A: 240C mov r4, #0x0C 0804299C: 19E4 add r4, r4, r7 0804299E: 46A2 mov r10, r4 080429A0: 6004 str r4, [r0] 080429A2: 4D66 ldr r5, =#0x000009AC 080429A4: 1959 add r1, r3, r5 080429A6: 1F38 sub r0, r7, #0x4 080429A8: 6008 str r0, [r1] 080429AA: 4E65 ldr r6, =#0x00000ABC 080429AC: 1999 add r1, r3, r6 080429AE: 3824 sub r0, #0x24 080429B0: 6008 str r0, [r1] 080429B2: 4864 ldr r0, =#0x00000BCC 080429B4: 1819 add r1, r3, r0 080429B6: 1C38 add r0, r7, #0x0 080429B8: 3820 sub r0, #0x20 080429BA: 6008 str r0, [r1] 080429BC: 4C62 ldr r4, =#0x00000CDC 080429BE: 1919 add r1, r3, r4 080429C0: 3804 sub r0, #0x04 080429C2: 6008 str r0, [r1] 080429C4: 4D61 ldr r5, =#0x00000DEC 080429C6: 1958 add r0, r3, r5 080429C8: 4E61 ldr r6, =#0x08103C2C 080429CA: 6006 str r6, [r0] 080429CC: 4961 ldr r1, =#0x00000EFC 080429CE: 1858 add r0, r3, r1 080429D0: 6007 str r7, [r0] 080429D2: 4C61 ldr r4, =#0x0000100C 080429D4: 1918 add r0, r3, r4 080429D6: 1C3D add r5, r7, #0x0 080429D8: 3D10 sub r5, #0x10 080429DA: 6005 str r5, [r0] 080429DC: 4E5F ldr r6, =#0x0000111C 080429DE: 1999 add r1, r3, r6 080429E0: 1C38 add r0, r7, #0x0 080429E2: 380C sub r0, #0x0C 080429E4: 6008 str r0, [r1] 080429E6: 495E ldr r1, =#0x0000122C 080429E8: 1858 add r0, r3, r1 080429EA: 2414 mov r4, #0x14 080429EC: 4264 neg r4, r4 080429EE: 19E4 add r4, r4, r7 080429F0: 46A0 mov r8, r4 080429F2: 6004 str r4, [r0] 080429F4: 4E5B ldr r6, =#0x00001323 080429F6: 1998 add r0, r3, r6 080429F8: 7801 ldrb r1, [r0] 080429FA: 0649 lsl r1, r1, #0x19 080429FC: 0E49 lsr r1, r1, #0x19 080429FE: 0108 lsl r0, r1, #0x4 08042A00: 1840 add r0, r0, r1 08042A02: 0100 lsl r0, r0, #0x4 08042A04: 1C1C add r4, r3, #0x0 08042A06: 341C add r4, #0x1C 08042A08: 1900 add r0, r0, r4 08042A0A: 6800 ldr r0, [r0] 08042A0C: 6800 ldr r0, [r0] 08042A0E: 0580 lsl r0, r0, #0x16 08042A10: 3619 add r6, #0x19 08042A12: 1999 add r1, r3, r6 08042A14: 0EC0 lsr r0, r0, #0x1B 08042A16: 0080 lsl r0, r0, #0x2 08042A18: 1880 add r0, r0, r2 08042A1A: 6008 str r0, [r1] 08042A1C: 4952 ldr r1, =#0x00001433 08042A1E: 1858 add r0, r3, r1 08042A20: 7801 ldrb r1, [r0] 08042A22: 0649 lsl r1, r1, #0x19 08042A24: 0E49 lsr r1, r1, #0x19 08042A26: 0108 lsl r0, r1, #0x4 08042A28: 1840 add r0, r0, r1 08042A2A: 0100 lsl r0, r0, #0x4 08042A2C: 1900 add r0, r0, r4 08042A2E: 6800 ldr r0, [r0] 08042A30: 6800 ldr r0, [r0] 08042A32: 0580 lsl r0, r0, #0x16 08042A34: 4E4D ldr r6, =#0x0000144C 08042A36: 1999 add r1, r3, r6 08042A38: 0EC0 lsr r0, r0, #0x1B 08042A3A: 0080 lsl r0, r0, #0x2 08042A3C: 1880 add r0, r0, r2 08042A3E: 6008 str r0, [r1] 08042A40: 494B ldr r1, =#0x00001543 08042A42: 1858 add r0, r3, r1 08042A44: 7801 ldrb r1, [r0] 08042A46: 0649 lsl r1, r1, #0x19 08042A48: 0E49 lsr r1, r1, #0x19 08042A4A: 0108 lsl r0, r1, #0x4 08042A4C: 1840 add r0, r0, r1 08042A4E: 0100 lsl r0, r0, #0x4 08042A50: 1900 add r0, r0, r4 08042A52: 6800 ldr r0, [r0] 08042A54: 6800 ldr r0, [r0] 08042A56: 0580 lsl r0, r0, #0x16 08042A58: 4E46 ldr r6, =#0x0000155C 08042A5A: 1999 add r1, r3, r6 08042A5C: 0EC0 lsr r0, r0, #0x1B 08042A5E: 0080 lsl r0, r0, #0x2 08042A60: 1880 add r0, r0, r2 08042A62: 6008 str r0, [r1] 08042A64: 4944 ldr r1, =#0x00001653 08042A66: 1858 add r0, r3, r1 08042A68: 7801 ldrb r1, [r0] 08042A6A: 0649 lsl r1, r1, #0x19 08042A6C: 0E49 lsr r1, r1, #0x19 08042A6E: 0108 lsl r0, r1, #0x4 08042A70: 1840 add r0, r0, r1 08042A72: 0100 lsl r0, r0, #0x4 08042A74: 1900 add r0, r0, r4 08042A76: 6800 ldr r0, [r0] 08042A78: 6800 ldr r0, [r0] 08042A7A: 0580 lsl r0, r0, #0x16 08042A7C: 4E3F ldr r6, =#0x0000166C 08042A7E: 1999 add r1, r3, r6 08042A80: 0EC0 lsr r0, r0, #0x1B 08042A82: 0080 lsl r0, r0, #0x2 08042A84: 1880 add r0, r0, r2 08042A86: 6008 str r0, [r1] 08042A88: 493D ldr r1, =#0x00001763 08042A8A: 1858 add r0, r3, r1 08042A8C: 7801 ldrb r1, [r0] 08042A8E: 0649 lsl r1, r1, #0x19 08042A90: 0E49 lsr r1, r1, #0x19 08042A92: 0108 lsl r0, r1, #0x4 08042A94: 1840 add r0, r0, r1 08042A96: 0100 lsl r0, r0, #0x4 08042A98: 1900 add r0, r0, r4 08042A9A: 6800 ldr r0, [r0] 08042A9C: 6800 ldr r0, [r0] 08042A9E: 0580 lsl r0, r0, #0x16 08042AA0: 4C38 ldr r4, =#0x0000177C 08042AA2: 1919 add r1, r3, r4 08042AA4: 0EC0 lsr r0, r0, #0x1B 08042AA6: 0080 lsl r0, r0, #0x2 08042AA8: 1880 add r0, r0, r2 08042AAA: 6008 str r0, [r1] 08042AAC: 4E36 ldr r6, =#0x0000188C 08042AAE: 1998 add r0, r3, r6 08042AB0: 6005 str r5, [r0] 08042AB2: 4936 ldr r1, =#0x0000199C 08042AB4: 1858 add r0, r3, r1 08042AB6: 464A mov r2, r9 08042AB8: 6002 str r2, [r0] 08042ABA: 4C35 ldr r4, =#0x00001AAC 08042ABC: 1918 add r0, r3, r4 08042ABE: 4D24 ldr r5, =#0x08103C2C 08042AC0: 6005 str r5, [r0] 08042AC2: 4E34 ldr r6, =#0x00001BBC 08042AC4: 1998 add r0, r3, r6 08042AC6: 6007 str r7, [r0] 08042AC8: 4933 ldr r1, =#0x00001CCC 08042ACA: 1858 add r0, r3, r1 08042ACC: 4652 mov r2, r10 08042ACE: 6002 str r2, [r0] 08042AD0: 4C32 ldr r4, =#0x00001DDC 08042AD2: 1919 add r1, r3, r4 08042AD4: 1C38 add r0, r7, #0x0 08042AD6: 3008 add r0, #0x08 08042AD8: 6008 str r0, [r1] 08042ADA: 4D31 ldr r5, =#0x00001EEC 08042ADC: 1958 add r0, r3, r5 08042ADE: 6007 str r7, [r0] 08042AE0: 4E30 ldr r6, =#0x00001FFC 08042AE2: 1998 add r0, r3, r6 08042AE4: 6007 str r7, [r0] 08042AE6: 4930 ldr r1, =#0x0000210C 08042AE8: 1858 add r0, r3, r1 08042AEA: 6007 str r7, [r0] 08042AEC: 4A2F ldr r2, =#0x0000221C 08042AEE: 1898 add r0, r3, r2 08042AF0: 4664 mov r4, r12 08042AF2: 6004 str r4, [r0] 08042AF4: 4D2E ldr r5, =#0x0000232C 08042AF6: 1958 add r0, r3, r5 08042AF8: 4646 mov r6, r8 08042AFA: 6006 str r6, [r0] 08042AFC: 482D ldr r0, =#0x0000243C 08042AFE: 181B add r3, r3, r0 08042B00: 490A ldr r1, =#0x08103C30 08042B02: 6019 str r1, [r3] 08042B04: BC38 pop {r3, r4, r5} 08042B06: 4698 mov r8, r3 08042B08: 46A1 mov r9, r4 08042B0A: 46AA mov r10, r5 08042B0C: BCF0 pop {r4, r5, r6, r7} 08042B0E: BC01 pop {r0} 08042B10: 4700 bx r0 ;08042B12: 0000 lsl r0, r0, #0x0 ;08042B14: 9F50 ldr r7, [sp, #0x140] ;08042B16: 0202 lsl r2, r0, #0x8 ;08042B18: D7A0 bvc 0x08042A5C ;08042B1A: 0202 lsl r2, r0, #0x8 ;08042B1C: 3C48 sub r4, #0x48 ;08042B1E: 0810 lsr r0, r2, #0x0 ;08042B20: 0242 lsl r2, r0, #0x9 ;08042B22: 0000 lsl r0, r0, #0x0 ;08042B24: 045C lsl r4, r3, #0x11 ;08042B26: 0000 lsl r0, r0, #0x0 ;08042B28: 056C lsl r4, r5, #0x15 ;08042B2A: 0000 lsl r0, r0, #0x0 ;08042B2C: 3C30 sub r4, #0x30 ;08042B2E: 0810 lsr r0, r2, #0x0 ;08042B30: 067C lsl r4, r7, #0x19 ;08042B32: 0000 lsl r0, r0, #0x0 ;08042B34: 078C lsl r4, r1, #0x1E ;08042B36: 0000 lsl r0, r0, #0x0 ;08042B38: 089C lsr r4, r3, #0x2 ;08042B3A: 0000 lsl r0, r0, #0x0 ;08042B3C: 09AC lsr r4, r5, #0x6 ;08042B3E: 0000 lsl r0, r0, #0x0 ;08042B40: 0ABC lsr r4, r7, #0xA ;08042B42: 0000 lsl r0, r0, #0x0 ;08042B44: 0BCC lsr r4, r1, #0xF ;08042B46: 0000 lsl r0, r0, #0x0 ;08042B48: 0CDC lsr r4, r3, #0x13 ;08042B4A: 0000 lsl r0, r0, #0x0 ;08042B4C: 0DEC lsr r4, r5, #0x17 ;08042B4E: 0000 lsl r0, r0, #0x0 ;08042B50: 3C2C sub r4, #0x2C ;08042B52: 0810 lsr r0, r2, #0x0 ;08042B54: 0EFC lsr r4, r7, #0x1B ;08042B56: 0000 lsl r0, r0, #0x0 ;08042B58: 100C asr r4, r1, #0x0 ;08042B5A: 0000 lsl r0, r0, #0x0 ;08042B5C: 111C asr r4, r3, #0x4 ;08042B5E: 0000 lsl r0, r0, #0x0 ;08042B60: 122C asr r4, r5, #0x8 ;08042B62: 0000 lsl r0, r0, #0x0 ;08042B64: 1323 asr r3, r4, #0xC ;08042B66: 0000 lsl r0, r0, #0x0 ;08042B68: 1433 asr r3, r6, #0x10 ;08042B6A: 0000 lsl r0, r0, #0x0 ;08042B6C: 144C asr r4, r1, #0x11 ;08042B6E: 0000 lsl r0, r0, #0x0 ;08042B70: 1543 asr r3, r0, #0x15 ;08042B72: 0000 lsl r0, r0, #0x0 ;08042B74: 155C asr r4, r3, #0x15 ;08042B76: 0000 lsl r0, r0, #0x0 ;08042B78: 1653 asr r3, r2, #0x19 ;08042B7A: 0000 lsl r0, r0, #0x0 ;08042B7C: 166C asr r4, r5, #0x19 ;08042B7E: 0000 lsl r0, r0, #0x0 ;08042B80: 1763 asr r3, r4, #0x1D ;08042B82: 0000 lsl r0, r0, #0x0 ;08042B84: 177C asr r4, r7, #0x1D ;08042B86: 0000 lsl r0, r0, #0x0 ;08042B88: 188C add r4, r1, r2 ;08042B8A: 0000 lsl r0, r0, #0x0 ;08042B8C: 199C add r4, r3, r6 ;08042B8E: 0000 lsl r0, r0, #0x0 ;08042B90: 1AAC sub r4, r5, r2 ;08042B92: 0000 lsl r0, r0, #0x0 ;08042B94: 1BBC sub r4, r7, r6 ;08042B96: 0000 lsl r0, r0, #0x0 ;08042B98: 1CCC add r4, r1, #0x3 ;08042B9A: 0000 lsl r0, r0, #0x0 ;08042B9C: 1DDC add r4, r3, #0x7 ;08042B9E: 0000 lsl r0, r0, #0x0 ;08042BA0: 1EEC sub r4, r5, #0x3 ;08042BA2: 0000 lsl r0, r0, #0x0 ;08042BA4: 1FFC sub r4, r7, #0x7 ;08042BA6: 0000 lsl r0, r0, #0x0 ;08042BA8: 210C mov r1, #0x0C ;08042BAA: 0000 lsl r0, r0, #0x0 ;08042BAC: 221C mov r2, #0x1C ;08042BAE: 0000 lsl r0, r0, #0x0 ;08042BB0: 232C mov r3, #0x2C ;08042BB2: 0000 lsl r0, r0, #0x0 ;08042BB4: 243C mov r4, #0x3C ;08042BB6: 0000 lsl r0, r0, #0x0
$080479E8 - (r2 = Series(r0) * #$14)
The result this subroutine is stored in r2, r0 contains a counter.
A short result table (makes more sense than a lengthy, confusing theoretical explanation:
- r0 = 1 r2 = (#$14 * 1) = #$14 (#20)
- r0 = 2 r2 = (#$14 * 1) + (#$14 * 2) = #$3C (#60)
- r0 = 3 r2 = (#$14 * 1) + (#$14 * 2) + (#$14 * 3) = #$78 (#120)
- r0 = 4 r2 = (#$14 * 1) + (#$14 * 2) + (#$14 * 3) + (#$14 * 4) = #$C8 (#200)
- ... ...
- r0 = n r2 = (#$14 * 1) + (#$14 * 2) + ... + (#$14 * n-1) + (#$14 * n)
080479E8: 2200 mov r2, #0x00 080479EA: 0400 lsl r0, r0, #0x10 080479EC: 1400 asr r0, r0, #0x10 080479EE: 2800 cmp r0, #0x00 080479F0: DD05 ble 0x080479FE ; Exit if r0 < #$01 080479F2: 2114 mov r1, #0x14 080479F4: 1852 add r2, r2, r1 080479F6: 3114 add r1, #0x14 080479F8: 3801 sub r0, #0x01 080479FA: 2800 cmp r0, #0x00 080479FC: D1FA bne 0x080479F4 080479FE: 1C10 add r0, r2, #0x0 08047A00: 4770 bx lr
$0805B564 - ?
0805B564: B500 push {lr} 0805B566: 0400 lsl r0, r0, #0x10 0805B568: 0C00 lsr r0, r0, #0x10 ; Remove upper doublebyte from value in r0 0805B56A: F066 bl 0805B56C: FD6B bl 0x080C2044 ; Turn to ARM code, jump to $0805BEAC 0805B56E: BC01 pop {r0} 0805B570: 4700 bx r0 ;0805B572: 0000 lsl r0, r0, #0x0
$0805B574 - Jump to Sound Boot
0805B574: B500 push {lr} 0805B576: F066 bl 0805B578: FD69 bl 0x080C204C ; Turns in ARM mode and jumps to Sound Boot 0805B57A: BC01 pop {r0} 0805B57C: 4700 bx r0 ;0805B57E: 0000 lsl r0, r0, #0x0
0805B580: B500 push {lr} 0805B582: F066 bl 0805B584: FD67 bl 0x080C2054 0805B586: BC01 pop {r0} 0805B588: 4700 bx r0 ;0805B58A: 0000 lsl r0, r0, #0x0
$0805B58C - Jump to Sound A subroutine
0805B58C: B500 push {lr} 0805B58E: F066 bl 0805B590: FD65 bl 0x080C205C ; Turns in ARM mode and jumps to Sound A subroutine 0805B592: BC01 pop {r0} 0805B594: 4700 bx r0 ;0805B596: 0000 lsl r0, r0, #0x0
$0805BEAC - ?
Store r0 in $02001192 + [02001191]. Afterwards increment the value for $02001191 and AND it. So, $02001191 can never be higher than #$06. So this only affects registers $02001192-9.
0805BEAC: E59F1ED0 ldr r1, =#0x02001191 0805BEB0: E5D12000 ldrb r2, [r1] 0805BEB4: E59F3ECC ldr r3, =#0x02001192 0805BEB8: E18300B2 strh r0, [r3, r2] ; (r2 is a "pre-indexed offset" here, the added values of r2 and r3 form the store address 0805BEBC: E2822002 add r2, r2, #0x00000002 ; INC 0805BEC0: E2022007 and r2, r2, #0x00000007 ; Jump back to #$00 after #$06. 0805BEC4: E5C12000 strb r2, [r1] ; Store back in $02001191 0805BEC8: E12FFF1E bx lr
$0805BF3C - Sound Reset and Startup
This resets the Sound registers and brings them to their standard settings. It's called from $0805B574 via $080C2050.
0805BF3C: E59F3E50 ldr r3, =#0x04000060 0805BF40: E59F0E50 ldr r0, =#0x0000C80E ; Sound Volume: 100% ; DMA Sound A Volume: 100% ; DMA Sound B Volume: 100% ; DMA Sound A Enable RIGHT: Disable ; DMA Sound A Enable LEFT: Disable ; DMA Sound A Timer Select: Timer 0 ; DMA Sound A Reset FIFO = RESET ; DMA Sound B Enable RIGHT: Disable ; DMA Sound B Enable LEFT: Disable ; DMA Sound B Timer Select: Timer 1 ; DMA Sound B Reset FIFO = RESET 0805BF44: E1C302B2 strh r0, [r3, #0x22] ; Store in $04000082 0805BF48: E59F0E4C ldr r0, =#0x0000730E ; Sound Volume: 100% ; DMA Sound A Volume: 100% ; DMA Sound B Volume: 100% ; DMA Sound A Enable RIGHT: Enable ; DMA Sound A Enable LEFT: Enable ; DMA Sound A Timer Select: Timer 0 ; DMA Sound A Reset FIFO = No Reset ; DMA Sound B Enable RIGHT: Enable ; DMA Sound B Enable LEFT: Enable ; DMA Sound B Timer Select: Timer 1 ; DMA Sound B Reset FIFO = No Reset 0805BF4C: E1C302B2 strh r0, [r3, #0x22] ; Store in $04000082 0805BF50: E3A00077 mov r0, #0x00000077 ; Both Master Volumes: 100% 0805BF54: E1C302B0 strh r0, [r3, #0x20] ; Store in $04000080 0805BF58: E59F1E40 ldr r1, =#0x020011BC 0805BF5C: E1C100B0 strh r0, [r1] ; Store in $04000080 Buffer 0805BF60: E3A00000 mov r0, #0x00000000 ; Disable Sounds, Disable PSG/FIFO Master Enable) 0805BF64: E1C302B4 strh r0, [r3, #0x24] ; Store in $04000084 0805BF68: E3A0008F mov r0, #0x0000008F ; Enable Sounds, Enable PSG/FIFO Master Enable) 0805BF6C: E1C302B4 strh r0, [r3, #0x24] ; Store in $04000084 0805BF70: E3A00000 mov r0, #0x00000000 0805BF74: E1C300B2 strh r0, [r3, #0x02] ; Clear $04000062 - Channel 1 Duty/Len/Envelope 0805BF78: E1C300B8 strh r0, [r3, #0x08] ; Clear $04000068 - Channel 2 Duty/Len/Envelope 0805BF7C: E1C301B8 strh r0, [r3, #0x18] ; Clear $04000078 - Channel 4 Length/Envelope 0805BF80: E1C301B2 strh r0, [r3, #0x12] ; Clear $04000072 - Channel 3 Length/Envelope 0805BF84: E1C300B0 strh r0, [r3] ; Clear $04000060 - Channel 1 Sweep Register 0805BF88: E3A00902 mov r0, #0x00008000 0805BF8C: E1C300B4 strh r0, [r3, #0x04] ; Channel 1 Freq/Control - Restart Sound 0805BF90: E1C300BC strh r0, [r3, #0x0C] ; Channel 2 Freq/Control - Restart Sound 0805BF94: E1C301B4 strh r0, [r3, #0x14] ; Channel 3 Freq/Control - Restart Sound 0805BF98: E1C301BA strh r0, [r3, #0x1A] ; (Not used. Surely a bug. they surely meant #0x1C) 0805BF9C: E3A00000 mov r0, #0x00000000 0805BFA0: E59F1DFC ldr r1, =#0x02000EF0 0805BFA4: E4C10038 strb r0, [r1], #0x0038 ; Clear [r1] and then r1 = r1 + #$38 0805BFA8: E59F2DF8 ldr r2, =#0x02001190 0805BFAC: E1310002 teq r1, r2 0805BFB0: 1AFFFFFB bne 0x0805BFA4 ; Loop until r1 = #$02001190 0805BFB4: E1C100B0 strh r0, [r1] ; Clear $02001190/1 0805BFB8: E5810002 str r0, [r1, #0x0002] ; Clear $02001192-5 0805BFBC: E5810006 str r0, [r1, #0x0006] ; Clear $02001196-9 0805BFC0: E1C30AB2 strh r0, [r3, #0xA2] ; Clear $04000102 - Timer 0 Control ; Prescaler: F/1, normal Count-up timing, IRQ disabled, Timer Stop 0805BFC4: E1C30AB6 strh r0, [r3, #0xA6] ; Clear $04000106 - Timer 0 Control ; Prescaler: F/1, normal Count-up timing, IRQ disabled, Timer Stop 0805BFC8: E59F0DDC ldr r0, =#0x020011D0 0805BFCC: E3A010FF mov r1, #0x000000FF 0805BFD0: E5801000 str r1, [r0] ; $020011D0 = #$000000FF 0805BFD4: E12FFF1E bx lr 0805B57A: BC01 pop {r0}
$0805BFD8 - (Calculation and applying data for Sound A)
0805BFD8: E92D0010 stmfd sp!, {r4} ; Push r4 0805BFDC: E3A00C02 mov r0, #0x00000200 0805BFE0: E59F1DC8 ldr r1, =#0x04000202 0805BFE4: E1C100B0 strh r0, [r1] ; Request DMA 1 Interrupt 0805BFE8: E59F0DC4 ldr r0, =#0x0200119C 0805BFEC: E5901000 ldr r1, [r0] ; Loads $0200119C (by testing, it is #$08092994) 0805BFF0: E4912004 ldr r2, [r1], #0x0004 ; Load [r1] in r2 (here: $FD1C2816), increment r1 afterwards 0805BFF4: E5801000 str r1, [r0] ; Store incremented address back 0805BFF8: E5903004 ldr r3, [r0, #0x0004] ; By testing, it's $080932A4 0805BFFC: E1310003 teq r1, r3 ; Test if equal 0805C000: 0A00004A beq 0x0805C130 ; Branch if equal (and reset value??) 0805C004: E5D0300C ldrb r3, [r0, #0x000C] ; r3 = [$020011A8] 0805C008: E2833001 add r3, r3, #0x00000001 ; Inc r3 0805C00C: E20200FF and r0, r2, #0x000000FF ; r0 = r2 and #$000000FF 0805C010: E3100080 tst r0, #0x00000080 0805C014: 0A000008 beq 0x0805C03C ; Branch if bit 7 is clear 0805C018: E1E00000 mvn r0, r0 0805C01C: E2800001 add r0, r0, #0x00000001 0805C020: E20000FF and r0, r0, #0x000000FF 0805C024: E0010390 mul r1, r0, r3 0805C028: E3110080 tst r1, #0x00000080 0805C02C: 12811C01 addne r1, r1, #0x00000100 0805C030: E1E01001 mvn r1, r1 0805C034: E2811001 add r1, r1, #0x00000001 0805C038: EA000002 b 0x0805C048 0805C03C: E0010390 mul r1, r0, r3 0805C040: E3110080 tst r1, #0x00000080 ; N is set if Bit is clear 0805C044: 12811C01 addne r1, r1, #0x00000100 ; Add if N is set 0805C048: E2020CFF and r0, r2, #0x0000FF00 0805C04C: E3100902 tst r0, #0x00008000 0805C050: 0A000008 beq 0x0805C078 ; Branch if MSB is clear 0805C054: E1E00000 mvn r0, r0 0805C058: E2800001 add r0, r0, #0x00000001 0805C05C: E2000CFF and r0, r0, #0x0000FF00 0805C060: E0040390 mul r4, r0, r3 0805C064: E3140902 tst r4, #0x00008000 0805C068: 12844801 addne r4, r4, #0x00010000 0805C06C: E1E04004 mvn r4, r4 0805C070: E2844001 add r4, r4, #0x00000001 0805C074: EA000002 b 0x0805C084 0805C078: E0040390 mul r4, r0, r3 0805C07C: E3140902 tst r4, #0x00008000 0805C080: 12844801 addne r4, r4, #0x00010000 0805C084: E1A00424 mov r0, r4 lsr #0x08 0805C088: E2000CFF and r0, r0, #0x0000FF00 0805C08C: E0800421 add r0, r0, r1 lsr #0x08 ; r0 = r0+r1 >>> 8 0805C090: E59F1D20 ldr r1, =#0x040000A0 0805C094: E1C100B0 strh r0, [r1] ; Store r1 in Sound A Lo-Doublebyte 0805C098: E1A02822 mov r2, r2 lsr #0x10 ; Remove lower Doublebyte 0805C09C: E20200FF and r0, r2, #0x000000FF 0805C0A0: E3100080 tst r0, #0x00000080 0805C0A4: 0A000008 beq 0x0805C0CC ; Branch if MSB is clear 0805C0A8: E1E00000 mvn r0, r0 0805C0AC: E2800001 add r0, r0, #0x00000001 0805C0B0: E20000FF and r0, r0, #0x000000FF 0805C0B4: E0010390 mul r1, r0, r3 0805C0B8: E3110080 tst r1, #0x00000080 0805C0BC: 12811C01 addne r1, r1, #0x00000100 0805C0C0: E1E01001 mvn r1, r1 0805C0C4: E2811001 add r1, r1, #0x00000001 0805C0C8: EA000002 b 0x0805C0D8 0805C0CC: E0010390 mul r1, r0, r3 0805C0D0: E3110080 tst r1, #0x00000080 ; N is set if Bit is clear 0805C0D4: 12811C01 addne r1, r1, #0x00000100 ; Add if N is set 0805C0D8: E2020CFF and r0, r2, #0x0000FF00 0805C0DC: E3100902 tst r0, #0x00008000 0805C0E0: 0A000008 beq 0x0805C108 ; Branch if MSB is clear 0805C0E4: E1E00000 mvn r0, r0 ; Bitwise NOT r0 0805C0E8: E2800001 add r0, r0, #0x00000001 ; inc r0 0805C0EC: E2000CFF and r0, r0, #0x0000FF00 0805C0F0: E0040390 mul r4, r0, r3 0805C0F4: E3140902 tst r4, #0x00008000 ; N is set if Bit is clear 0805C0F8: 12844801 addne r4, r4, #0x00010000 ; Add if N is set 0805C0FC: E1E04004 mvn r4, r4 ; Bitwise NOT 0805C100: E2844001 add r4, r4, #0x00000001 ; Inc r4 0805C104: EA000002 b 0x0805C114 0805C108: E0040390 mul r4, r0, r3 0805C10C: E3140902 tst r4, #0x00008000 0805C110: 12844801 addne r4, r4, #0x00010000 0805C114: E1A00424 mov r0, r4 lsr #0x08 0805C118: E2000CFF and r0, r0, #0x0000FF00 0805C11C: E0800421 add r0, r0, r1 lsr #0x08 0805C120: E59F1C94 ldr r1, =#0x040000A2 0805C124: E1C100B0 strh r0, [r1] ; Sound A Hi-Doublebyte 0805C128: E8BD0010 ldmfd sp!, {r4} ; Pull r4 0805C12C: E12FFF1E bx lr 0805C130: E5903008 ldr r3, [r0, #0x0008] 0805C134: E1310003 teq r1, r3 0805C138: 15803000 strne r3, [r0] 0805C13C: 1AFFFFB0 bne 0x0805C004 0805C140: E3A00000 mov r0, #0x00000000 0805C144: E59F1C74 ldr r1, =#0x04000102 0805C148: E1C100B0 strh r0, [r1] 0805C14C: EAFFFFF5 b 0x0805C128
0805C2C8: E92D01F0 stmfd sp!, {r4, r5, r6, r7, r8} 0805C2CC: E3A07000 mov r7, #0x00000000 0805C2D0: E59F1AFC ldr r1, =#0x02000EF0 ;Begin of loop 0805C2D4: E5D12000 ldrb r2, [r1] 0805C2D8: E3120001 tst r2, #0x00000001 0805C2DC: 0A000014 beq 0x0805C334 ; Increment loop counter and load address in r1 0805C2E0: E5D12001 ldrb r2, [r1, #0x0001] ; Load next byte 0805C2E4: E2422001 sub r2, r2, #0x00000001 ; Decrement it 0805C2E8: E3520000 cmp r2, #0x00000000 0805C2EC: 0A000103 beq 0x0805C700 0805C2F0: E5C12001 strb r2, [r1, #0x0001] ; Store it back if it has not turned to #$00 0805C2F4: E5D12002 ldrb r2, [r1, #0x0002] ; Load the next byte 0805C2F8: E3320000 teq r2, #0x00000000 0805C2FC: 0A000003 beq 0x0805C310 0805C300: E2422001 sub r2, r2, #0x00000001 ; Decrement loaded byte 0805C304: E3520000 cmp r2, #0x00000000 0805C308: 0A0000A2 beq 0x0805C598 ; Branch if loaded byte turned #$00 0805C30C: E5C12002 strb r2, [r1, #0x0002] ; Store it back if it has not turned to #$00 0805C310: E3170008 tst r7, #0x00000008 0805C314: 0A000006 beq 0x0805C334 ; Increment loop counter and load address in r1 0805C318: E5D12024 ldrb r2, [r1, #0x0024] 0805C31C: E3320000 teq r2, #0x00000000 0805C320: 0A000003 beq 0x0805C334 ; Increment loop counter and load address in r1 0805C324: E2422001 sub r2, r2, #0x00000001 0805C328: E3320000 teq r2, #0x00000000 0805C32C: 0A0000D1 beq 0x0805C678 0805C330: E5C12024 strb r2, [r1, #0x0024] 0805C334: E2811038 add r1, r1, #0x00000038 ; r1 + #$0038 0805C338: E2877001 add r7, r7, #0x00000001 ; INC r7 0805C33C: E337000C teq r7, #0x0000000C 0805C340: 1AFFFFE3 bne 0x0805C2D4 ; Loop if r7 < #$0C 0805C344: E59F0A8C ldr r0, =#0x020011D0 0805C348: E1D010B2 ldrh r1, [r0, #0x02] 0805C34C: E3310000 teq r1, #0x00000000 0805C350: 1A000006 bne 0x0805C370 0805C354: E59F2A80 ldr r2, =#0x02001190 0805C358: E4D20001 ldrb r0, [r2], #0x0001 ; r0 = $02001190 (Byte sized) 0805C35C: E4D21001 ldrb r1, [r2], #0x0001 ; r1 = $02001191 (Byte sized) 0805C360: E1500001 cmp r0, r1 0805C364: 1A000058 bne 0x0805C4CC 0805C368: E8BD01F0 ldmfd sp!, {r4, r5, r6, r7, r8} 0805C36C: E12FFF1E bx lr 0805C370: E2411001 sub r1, r1, #0x00000001 0805C374: E1C010B2 strh r1, [r0, #0x02] 0805C378: E3310000 teq r1, #0x00000000 0805C37C: 0A00002D beq 0x0805C438 0805C380: E1D010B4 ldrh r1, [r0, #0x04] 0805C384: E2411C01 sub r1, r1, #0x00000100 0805C388: E3110CFF tst r1, #0x0000FF00 0805C38C: 11C010B4 strhne r1, [r0, #0x04] 0805C390: 1AFFFFEF bne 0x0805C354 0805C394: E1D020B8 ldrh r2, [r0, #0x08] 0805C398: E0811002 add r1, r1, r2 0805C39C: E1C010B4 strh r1, [r0, #0x04] 0805C3A0: E5D01000 ldrb r1, [r0] 0805C3A4: E5D02001 ldrb r2, [r0, #0x0001] 0805C3A8: E1510002 cmp r1, r2 0805C3AC: 43A01000 movmi r1, #0x00000000 0805C3B0: 50411002 subpl r1, r1, r2 0805C3B4: E5C01000 strb r1, [r0] 0805C3B8: E1A022A1 mov r2, r1 lsr #0x05 0805C3BC: E1A03202 mov r3, r2 lsl #0x04 0805C3C0: E0832002 add r2, r3, r2 0805C3C4: E59F4A14 ldr r4, =#0x020011BC 0805C3C8: E1D430B0 ldrh r3, [r4] 0805C3CC: E2033CFF and r3, r3, #0x0000FF00 0805C3D0: E1833002 orr r3, r3, r2 0805C3D4: E1C430B0 strh r3, [r4] 0805C3D8: E59F89B4 ldr r8, =#0x04000060 0805C3DC: E1C832B0 strh r3, [r8, #0x20] 0805C3E0: E59F09FC ldr r0, =#0x020010B0 0805C3E4: E3A06008 mov r6, #0x00000008 0805C3E8: E5D02000 ldrb r2, [r0] 0805C3EC: E3120001 tst r2, #0x00000001 0805C3F0: 0A00000B beq 0x0805C424 0805C3F4: E5D03025 ldrb r3, [r0, #0x0025] 0805C3F8: E2814001 add r4, r1, #0x00000001 0805C3FC: E0050394 mul r5, r4, r3 0805C400: E3150080 tst r5, #0x00000080 0805C404: 12855C01 addne r5, r5, #0x00000100 0805C408: E1A03425 mov r3, r5 lsr #0x08 0805C40C: E3120002 tst r2, #0x00000002 0805C410: 1A000003 bne 0x0805C424 0805C414: E59F29CC ldr r2, =#0x020011A8 0805C418: E3160001 tst r6, #0x00000001 0805C41C: 05823000 streq r3, [r2] 0805C420: 15823010 strne r3, [r2, #0x0010] 0805C424: E2866001 add r6, r6, #0x00000001 0805C428: E2800038 add r0, r0, #0x00000038 0805C42C: E336000C teq r6, #0x0000000C 0805C430: 1AFFFFEC bne 0x0805C3E8 0805C434: EAFFFFC6 b 0x0805C354 0805C438: E59F3954 ldr r3, =#0x04000060 0805C43C: E59F0954 ldr r0, =#0x0000C80E 0805C440: E1C302B2 strh r0, [r3, #0x22] 0805C444: E59F0950 ldr r0, =#0x0000730E 0805C448: E1C302B2 strh r0, [r3, #0x22] 0805C44C: E3A00000 mov r0, #0x00000000 0805C450: E1C302B4 strh r0, [r3, #0x24] 0805C454: E3A0008F mov r0, #0x0000008F 0805C458: E1C302B4 strh r0, [r3, #0x24] 0805C45C: E3A00077 mov r0, #0x00000077 0805C460: E1C302B0 strh r0, [r3, #0x20] 0805C464: E59F1980 ldr r1, =#0x020011BC 0805C468: E1C100B0 strh r0, [r1] 0805C46C: E3A00000 mov r0, #0x00000000 0805C470: E1C300B2 strh r0, [r3, #0x02] 0805C474: E1C300B8 strh r0, [r3, #0x08] 0805C478: E1C301B8 strh r0, [r3, #0x18] 0805C47C: E3A00000 mov r0, #0x00000000 0805C480: E1C301B2 strh r0, [r3, #0x12] 0805C484: E1C300B0 strh r0, [r3] 0805C488: E3A00902 mov r0, #0x00008000 0805C48C: E1C300B4 strh r0, [r3, #0x04] 0805C490: E1C300BC strh r0, [r3, #0x0C] 0805C494: E1C301B4 strh r0, [r3, #0x14] 0805C498: E1C301BA strh r0, [r3, #0x1A] 0805C49C: E3A00000 mov r0, #0x00000000 0805C4A0: E59F1948 ldr r1, =#0x02000EF0 0805C4A4: E4C10038 strb r0, [r1], #0x0038 0805C4A8: E59F2944 ldr r2, =#0x02001190 0805C4AC: E1310002 teq r1, r2 0805C4B0: 1AFFFFFB bne 0x0805C4A4 0805C4B4: E1C30AB2 strh r0, [r3, #0xA2] 0805C4B8: E1C30AB6 strh r0, [r3, #0xA6] 0805C4BC: E59F0934 ldr r0, =#0x020011D0 0805C4C0: E3A010FF mov r1, #0x000000FF 0805C4C4: E5801000 str r1, [r0] 0805C4C8: EAFFFFA1 b 0x0805C354 0805C4CC: E3A01000 mov r1, #0x00000000 0805C4D0: E19210B0 ldrh r1, [r2, r0] ; Load value from $02001192 + r0 0805C4D4: E3A03000 mov r3, #0x00000000 0805C4D8: E18230B0 strh r3, [r2, r0] ; $02001192 + r0 = #$0000 0805C4DC: E2800002 add r0, r0, #0x00000002 ; Increment the double-byte-load-index in r0 0805C4E0: E2000007 and r0, r0, #0x00000007 ; Reset it to #$00 if it reached #$08 0805C4E4: E59F2910 ldr r2, =#0x02001190 0805C4E8: E5C20000 strb r0, [r2] ; Store back 0805C4EC: E59F290C ldr r2, =#0x0805D2DC ; Address Table address 0805C4F0: E7920101 ldr r0, [r2, r1 lsl #0x02] ; Load address from Table (r1 is the index) 0805C4F4: E4901004 ldr r1, [r0], #0x0004 0805C4F8: E35100FF cmp r1, #0x000000FF 0805C4FC: 0A000023 beq 0x0805C590 ; Exit if = #$000000FF 0805C500: E3A03038 mov r3, #0x00000038 0805C504: E59F28F8 ldr r2, =#0x02000EF0 0805C508: E0222391 mla r2, r1, r3, r2 0805C50C: E5D23000 ldrb r3, [r2] 0805C510: E3833001 orr r3, r3, #0x00000001 0805C514: E5C23000 strb r3, [r2] 0805C518: E4903004 ldr r3, [r0], #0x0004 0805C51C: E4904004 ldr r4, [r0], #0x0004 0805C520: E5823004 str r3, [r2, #0x0004] 0805C524: E5824010 str r4, [r2, #0x0010] 0805C528: E3A03000 mov r3, #0x00000000 0805C52C: E5823024 str r3, [r2, #0x0024] 0805C530: E5823028 str r3, [r2, #0x0028] 0805C534: E582302C str r3, [r2, #0x002C] 0805C538: E3A03001 mov r3, #0x00000001 0805C53C: E5C23001 strb r3, [r2, #0x0001] 0805C540: E59F38C0 ldr r3, =#0x0805B69C 0805C544: E7F34001 ldrb r4, [r3, r1]! 0805C548: E5C2402A strb r4, [r2, #0x002A] 0805C54C: E5D3400C ldrb r4, [r3, #0x000C] 0805C550: E5C2402B strb r4, [r2, #0x002B] 0805C554: E3510004 cmp r1, #0x00000004 0805C558: 4AFFFFE5 bmi 0x0805C4F4 0805C55C: E3510008 cmp r1, #0x00000008 0805C560: 43A030E0 movmi r3, #0x000000E0 0805C564: 4A000000 bmi 0x0805C56C 0805C568: EA000004 b 0x0805C580 0805C56C: E0422003 sub r2, r2, r3 0805C570: E5D21000 ldrb r1, [r2] 0805C574: E3811002 orr r1, r1, #0x00000002 0805C578: E5C21000 strb r1, [r2] 0805C57C: EAFFFFDC b 0x0805C4F4 0805C580: E351000A cmp r1, #0x0000000A 0805C584: 53A03070 movpl r3, #0x00000070 0805C588: 4AFFFFD9 bmi 0x0805C4F4 0805C58C: EAFFFFF6 b 0x0805C56C 0805C590: E8BD01F0 ldmfd sp!, {r4, r5, r6, r7, r8} 0805C594: E12FFF1E bx lr 0805C598: E3170008 tst r7, #0x00000008 0805C59C: 1A000018 bne 0x0805C604 0805C5A0: E5912034 ldr r2, [r1, #0x0034] 0805C5A4: E4D20001 ldrb r0, [r2], #0x0001 0805C5A8: E5C10002 strb r0, [r1, #0x0002] 0805C5AC: E4D23001 ldrb r3, [r2], #0x0001 0805C5B0: E5C13028 strb r3, [r1, #0x0028] 0805C5B4: E5812034 str r2, [r1, #0x0034] 0805C5B8: E5D12000 ldrb r2, [r1] 0805C5BC: E3120002 tst r2, #0x00000002 0805C5C0: 1A00000E bne 0x0805C600 0805C5C4: E5D12026 ldrb r2, [r1, #0x0026] 0805C5C8: E0433002 sub r3, r3, r2 0805C5CC: E31308FF tst r3, #0x00FF0000 0805C5D0: 13A03000 movne r3, #0x00000000 0805C5D4: E5D12024 ldrb r2, [r1, #0x0024] 0805C5D8: E0823403 add r3, r2, r3 lsl #0x08 0805C5DC: E1C132B2 strh r3, [r1, #0x22] 0805C5E0: E59F2824 ldr r2, =#0x0805B65C 0805C5E4: E7922107 ldr r2, [r2, r7 lsl #0x02] 0805C5E8: E1C230B0 strh r3, [r2] 0805C5EC: E59F281C ldr r2, =#0x0805B67C 0805C5F0: E7922107 ldr r2, [r2, r7 lsl #0x02] 0805C5F4: E1D132B0 ldrh r3, [r1, #0x20] 0805C5F8: E3833902 orr r3, r3, #0x00008000 0805C5FC: E1C230B0 strh r3, [r2] 0805C600: EAFFFF4B b 0x0805C334 0805C604: E5912034 ldr r2, [r1, #0x0034] 0805C608: E4D23001 ldrb r3, [r2], #0x0001 0805C60C: E5C13002 strb r3, [r1, #0x0002] 0805C610: E4D23001 ldrb r3, [r2], #0x0001 0805C614: E1A04223 mov r4, r3 lsr #0x04 0805C618: E5C14024 strb r4, [r1, #0x0024] 0805C61C: E5C1402E strb r4, [r1, #0x002E] 0805C620: E203300F and r3, r3, #0x0000000F 0805C624: E5C1302D strb r3, [r1, #0x002D] 0805C628: E4D23001 ldrb r3, [r2], #0x0001 0805C62C: E5C13028 strb r3, [r1, #0x0028] 0805C630: E5812034 str r2, [r1, #0x0034] 0805C634: E5D12026 ldrb r2, [r1, #0x0026] 0805C638: E2822001 add r2, r2, #0x00000001 0805C63C: E0040392 mul r4, r2, r3 0805C640: E1A02424 mov r2, r4 lsr #0x08 0805C644: E5C12025 strb r2, [r1, #0x0025] 0805C648: E5D13000 ldrb r3, [r1] 0805C64C: E3130002 tst r3, #0x00000002 0805C650: 1A000007 bne 0x0805C674 0805C654: E59F37B8 ldr r3, =#0x020011D0 0805C658: E5D34000 ldrb r4, [r3] 0805C65C: E0050492 mul r5, r2, r4 0805C660: E1A02425 mov r2, r5 lsr #0x08 0805C664: E3170001 tst r7, #0x00000001 0805C668: 059F37A8 ldreq r3, =#0x020011A8 0805C66C: 159F37A8 ldrne r3, =#0x020011B8 0805C670: E5832000 str r2, [r3] 0805C674: EAFFFF2E b 0x0805C334 0805C678: E5D1202E ldrb r2, [r1, #0x002E] 0805C67C: E5C12024 strb r2, [r1, #0x0024] 0805C680: E5D1302D ldrb r3, [r1, #0x002D] 0805C684: E313000F tst r3, #0x0000000F 0805C688: 0A00001B beq 0x0805C6FC 0805C68C: E5D12028 ldrb r2, [r1, #0x0028] 0805C690: E3130008 tst r3, #0x00000008 0805C694: E2033007 and r3, r3, #0x00000007 0805C698: 00824003 addeq r4, r2, r3 0805C69C: 10424003 subne r4, r2, r3 0805C6A0: E31404FF tst r4, #0xFF000000 0805C6A4: 13A04000 movne r4, #0x00000000 0805C6A8: 1A000001 bne 0x0805C6B4 0805C6AC: E3140CFF tst r4, #0x0000FF00 0805C6B0: 13A040FF movne r4, #0x000000FF 0805C6B4: E5C14028 strb r4, [r1, #0x0028] 0805C6B8: E5D12026 ldrb r2, [r1, #0x0026] 0805C6BC: E2822001 add r2, r2, #0x00000001 0805C6C0: E0030492 mul r3, r2, r4 0805C6C4: E1A02423 mov r2, r3 lsr #0x08 0805C6C8: E5C12025 strb r2, [r1, #0x0025] 0805C6CC: E5D13000 ldrb r3, [r1] 0805C6D0: E3130002 tst r3, #0x00000002 0805C6D4: 1AFFFFE6 bne 0x0805C674 0805C6D8: E59F3740 ldr r3, =#0x020011D0 0805C6DC: E5D34000 ldrb r4, [r3] 0805C6E0: E2844001 add r4, r4, #0x00000001 0805C6E4: E0050492 mul r5, r2, r4 0805C6E8: E1A02425 mov r2, r5 lsr #0x08 0805C6EC: E3170001 tst r7, #0x00000001 0805C6F0: 059F372C ldreq r3, =#0x020011A8 0805C6F4: 159F372C ldrne r3, =#0x020011B8 0805C6F8: E5832000 str r2, [r3] 0805C6FC: EAFFFF0C b 0x0805C334 0805C700: E59F868C ldr r8, =#0x04000060 0805C704: E5912004 ldr r2, [r1, #0x0004] 0805C708: E4D20001 ldrb r0, [r2], #0x0001 0805C70C: E3500080 cmp r0, #0x00000080 0805C710: 4A000009 bmi 0x0805C73C 0805C714: E35000E0 cmp r0, #0x000000E0 0805C718: 4A000002 bmi 0x0805C728 0805C71C: E200001F and r0, r0, #0x0000001F 0805C720: E59F3704 ldr r3, =#0x0805C994 0805C724: E793F100 ldr pc, [r3, r0 lsl #0x02] 0805C728: E200007F and r0, r0, #0x0000007F 0805C72C: E59F36FC ldr r3, =#0x0805CE80 0805C730: E7D30000 ldrb r0, [r3, r0] 0805C734: E5C10029 strb r0, [r1, #0x0029] 0805C738: EAFFFFF2 b 0x0805C708
34 D7 05 08 ; Entry #$00 4C D8 05 08 88 D8 05 08 C0 D8 05 08 10 D9 05 08 4C D9 05 08 68 D9 05 08 88 D9 05 08 60 DA 05 08 ; Entry #$08 4C DB 05 08 6C DB 05 08 AC DB 05 08 EC DB 05 08 D0 DC 05 08 F0 DC 05 08 28 DD 05 08 78 DD 05 08 ; Entry #$10 A8 DD 05 08 EC DD 05 08 0C DE 05 08 58 DE 05 08 C0 DE 05 08 5C DF 05 08 B4 DF 05 08 E4 DF 05 08 ; Entry #$18 00 E0 05 08 24 E0 05 08 44 E0 05 08 64 E0 05 08 D0 E0 05 08 24 E1 05 08 44 E1 05 08 40 24 06 08 ; Entry #$20 70 2B 06 08 B4 64 06 08 70 35 06 08 5C 38 06 08 2C 3E 06 08 24 42 06 08 18 45 06 08 0C 48 06 08 ; Entry #$28 FC 4B 06 08 18 4F 06 08 E4 56 06 08 48 59 06 08 C4 5E 06 08 00 62 06 08 58 31 06 08 74 6B 06 08 ; Entry #$30 30 73 06 08 18 74 06 08 58 75 06 08 0C 78 06 08 94 79 06 08 DC 7B 06 08 DC BA 06 08 2C 8B 06 08 ; Entry #$38 10 8D 06 08 EC 91 06 08 94 93 06 08 88 96 06 08 DC 99 06 08 10 9E 06 08 E0 9E 06 08 5C 9F 06 08 ; Entry #$40 1C A0 06 08 C8 A1 06 08 C0 A3 06 08 C0 A6 06 08 30 A9 06 08 ; Entry #$45, used when the music on the title screen starts E0 AE 06 08 EC B0 06 08 F8 B3 06 08 7C B8 06 08 78 7D 06 08 54 C6 06 08 B0 C7 06 08 54 C8 06 08 F8 C8 06 08 3C C9 06 08 4C 19 06 08 84 19 06 08 BC 19 06 08 10 1A 06 08 58 1A 06 08 C0 1A 06 08 F0 1A 06 08 34 1B 06 08 7C 1B 06 08 BC 1B 06 08 18 1C 06 08 5C 1C 06 08 30 1D 06 08 74 1D 06 08 B0 1D 06 08 04 1E 06 08 04 E1 05 08 AC E1 05 08 CC E1 05 08 EC E1 05 08 0C E2 05 08 2C E2 05 08 4C E2 05 08 6C E2 05 08 8C E2 05 08 AC E2 05 08 CC E2 05 08 EC E2 05 08 0C E3 05 08 2C E3 05 08 4C E3 05 08 6C E3 05 08 8C E3 05 08 EC E3 05 08 0C E4 05 08 7C E4 05 08 30 E5 05 08 18 E6 05 08 D0 E6 05 08 5C E7 05 08 8C E8 05 08 EC E8 05 08 28 E9 05 08 E0 E9 05 08 00 EA 05 08 40 EA 05 08 84 EA 05 08 E4 EA 05 08 28 EB 05 08 70 EB 05 08 9C EB 05 08 C4 EB 05 08 F8 EB 05 08 38 EC 05 08 60 EC 05 08 C4 EC 05 08 24 ED 05 08 64 ED 05 08 88 ED 05 08 A8 ED 05 08 E0 ED 05 08 04 EE 05 08 2C EE 05 08 50 EE 05 08 90 EE 05 08 B8 EE 05 08 A0 EF 05 08 F4 EF 05 08 1C F0 05 08 B4 F0 05 08 08 F1 05 08 50 F1 05 08 AC F1 05 08 C8 F2 05 08 3C F3 05 08 6C F3 05 08 F8 F3 05 08 50 F4 05 08 DC F4 05 08 78 F5 05 08 C0 F5 05 08 FC F5 05 08 90 F6 05 08 C8 F6 05 08 18 F7 05 08 A0 F7 05 08 3C F8 05 08 90 F8 05 08 D8 F8 05 08 F8 F8 05 08 D4 F9 05 08 38 FA 05 08 D0 FA 05 08 3C FB 05 08 EC FB 05 08 34 FC 05 08 54 FC 05 08 94 FC 05 08 E0 FC 05 08 38 FD 05 08 90 FD 05 08 04 FE 05 08 40 FF 05 08 8C FF 05 08 20 00 06 08 B4 00 06 08 F0 00 06 08 30 01 06 08 A4 01 06 08 F8 01 06 08 34 02 06 08 A8 02 06 08 58 03 06 08 C4 03 06 08 3C 04 06 08 88 04 06 08 44 05 06 08 D0 05 06 08 10 06 06 08 BC 06 06 08 E4 06 06 08 10 07 06 08 80 07 06 08 B0 07 06 08 48 08 06 08 D0 08 06 08 18 09 06 08 A8 09 06 08 E4 09 06 08 04 0A 06 08 60 0A 06 08 D8 0A 06 08 18 0B 06 08 88 0B 06 08 14 0C 06 08 4C 0C 06 08 6C 0C 06 08 90 0C 06 08 B8 0C 06 08 D8 0C 06 08 FC 0C 06 08 38 0D 06 08 80 0D 06 08 BC 0D 06 08 DC 0D 06 08 14 0E 06 08 4C 0E 06 08 88 0E 06 08 B8 0E 06 08 00 0F 06 08 38 0F 06 08 88 0F 06 08 A8 0F 06 08 F0 0F 06 08 20 10 06 08 44 10 06 08 6C 10 06 08 A0 10 06 08 F8 10 06 08 38 11 06 08 64 11 06 08 84 11 06 08 C0 11 06 08 E0 11 06 08 14 12 06 08 48 12 06 08 90 12 06 08 DC 12 06 08 28 13 06 08 44 13 06 08 7C 13 06 08 98 13 06 08 C0 13 06 08 0C 14 06 08 90 14 06 08 3C D7 05 08 78 1E 06 08 E8 1E 06 08 18 1F 06 08 50 1F 06 08 BC 20 06 08 48 21 06 08 80 21 06 08 28 22 06 08 9C 22 06 08 E8 14 06 08 20 16 06 08 E4 16 06 08 40 17 06 08 98 17 06 08 E0 17 06 08 54 18 06 08 E0 18 06 08 D8 22 06 08 04 23 06 08 4C 23 06 08 90 23 06 08 BC 23 06 08
(Next is $0805D734)
$0805D734 - (Data)
Entry #$00 in the Address Table at $0805D2DC (right above). This data gets executed at $0805C2C8.
FF 00 00 00 ; Exit command at $0805C2C8
(Next is $0805D738)
$080972B4 - (Main Title Subroutine?)
As far as I can see, this is only called from $0800052E. The value that is in r0 in the end is used as a number for a Jump Table, something between #$00 and #$06. It is loaded here at $08097376 onwards from Register $020326D1.
080972B4: B5F0 push {r4, r5, r6, r7, lr} 080972B6: 4657 mov r7, r10 080972B8: 464E mov r6, r9 080972BA: 4645 mov r5, r8 080972BC: B4E0 push {r5, r6, r7} 080972BE: B081 add sp, #-0x004 080972C0: 2000 mov r0, #0x00 ; CLEAR DMA 080972C2: 4682 mov r10, r0 ; r10 = r0 = #$00 080972C4: 4668 mov r0, sp 080972C6: 4651 mov r1, r10 080972C8: 8001 strh r1, [r0] ; Clear newly added stack entry 080972CA: 4930 ldr r1, =#0x040000D4 080972CC: 6008 str r0, [r1] ; DMA Source Address: Cleared Stack Entry 080972CE: 4A30 ldr r2, =#0x0202DE30 080972D0: 604A str r2, [r1, #0x04] ; Destination 080972D2: 4830 ldr r0, =#0x81002458 080972D4: 6088 str r0, [r1, #0x08] ; Fixed Transfer, 2458 Double Bytes 080972D6: 6888 ldr r0, [r1, #0x08] 080972D8: 6888 ldr r0, [r1, #0x08] 080972DA: 2380 mov r3, #0x80 080972DC: 061B lsl r3, r3, #0x18 080972DE: 1C15 add r5, r2, #0x0 ; r5 = #$0202DE30 080972E0: 4E2D ldr r6, =#0x0203BBA0 ; r6 = #$0203BBA0 080972E2: 4F2E ldr r7, =#0x0203CAD0 ; r7 = #$0203CAD0 080972E4: 4A2E ldr r2, =#0x0203CAC0 080972E6: 4694 mov r12, r2 ; r12 = #$0203CAC0 080972E8: 4A2E ldr r2, =#0x0203BBF0 080972EA: 4690 mov r8, r2 ; r8 = #$0203BBF0 080972EC: 4A2E ldr r2, =#0x0203BC10 080972EE: 4691 mov r9, r2 ; r9 = #$0203BC10 080972F0: 2800 cmp r0, #0x00 080972F2: DA04 bge 0x080972FE ; Branch if DMA is completed 080972F4: 1C1A add r2, r3, #0x0 080972F6: 6888 ldr r0, [r1, #0x08] 080972F8: 4010 and r0, r2 080972FA: 2800 cmp r0, #0x00 080972FC: D1FB bne 0x080972F6 ; Loop if DMA isn't completed 080972FE: 1C2C add r4, r5, #0x0 ; r4 = #$0202DE30 08097300: 492A ldr r1, =#0x000048A0 08097302: 1860 add r0, r4, r1 ; r0 = #$020326D0 08097304: 4652 mov r2, r10 ; r2 = #$00000000 08097306: 7002 strb r2, [r0] ; Clear $020326D0 (byte) 08097308: 6026 str r6, [r4] ; $0203DE30 = #$0203BBA0 (Address for Graphic Settings Buffer) 0809730A: 6067 str r7, [r4, #0x04] ; $0203DE34 = #$0203CAD0 (Address for Graphics Buffer) 0809730C: 4660 mov r0, r12 0809730E: 60A0 str r0, [r4, #0x08] ; $0203DE38 = #$0203CAC0 08097310: 4641 mov r1, r8 08097312: 60E1 str r1, [r4, #0x0C] ; $0203DE3C = #$0203BBF0 08097314: 464A mov r2, r9 08097316: 6122 str r2, [r4, #0x10] ; $0203DE40 = #$0203BC10 08097318: F001 bl 0809731A: F8B4 bl 0x08098484 ; (Disables Interrupts, transfers data to $020000D0 (WRAM), re-enables Interrupts) 0809731C: 6920 ldr r0, [r4, #0x10] ; r0 = $0203DE40 = #$0203BC10 0809731E: 2101 mov r1, #0x01 08097320: 2201 mov r2, #0x01 08097322: 2300 mov r3, #0x00 08097324: F01F bl 08097326: FB24 bl 0x080B6970 08097328: 2800 cmp r0, #0x00 0809732A: D102 bne 0x08097332 0809732C: 201B mov r0, #0x1B 0809732E: F7C4 bl 08097330: F919 bl 0x0805B564 08097332: 6920 ldr r0, [r4, #0x10] 08097334: 491E ldr r1, =#0x00000EAC 08097336: 1840 add r0, r0, r1 08097338: 7801 ldrb r1, [r0] 0809733A: 2004 mov r0, #0x04 0809733C: 4008 and r0, r1 0809733E: 2800 cmp r0, #0x00 08097340: D00A beq 0x08097358 08097342: 2003 mov r0, #0x03 08097344: F005 bl 08097346: FABC bl 0x0809C8C0 08097348: F001 bl 0809734A: F89C bl 0x08098484 0809734C: 6920 ldr r0, [r4, #0x10] 0809734E: 2101 mov r1, #0x01 08097350: 2200 mov r2, #0x00 08097352: 2300 mov r3, #0x00 08097354: F01F bl 08097356: FB0C bl 0x080B6970 08097358: F7C4 bl 0809735A: F90C bl 0x0805B574 0809735C: F027 bl 0809735E: FAD6 bl 0x080BE90C 08097360: F000 bl 08097362: F9BC bl 0x080976DC 08097364: 1C28 add r0, r5, #0x0 ; r5 = #$0202DE30 08097366: 3014 add r0, #0x14 08097368: 2100 mov r1, #0x00 0809736A: F002 bl 0809736C: FC25 bl 0x08099BB8 0809736E: F000 bl 08097370: F8C5 bl 0x080974FC 08097372: F000 bl 08097374: F9A9 bl 0x080976C8
08097376: 4A0F ldr r2, =#0x000048A1 ; LOAD JUMP TABLE ENTRY NUMBER 08097378: 18A8 add r0, r5, r2 ; r5 = #$020326D1 0809737A: 7800 ldrb r0, [r0] 0809737C: B001 add sp, #0x004 0809737E: BC38 pop {r3, r4, r5} 08097380: 4698 mov r8, r3 08097382: 46A1 mov r9, r4 08097384: 46AA mov r10, r5 08097386: BCF0 pop {r4, r5, r6, r7} 08097388: BC02 pop {r1} 0809738A: 4708 bx r1 ;DATA ;================= ;0809738C: 00D4 lsl r4, r2, #0x3 ;0809738E: 0400 lsl r0, r0, #0x10 ;08097390: DE30 ??? ;08097392: 0202 lsl r2, r0, #0x8
$080974FC - ?
This enables and disables the VBLANK/HBLANK interrupts and jumps to a really big subroutine.
080974FC: B570 push {r4, r5, r6, lr} 080974FE: 4646 mov r6, r8 08097500: B440 push {r6} 08097502: B081 add sp, #-0x004 08097504: 4A12 ldr r2, =#0x04000208 08097506: 2000 mov r0, #0x00 08097508: 4680 mov r8, r0 0809750A: 8010 strh r0, [r2] ; Disable all interrupts 0809750C: 4D11 ldr r5, =#0x04000200 0809750E: 8828 ldrh r0, [r5] ; Load interrupts 08097510: 2601 mov r6, #0x01 08097512: 4330 orr r0, r6 ; Enable LCD-V-Blank 08097514: 8028 strh r0, [r5] ; Store back 08097516: 4C10 ldr r4, =#0x04000004 08097518: 8820 ldrh r0, [r4] ; Load General LCD Status 0809751A: 2108 mov r1, #0x08 0809751C: 4308 orr r0, r1 ; Set Flag for V-BLANK IRQ Enable 0809751E: 8020 strh r0, [r4] ; Store value back 08097520: 8016 strh r6, [r2] ; Enable Interrupts again 08097522: 9200 str r2, [sp] ; Store #$04000208 on stack 08097524: F000 bl 08097526: F852 bl 0x080975CC ; ? 08097528: 9A00 ldr r2, [sp] ; Restore #$0400208 from stack 0809752A: 4640 mov r0, r8 ; r8 is still #$00 0809752C: 8010 strh r0, [r2] ; Disable all interrupts 0809752E: 8829 ldrh r1, [r5] 08097530: 480A ldr r0, =#0x0000FFFC 08097532: 4008 and r0, r1 08097534: 8028 strh r0, [r5] ; Disable LCD V/H-Blank (if r5 was not changed in the subroutine) 08097536: 8821 ldrh r1, [r4] 08097538: 4809 ldr r0, =#0x0000FFE7 0809753A: 4008 and r0, r1 0809753C: 8020 strh r0, [r4] ; Disable LCD V/H IRQs (if r4 was not changed in the subroutine) 0809753E: 8016 strh r6, [r2] ; Enable Interrupts again 08097540: F027 bl 08097542: F8D0 bl 0x080BE6E4 ; Turn the Screen to black 08097544: B001 add sp, #0x004 08097546: BC08 pop {r3} 08097548: 4698 mov r8, r3 0809754A: BC70 pop {r4, r5, r6} 0809754C: BC01 pop {r0} 0809754E: 4700 bx r0 ;DATA ;=============== ;08097550: 0208 lsl r0, r1, #0x8 ;08097552: 0400 lsl r0, r0, #0x10 ;08097554: 0200 lsl r0, r0, #0x8 ;08097556: 0400 lsl r0, r0, #0x10 ;08097558: 0004 lsl r4, r0, #0x0 ;0809755A: 0400 lsl r0, r0, #0x10 ;0809755C: FFFC bl 0x07C98556 ;0809755E: 0000 lsl r0, r0, #0x0 ;08097560: FFE7 bl 0x08098530 ;08097562: 0000 lsl r0, r0, #0x0
$080975CC - ?
080975CC: B510 push {r4, lr} 080975CE: 4809 ldr r0, =#0x0202DE30 ; Load from $020326D4 080975D0: 4A09 ldr r2, =#0x000048A4 080975D2: 1881 add r1, r0, r2 080975D4: 7808 ldrb r0, [r1] 080975D6: 07C0 lsl r0, r0, #0x1F ; Is bit 0 of $020326D4 set? 080975D8: 2800 cmp r0, #0x00 080975DA: D107 bne 0x080975EC ; Exit if it is set 080975DC: 1C0C add r4, r1, #0x0 ; Restore #$020326D4 in r4 080975DE: 2001 mov r0, #0x01 ; ? 080975E0: F000 bl 080975E2: F80C bl 0x080975FC ; ? 080975E4: 7820 ldrb r0, [r4] ; ? 080975E6: 07C0 lsl r0, r0, #0x1F 080975E8: 2800 cmp r0, #0x00 ; Is bit 0 set? 080975EA: D0F8 beq 0x080975DE ; Loop if it is cleared 080975EC: BC10 pop {r4} 080975EE: BC01 pop {r0} 080975F0: 4700 bx r0 ;DATA ;============= ;080975F2: 0000 lsl r0, r0, #0x0 ;080975F4: DE30 ??? ;080975F6: 0202 lsl r2, r0, #0x8 ;080975F8: 48A4 ldr r0, =#0x85A18DA2 ;080975FA: 0000 lsl r0, r0, #0x0
$080975FC - ?
080975FC: B510 push {r4, lr} 080975FE: B081 add sp, #-0x004 08097600: 4669 mov r1, sp 08097602: 7008 strb r0, [r1] 08097604: F000 bl 08097606: F824 bl 0x08097650 ; Disable all sprites 08097608: 4668 mov r0, sp 0809760A: 7800 ldrb r0, [r0] ; Restore Original r1 0809760C: 2800 cmp r0, #0x00 0809760E: D008 beq 0x08097622 08097610: 4C0D ldr r4, =#0x0202DE30 08097612: 68A0 ldr r0, [r4, #0x08] 08097614: F027 bl 08097616: F89C bl 0x080BE750 08097618: 1C20 add r0, r4, #0x0 0809761A: 3014 add r0, #0x14 0809761C: 68A1 ldr r1, [r4, #0x08] 0809761E: F002 bl 08097620: F8C3 bl 0x080997A8 ; Gets executed twice, before the next frame comes(?) 08097622: F000 bl 08097624: F81F bl 0x08097664 08097626: F000 bl 08097628: F84D bl 0x080976C4 ; Jumps directly back, does nothng 0809762A: 4808 ldr r0, =#0x0202DF00 0809762C: F026 bl 0809762E: FD10 bl 0x080BE050 08097630: 0600 lsl r0, r0, #0x18 08097632: 2800 cmp r0, #0x00 08097634: D101 bne 0x0809763A 08097636: F027 bl 08097638: FBCF bl 0x080BEDD8 0809763A: F000 bl 0809763C: FFA1 bl 0x08098580 0809763E: B001 add sp, #0x004 08097640: BC10 pop {r4} 08097642: BC01 pop {r0} 08097644: 4700 bx r0 ;DATA ;============ ;08097646: 0000 lsl r0, r0, #0x0 ;08097648: DE30 ??? ;0809764A: 0202 lsl r2, r0, #0x8 ;0809764C: DF00 swi SoftReset ;0809764E: 0202 lsl r2, r0, #0x8
$08097650 - Disable all Sprites
Disables all Sprites... in Buffer.
08097650: B500 push {lr} 08097652: 4803 ldr r0, =#0x0202DE30 08097654: 6840 ldr r0, [r0, #0x04] ; Load Offset of the OAM Buffer 08097656: F027 bl 08097658: F99F bl 0x080BE998 ; Disable all Sprites 0809765A: BC01 pop {r0} 0809765C: 4700 bx r0 ;DATA ;=========== ;0809765E: 0000 lsl r0, r0, #0x0 ;08097660: DE30 ??? ;08097662: 0202 lsl r2, r0, #0x8
$08097664 - ?
08097664: B530 push {r4, r5, lr} 08097666: 4C14 ldr r4, =#0x0202DECC ; r4 = $0202DECC 08097668: 1C21 add r1, r4, #0x0 0809766A: 3134 add r1, #0x34 ; r1 = $0202DF00 0809766C: 1C20 add r0, r4, #0x0 ; r0 = $0202DECC 0809766E: F004 bl 08097670: F9E9 bl 0x0809BA44 08097672: 1C25 add r5, r4, #0x0 08097674: 3D88 sub r5, #0x88 08097676: 1C28 add r0, r5, #0x0 08097678: F001 bl 0809767A: FAB2 bl 0x08098BE0 0809767C: 1C28 add r0, r5, #0x0 0809767E: F002 bl 08097680: FFBF bl 0x0809A600 08097682: 1C20 add r0, r4, #0x0 08097684: 30A4 add r0, #0xA4 08097686: F003 bl 08097688: FE0D bl 0x0809B2A4 0809768A: 3D14 sub r5, #0x14 0809768C: 68E8 ldr r0, [r5, #0x0C] 0809768E: F027 bl 08097690: F929 bl 0x080BE8E4 08097692: 480A ldr r0, =#0x00004808 08097694: 1824 add r4, r4, r0 08097696: 7820 ldrb r0, [r4] 08097698: 06C0 lsl r0, r0, #0x1B 0809769A: 2800 cmp r0, #0x00 0809769C: DB08 blt 0x080976B0 0809769E: 6869 ldr r1, [r5, #0x04] 080976A0: 2296 mov r2, #0x96 080976A2: 0152 lsl r2, r2, #0x5 080976A4: 1888 add r0, r1, r2 080976A6: 4A06 ldr r2, =#0x00001F04 080976A8: 1889 add r1, r1, r2 080976AA: 8809 ldrh r1, [r1] 080976AC: F004 bl 080976AE: FF34 bl 0x0809C518 080976B0: BC30 pop {r4, r5} 080976B2: BC01 pop {r0} 080976B4: 4700 bx r0 ;080976B6: 0000 lsl r0, r0, #0x0 ;080976B8: DECC ??? ;080976BA: 0202 lsl r2, r0, #0x8 ;080976BC: 4808 ldr r0, =#0xB4604645 ;080976BE: 0000 lsl r0, r0, #0x0 ;080976C0: 1F04 sub r4, r0, #0x4 ;080976C2: 0000 lsl r0, r0, #0x0
$080976C8 - Deactivate Special Graphic Effects
Deactivates BLDCNT, BLDALPHA and BLDY.
080976C8: 4803 ldr r0, =#0x04000050 080976CA: 2100 mov r1, #0x00 080976CC: 8001 strh r1, [r0] ; $04000050 - BLDCNT - Color Special Effects Selection 080976CE: 3002 add r0, #0x02 080976D0: 8001 strh r1, [r0] ; $04000052 - BLDALPHA - Alpha Blending Coefficients 080976D2: 3002 add r0, #0x02 080976D4: 8001 strh r1, [r0] ; $04000054 - BLDY Brightness (Fade-In/Out) Coefficient 080976D6: 4770 bx lr ;080976D8: 0050 lsl r0, r2, #0x1 ;080976DA: 0400 lsl r0, r0, #0x10
$080976DC - ?
Removes some Intro Graphic Data Load Flags.
080976DC: B570 push {r4, r5, r6, lr} 080976DE: 464E mov r6, r9 080976E0: 4645 mov r5, r8 080976E2: B460 push {r5, r6} 080976E4: 4C2B ldr r4, =#0x0202DE30 080976E6: 482C ldr r0, =#0x000048A4 080976E8: 1900 add r0, r0, r4 ; r0 = #$020326D4 (Intro Graphic Data Load Flag register) 080976EA: 4680 mov r8, r0 ; r8 = #$020326D4 (Intro Graphic Data Load Flag register) 080976EC: 7802 ldrb r2, [r0] 080976EE: 2002 mov r0, #0x02 080976F0: 4240 neg r0, r0 080976F2: 1C01 add r1, r0, #0x0 080976F4: 4011 and r1, r2 ; Remove bit 1 from $020326D4's value 080976F6: 2202 mov r2, #0x02 080976F8: 4311 orr r1, r2 ; Set bit 1 from $020326D4's value 080976FA: 2211 mov r2, #0x11 080976FC: 4252 neg r2, r2 080976FE: 4691 mov r9, r2 08097700: 4011 and r1, r2 ; Remove bits 0 and 4 from $020326D4's value 08097702: 4A26 ldr r2, =#0x0000489C 08097704: 18A5 add r5, r4, r2 ; r5 = #$020326CC 08097706: 882A ldrh r2, [r5] 08097708: 2200 mov r2, #0x00 0809770A: 802A strh r2, [r5] ; $020326CC = #$0000 0809770C: 4A24 ldr r2, =#0x0000489E 0809770E: 18A3 add r3, r4, r2 08097710: 4A24 ldr r2, =#0x0000FFFF 08097712: 801A strh r2, [r3] ; $020326CE = #$FFFF 08097714: 2621 mov r6, #0x21 08097716: 4276 neg r6, r6 ; r6 = #$FFFFFFDE 08097718: 4031 and r1, r6 ; Remove bits 0 and 5 from r1 0809771A: 2341 mov r3, #0x41 0809771C: 425B neg r3, r3 ; r3 = #$FFFFFFBE 0809771E: 4019 and r1, r3 ; Remove bits 0 and 6 from r1 08097720: 227F mov r2, #0x7F 08097722: 4011 and r1, r2 ; Remove bit 7 from r1 (rest is unused anyway) 08097724: 4642 mov r2, r8 ; r2 = #$020326D4 (Intro Graphic Data Load Flag register) 08097726: 7011 strb r1, [r2] 08097728: 491F ldr r1, =#0x000048A5 0809772A: 1862 add r2, r4, r1 ; r2 = #$020326D5 (Intro Graphic Data Load Flag register) 0809772C: 7811 ldrb r1, [r2] 0809772E: 4008 and r0, r1 ; Remove bit 1 from loaded value 08097730: 2103 mov r1, #0x03 08097732: 4249 neg r1, r1 08097734: 4008 and r0, r1 ; Remove bits 0 and 1 from loaded value 08097736: 3902 sub r1, #0x02 08097738: 4008 and r0, r1 ; Remove bit 1 from loaded value 0809773A: 3904 sub r1, #0x04 0809773C: 4008 and r0, r1 ; Remove bit 2 from loaded value 0809773E: 4649 mov r1, r9 08097740: 4008 and r0, r1 ; Remove bits 0 and 4 from loaded value 08097742: 4030 and r0, r6 ; Remove bits 0 and 5 from loaded value 08097744: 4018 and r0, r3 ; Remove bits 0 and 6 from loaded value 08097746: 7010 strb r0, [r2] ; Store value back 08097748: 6820 ldr r0, [r4] ; Load the address of the graphics settings 0809774A: F000 bl 0809774C: F83F bl 0x080977CC ; Set Video Mode 0809774E: 6860 ldr r0, [r4, #0x04] ; Load the address of the graphics buffer 08097750: F000 bl 08097752: F8D0 bl 0x080978F4 08097754: 1C20 add r0, r4, #0x0 08097756: 3014 add r0, #0x14 ;r0 = #$0202DE44
08097758: F000 bl 0809775A: F97A bl 0x08097A50 ; ? (Some Register Setup) 0809775C: 22A0 mov r2, #0xA0 0809775E: 0052 lsl r2, r2, #0x1 08097760: 18A0 add r0, r4, r2 ;r0 = #$0202DF70 08097762: F000 bl 08097764: F9D3 bl 0x08097B0C ; ? 08097766: 1C20 add r0, r4, #0x0 08097768: 309C add r0, #0x9C ;r0 = #$0202DECC 0809776A: F004 bl 0809776C: F8DF bl 0x0809B92C ; ? 0809776E: 1C20 add r0, r4, #0x0 08097770: 30D0 add r0, #0xD0 ;r0 = #$0202DF00 08097772: F026 bl 08097774: FAFD bl 0x080BDD70 ; ? 08097776: 1C28 add r0, r5, #0x0 ;r0 = #$020326CC 08097778: F000 bl 0809777A: F818 bl 0x080977AC ; ? 0809777C: 68A0 ldr r0, [r4, #0x08] 0809777E: F026 bl 08097780: FFD5 bl 0x080BE72C ; ? 08097782: 68E0 ldr r0, [r4, #0x0C] 08097784: F027 bl 08097786: F83A bl 0x080BE7FC ; ? 08097788: BC18 pop {r3, r4} 0809778A: 4698 mov r8, r3 0809778C: 46A1 mov r9, r4 0809778E: BC70 pop {r4, r5, r6} 08097790: BC01 pop {r0} 08097792: 4700 bx r0 ;DATA ;=============== ;08097794: DE30 ??? ;08097796: 0202 lsl r2, r0, #0x8 ;08097798: 48A4 ldr r0, =#0x00004700 ;0809779A: 0000 lsl r0, r0, #0x0 ;0809779C: 489C ldr r0, =#0x01497809 ;0809779E: 0000 lsl r0, r0, #0x0 ;080977A0: 489E ldr r0, =#0x015222CE ;080977A2: 0000 lsl r0, r0, #0x0 ;080977A4: FFFF bl 0x080987A4 ;080977A6: 0000 lsl r0, r0, #0x0 ;080977A8: 48A5 ldr r0, =#0x81000258 ;080977AA: 0000 lsl r0, r0, #0x0
$080977AC - ?
r0 contains an address.
This is executed once in the intro, and when it is executed, the address in r0 is $020326CC.
080977AC: B500 push {lr} 080977AE: 1C02 add r2, r0, #0x0 080977B0: 7910 ldrb r0, [r2, #0x04] ; $020326D0 = Video Mode Decider(?) 080977B2: 2800 cmp r0, #0x00 ; If value is empty, leave out the flag-set-stuff and directly go to the subroutine 080977B4: D105 bne 0x080977C2 080977B6: 7A10 ldrb r0, [r2, #0x08] ; Load value from $020326D4 (Intro Flag register) 080977B8: 2120 mov r1, #0x20 ; Bit 5 080977BA: 4308 orr r0, r1 ; Set Flag for Title Screen Graphic data (done at $0809878C) 080977BC: 2140 mov r1, #0x40 ; Bit 6 080977BE: 4308 orr r0, r1 ; ??? 080977C0: 7210 strb r0, [r2, #0x08] ; Store back 080977C2: F000 bl 080977C4: FFE3 bl 0x0809878C ; Work off Set Flags 080977C6: BC01 pop {r0} 080977C8: 4700 bx r0 ;080977CA: 0000 lsl r0, r0, #0x0
$080977CC - Set Video Mode (Titlescreen/Intro)
This Subroutine can do three different things:
1) It sets the system to Video Mode 0
2) It sets the system to Video Mode 2 and clears all registers for Video Mode 2
3) It clears all registers for Video Mode 2 without setting Video Mode 2; I expect this to be used when it is sure that everything already is in Video Mode 2
This subroutine is controlled through a jump table. Funny fact is there are different jump table entries pointing to the same address. The only logical reason for this is that the variable for the Jump Table is periodically incremented and not set to a fixed value.
080977CC: B510 push {r4, lr} ; Preserve r4 and lr on stack 080977CE: 1C04 add r4, r0, #0x0 080977D0: 4805 ldr r0, =#0x0202DE30 080977D2: 4906 ldr r1, =#0x000048A0 080977D4: 1840 add r0, r0, r1 080977D6: 7800 ldrb r0, [r0] ; Load Byte from $020326D0 080977D8: 2804 cmp r0, #0x04 080977DA: D865 bhi 0x080978A8 ; Exit if Byte (Table Entry to jump at) is higher than 4... 080977DC: 0080 lsl r0, r0, #0x2 080977DE: 4904 ldr r1, =#0x080977F4 080977E0: 1840 add r0, r0, r1 080977E2: 6800 ldr r0, [r0] 080977E4: 4687 mov pc, r0 ; ... else, jump to an entry of the Table at $080977F4 ;DATA ;============ ;080977E6: 0000 lsl r0, r0, #0x0 ;080977E8: DE30 ??? ;080977EA: 0202 lsl r2, r0, #0x8 ;080977EC: 48A0 ldr r0, =#0x30028001 ;080977EE: 0000 lsl r0, r0, #0x0 ;080977F0: 77F4 strb r4, [r6, #0x1F] ;080977F2: 0809 lsr r1, r1, #0x0 ; ADDRESS TABLE: ; entry 00: $08097808 ; entry 01: $08097838 ; entry 02: $08097808 ; entry 03: $08097820 ; entry 04: $08097820 ;080977F4: 7808 ldrb r0, [r1] ;080977F6: 0809 lsr r1, r1, #0x0 ;080977F8: 7838 ldrb r0, [r7] ;080977FA: 0809 lsr r1, r1, #0x0 ;080977FC: 7808 ldrb r0, [r1] ;080977FE: 0809 lsr r1, r1, #0x0 ;08097800: 7820 ldrb r0, [r4] ;08097802: 0809 lsr r1, r1, #0x0 ;08097804: 7820 ldrb r0, [r4] ;08097806: 0809 lsr r1, r1, #0x0 ;entry 00/02 08097808: 2000 mov r0, #0x00 0809780A: F000 bl 0809780C: F853 bl 0x080978B4 ; ? 0809780E: 4803 ldr r0, =#0x0202DE30 08097810: 6801 ldr r1, [r0] ; Load offset of the Screen Settings 08097812: 8908 ldrh r0, [r1, #0x08] ; Buffer for $04000000 - DISPCNT - LCD Control 08097814: 2000 mov r0, #0x00 08097816: 8108 strh r0, [r1, #0x08] ; Set to Video Mode 0, disable all BGs/OBJ 08097818: E011 b 0x0809783E ;0809781A: 0000 lsl r0, r0, #0x0 ;0809781C: DE30 ??? ;0809781E: 0202 lsl r2, r0, #0x8 ; entry 03/4 08097820: 2001 mov r0, #0x01 08097822: F000 bl 08097824: F847 bl 0x080978B4 08097826: 4803 ldr r0, =#0x0202DE30 08097828: 6801 ldr r1, [r0] ; Load offset of the Screen Settings 0809782A: 8908 ldrh r0, [r1, #0x08] ; Buffer for $04000000 - DISPCNT - LCD Control 0809782C: 2002 mov r0, #0x02 0809782E: 8108 strh r0, [r1, #0x08] ; Set to Video Mode 2, disable all BGs/OBJ 08097830: E005 b 0x0809783E ;08097832: 0000 lsl r0, r0, #0x0 ;08097834: DE30 ??? ;08097836: 0202 lsl r2, r0, #0x8 ; entry 01 08097838: 2002 mov r0, #0x02 0809783A: F000 bl 0809783C: F83B bl 0x080978B4 0809783E: 4A1C ldr r2, =#0x0202DE30 08097840: 6813 ldr r3, [r2] ; Load offset of the Screen Settings 08097842: 8818 ldrh r0, [r3] ; $04000052 - BLDCNT - Color Special Effects Selection 08097844: 2100 mov r1, #0x00 08097846: 20FF mov r0, #0xFF 08097848: 8018 strh r0, [r3] ; Activate all(?) 0809784A: 6810 ldr r0, [r2] 0809784C: 8843 ldrh r3, [r0, #0x02] ; BLDALPHA - Alpha Blending Coefficients 0809784E: 8041 strh r1, [r0, #0x02] ; Store #$0000 08097850: 6812 ldr r2, [r2] 08097852: 8890 ldrh r0, [r2, #0x04] ; BLDY - Brightness (Fade-In/Out) Coefficient 08097854: 200F mov r0, #0x0F 08097856: 8090 strh r0, [r2, #0x04] ; Full Brightness 08097858: 8920 ldrh r0, [r4, #0x08] ; DISPCNT - LCD Control 0809785A: 8121 strh r1, [r4, #0x08] ; Set to Video Mode 0, disable all BGs/OBJ 0809785C: 8A60 ldrh r0, [r4, #0x12] ; BG0HOFS - BG0 X-Offset 0809785E: 8261 strh r1, [r4, #0x12] 08097860: 8AA0 ldrh r0, [r4, #0x14] ; BG0VOFS - BG0 Y-Offset 08097862: 82A1 strh r1, [r4, #0x14] 08097864: 8AE0 ldrh r0, [r4, #0x16] ; BG1HOFS - BG1 X-Offset 08097866: 82E1 strh r1, [r4, #0x16] 08097868: 8B20 ldrh r0, [r4, #0x18] ; BG1VOFS - BG1 Y-Offset 0809786A: 8321 strh r1, [r4, #0x18] 0809786C: 8B60 ldrh r0, [r4, #0x1A] ; BG2HOFS - BG2 X-Offset 0809786E: 8361 strh r1, [r4, #0x1A] 08097870: 8BA0 ldrh r0, [r4, #0x1C] ; BG2VOFS - BG2 Y-Offset 08097872: 83A1 strh r1, [r4, #0x1C] 08097874: 8BE0 ldrh r0, [r4, #0x1E] ; BG3HOFS - BG3 X-Offset 08097876: 83E1 strh r1, [r4, #0x1E] 08097878: 8C20 ldrh r0, [r4, #0x20] ; BG3VOFS - BG3 Y-Offset 0809787A: 8421 strh r1, [r4, #0x20] 0809787C: 8C60 ldrh r0, [r4, #0x22] ; BG2PA - BG2 Rotation/Scaling Parameter A (alias dx) 0809787E: 2080 mov r0, #0x80 08097880: 0040 lsl r0, r0, #0x1 08097882: 8460 strh r0, [r4, #0x22] ; Value is something just above 0 08097884: 8D62 ldrh r2, [r4, #0x2A] ; BG3PA - BG3 Rotation/Scaling Parameter A (alias dx) 08097886: 8560 strh r0, [r4, #0x2A] ; Value is something just above 0 08097888: 8CA2 ldrh r2, [r4, #0x24] ; BG2PB - BG2 Rotation/Scaling Parameter B (alias dmx) 0809788A: 84A1 strh r1, [r4, #0x24] 0809788C: 8DA2 ldrh r2, [r4, #0x2C] ; BG3PB - BG3 Rotation/Scaling Parameter B (alias dmx) 0809788E: 85A1 strh r1, [r4, #0x2C] 08097890: 8CE2 ldrh r2, [r4, #0x26] ; BG2PC - BG2 Rotation/Scaling Parameter C (alias dy) 08097892: 84E1 strh r1, [r4, #0x26] 08097894: 8DE2 ldrh r2, [r4, #0x2E] ; BG3PC - BG3 Rotation/Scaling Parameter C (alias dy) 08097896: 85E1 strh r1, [r4, #0x2E] 08097898: 8D22 ldrh r2, [r4, #0x28] ; BG2PC - BG2 Rotation/Scaling Parameter C (alias dy) 0809789A: 8520 strh r0, [r4, #0x28] 0809789C: 8E22 ldrh r2, [r4, #0x30] ; BG3PD - BG3 Rotation/Scaling Parameter D (alias dmy) 0809789E: 8620 strh r0, [r4, #0x30] 080978A0: 6361 str r1, [r4, #0x34] ; BG2X_L - BG2 Reference Point X-Coordinate, lower 16 bit 080978A2: 63A1 str r1, [r4, #0x38] ; BG2X_H - BG2 Reference Point X-Coordinate, upper 12 bit 080978A4: 63E1 str r1, [r4, #0x3C] ; BG3X_L - BG3 Reference Point X-Coordinate, lower 16 bit 080978A6: 6421 str r1, [r4, #0x40] ; BG3X_H - BG3 Reference Point X-Coordinate, upper 12 bit ; Higher than 04 080978A8: BC10 pop {r4} 080978AA: BC01 pop {r0} 080978AC: 4700 bx r0 ;080978AE: 0000 lsl r0, r0, #0x0 ;080978B0: DE30 ??? ;080978B2: 0202 lsl r2, r0, #0x8
$080978B4 - Set BG Controls in Screen Settings Buffer
r0 contains an Index for a table at $080C2438 (each entry is 8 Bytes in Size).
The bytes in this table are transferred in the Buffer for the BG Control Registers ($04000008/A/C/E).
080978B4: B510 push {r4, lr} 080978B6: 0400 lsl r0, r0, #0x10 080978B8: 0B40 lsr r0, r0, #0xD ; r0 = r0 * 8 (remove Upper Double Byte) 080978BA: 490C ldr r1, =#0x080C2438 080978BC: 1840 add r0, r0, r1 080978BE: 4B0C ldr r3, =#0x0202DE30 080978C0: 6819 ldr r1, [r3] 080978C2: 8802 ldrh r2, [r0] 080978C4: 894C ldrh r4, [r1, #0x0A] 080978C6: 814A strh r2, [r1, #0x0A] ; BG1CNT - BG1 Control 080978C8: 3002 add r0, #0x02 080978CA: 6819 ldr r1, [r3] 080978CC: 8802 ldrh r2, [r0] 080978CE: 898C ldrh r4, [r1, #0x0C] 080978D0: 818A strh r2, [r1, #0x0C] ; BG1CNT - BG1 Control 080978D2: 3002 add r0, #0x02 080978D4: 6819 ldr r1, [r3] 080978D6: 8802 ldrh r2, [r0] 080978D8: 89CC ldrh r4, [r1, #0x0E] 080978DA: 81CA strh r2, [r1, #0x0E] ; BG2CNT - BG2 Control 080978DC: 6819 ldr r1, [r3] 080978DE: 8840 ldrh r0, [r0, #0x02] 080978E0: 8A0A ldrh r2, [r1, #0x10] 080978E2: 8208 strh r0, [r1, #0x10] ; BG3CNT - BG3 Control 080978E4: BC10 pop {r4} 080978E6: BC01 pop {r0} 080978E8: 4700 bx r0 ;080978EA: 0000 lsl r0, r0, #0x0 ;080978EC: 2438 mov r4, #0x38 ;080978EE: 080C lsr r4, r1, #0x0 ;080978F0: DE30 ??? ;080978F2: 0202 lsl r2, r0, #0x8
$080978F4 - (Graphics Buffer clearing?)
When this is called from $080976DC (I don't know if it is ever called from somewhere else), r0 contains the value from $0202DE34, which is the address of the graphics buffer (should be $0203CAD0).
This is only executed once, when the Intro is first loaded.
$0203E9D8-A get all get set to #$1F, $0203E490 = #$7FFF (set Color No. 0 in the Palette RAM buffer to white)
080978F4: B530 push {r4, r5, lr} 080978F6: B081 add sp, #-0x004 080978F8: 1C05 add r5, r0, #0x0 ; Transfer address of the graphics buffer in r5 080978FA: 21F8 mov r1, #0xF8 080978FC: 0149 lsl r1, r1, #0x5 ; r1 = #$00001F00 080978FE: 1868 add r0, r5, r1 ; r0 = Flag register 08097900: 7801 ldrb r1, [r0] 08097902: 2100 mov r1, #0x00 08097904: 7001 strb r1, [r0] ; Clear Flag register 1 08097906: 4A4A ldr r2, =#0x00001F01 08097908: 18A8 add r0, r5, r2 0809790A: 7802 ldrb r2, [r0] 0809790C: 7001 strb r1, [r0] ; Clear Flag register 2 0809790E: 4C49 ldr r4, =#0x00001F02 08097910: 1928 add r0, r5, r4 08097912: 7802 ldrb r2, [r0] 08097914: 7001 strb r1, [r0] ; Clear Flag register 3 08097916: 4A48 ldr r2, =#0x00001F03 08097918: 18A8 add r0, r5, r2 0809791A: 7802 ldrb r2, [r0] 0809791C: 7001 strb r1, [r0] ; Clear Flag register 4 0809791E: 4668 mov r0, sp 08097920: 8001 strh r1, [r0] ; Clear newly created Stack entry 08097922: 4846 ldr r0, =#0x040000D4 08097924: 466C mov r4, sp 08097926: 6004 str r4, [r0] ; Use Stack entry as source for a fixed DMA (Clear DMA) 08097928: 6045 str r5, [r0, #0x04] ; Destination Address: Graphics buffer start point 0809792A: 4945 ldr r1, =#0x81000258 0809792C: 6081 str r1, [r0, #0x08] ; Fixed transfer for $258 double bytes 0809792E: 6881 ldr r1, [r0, #0x08] 08097930: 1C02 add r2, r0, #0x0 08097932: 6890 ldr r0, [r2, #0x08] 08097934: 2180 mov r1, #0x80 08097936: 0609 lsl r1, r1, #0x18 08097938: 2800 cmp r0, #0x00 0809793A: DA03 bge 0x08097944 ; Branch if DMA is finished 0809793C: 6890 ldr r0, [r2, #0x08] 0809793E: 4008 and r0, r1 08097940: 2800 cmp r0, #0x00 08097942: D1FB bne 0x0809793C ; Loop if DMA is not finished 08097944: 4669 mov r1, sp 08097946: 2000 mov r0, #0x00 08097948: 8008 strh r0, [r1] ; Clear Stack Entry (again) 0809794A: 493C ldr r1, =#0x040000D4 0809794C: 4668 mov r0, sp 0809794E: 6008 str r0, [r1] ; DMA source: Stack entry 08097950: 2296 mov r2, #0x96 08097952: 00D2 lsl r2, r2, #0x3 08097954: 18A8 add r0, r5, r2 08097956: 6048 str r0, [r1, #0x04] ; DMA Destination: $0203CF80 08097958: 4839 ldr r0, =#0x81000258 0809795A: 6088 str r0, [r1, #0x08] ; Transfer $258 Doublebytes, Fixed Transfer 0809795C: 6888 ldr r0, [r1, #0x08] 0809795E: 6888 ldr r0, [r1, #0x08] 08097960: 2280 mov r2, #0x80 08097962: 0612 lsl r2, r2, #0x18 08097964: 2800 cmp r0, #0x00 08097966: DA03 bge 0x08097970 08097968: 6888 ldr r0, [r1, #0x08] 0809796A: 4010 and r0, r2 0809796C: 2800 cmp r0, #0x00 0809796E: D1FB bne 0x08097968 ; Loop until DMA is done 08097970: 4669 mov r1, sp 08097972: 2000 mov r0, #0x00 08097974: 8008 strh r0, [r1] ; Clear Stack Entry (again) 08097976: 4931 ldr r1, =#0x040000D4 08097978: 466C mov r4, sp 0809797A: 600C str r4, [r1] ; DMA source: Stack entry 0809797C: 2296 mov r2, #0x96 0809797E: 0112 lsl r2, r2, #0x4 ; DMA Destination: $0203D430 08097980: 18A8 add r0, r5, r2 08097982: 6048 str r0, [r1, #0x04] 08097984: 482E ldr r0, =#0x81000258 08097986: 6088 str r0, [r1, #0x08] ; Transfer $258 Doublebytes, Fixed Transfer 08097988: 6888 ldr r0, [r1, #0x08] 0809798A: 6888 ldr r0, [r1, #0x08] 0809798C: 2280 mov r2, #0x80 0809798E: 0612 lsl r2, r2, #0x18 08097990: 2800 cmp r0, #0x00 08097992: DA03 bge 0x0809799C 08097994: 6888 ldr r0, [r1, #0x08] 08097996: 4010 and r0, r2 08097998: 2800 cmp r0, #0x00 0809799A: D1FB bne 0x08097994 ; Loop until DMA is done 0809799C: 4669 mov r1, sp 0809799E: 2000 mov r0, #0x00 080979A0: 8008 strh r0, [r1] ; Clear Stack Entry (again) 080979A2: 4926 ldr r1, =#0x040000D4 080979A4: 466C mov r4, sp 080979A6: 600C str r4, [r1] ; DMA source: Stack entry 080979A8: 22E1 mov r2, #0xE1 080979AA: 0112 lsl r2, r2, #0x4 080979AC: 18A8 add r0, r5, r2 080979AE: 6048 str r0, [r1, #0x04] ; DMA Destination: $0203D8E0 080979B0: 4823 ldr r0, =#0x81000258 080979B2: 6088 str r0, [r1, #0x08] ; Transfer $258 Doublebytes, Fixed Transfer 080979B4: 6888 ldr r0, [r1, #0x08] 080979B6: 6888 ldr r0, [r1, #0x08] 080979B8: 2280 mov r2, #0x80 080979BA: 0612 lsl r2, r2, #0x18 080979BC: 2800 cmp r0, #0x00 080979BE: DA03 bge 0x080979C8 080979C0: 6888 ldr r0, [r1, #0x08] 080979C2: 4010 and r0, r2 080979C4: 2800 cmp r0, #0x00 080979C6: D1FB bne 0x080979C0 ; Loop until DMA is done ; Clear DMA for Palette RAM 080979C8: 4669 mov r1, sp 080979CA: 2000 mov r0, #0x00 080979CC: 8008 strh r0, [r1] ; Clear Stack Entry (again) 080979CE: 491B ldr r1, =#0x040000D4 080979D0: 466C mov r4, sp 080979D2: 600C str r4, [r1] ; DMA source: Stack entry 080979D4: 22CE mov r2, #0xCE 080979D6: 0152 lsl r2, r2, #0x5 080979D8: 18A8 add r0, r5, r2 080979DA: 6048 str r0, [r1, #0x04] ; DMA Destination: $0203E490 080979DC: 4819 ldr r0, =#0x81000200 080979DE: 6088 str r0, [r1, #0x08] ; Transfer $200 Doublebytes, Fixed Transfer 080979E0: 6888 ldr r0, [r1, #0x08] 080979E2: 6888 ldr r0, [r1, #0x08] 080979E4: 2280 mov r2, #0x80 080979E6: 0612 lsl r2, r2, #0x18 080979E8: 2800 cmp r0, #0x00 080979EA: DA03 bge 0x080979F4 080979EC: 6888 ldr r0, [r1, #0x08] 080979EE: 4010 and r0, r2 080979F0: 2800 cmp r0, #0x00 080979F2: D1FB bne 0x080979EC ; Loop until DMA is done 080979F4: 4C14 ldr r4, =#0x00001F08 080979F6: 192B add r3, r5, r4 080979F8: 7818 ldrb r0, [r3] 080979FA: 201F mov r0, #0x1F 080979FC: 7018 strb r0, [r3] ; $0203E9D8 = #$1F 080979FE: 4A13 ldr r2, =#0x00001F09 08097A00: 18A9 add r1, r5, r2 08097A02: 780A ldrb r2, [r1] 08097A04: 7008 strb r0, [r1] ; $0203E9D9 = #$1F 08097A06: 3402 add r4, #0x02 08097A08: 192A add r2, r5, r4 08097A0A: 7814 ldrb r4, [r2] 08097A0C: 7010 strb r0, [r2] ; $0203E9DA = #$1F 08097A0E: 7818 ldrb r0, [r3] 08097A10: 7809 ldrb r1, [r1] 08097A12: 0149 lsl r1, r1, #0x5 08097A14: 4301 orr r1, r0 ; r1 = #$03FF 08097A16: 7810 ldrb r0, [r2] 08097A18: 0280 lsl r0, r0, #0xA 08097A1A: 4301 orr r1, r0 ; r1 = #$7FFF 08097A1C: 22CE mov r2, #0xCE 08097A1E: 0152 lsl r2, r2, #0x5 08097A20: 18A8 add r0, r5, r2 ; r0 = $0203E490 08097A22: 8802 ldrh r2, [r0] 08097A24: 8001 strh r1, [r0] ; $0203E490 = #$7FFF 08097A26: B001 add sp, #0x004 08097A28: BC30 pop {r4, r5} 08097A2A: BC01 pop {r0} 08097A2C: 4700 bx r0 ;08097A2E: 0000 lsl r0, r0, #0x0 ;08097A30: 1F01 sub r1, r0, #0x4 ;08097A32: 0000 lsl r0, r0, #0x0 ;08097A34: 1F02 sub r2, r0, #0x4 ;08097A36: 0000 lsl r0, r0, #0x0 ;08097A38: 1F03 sub r3, r0, #0x4 ;08097A3A: 0000 lsl r0, r0, #0x0 ;08097A3C: 00D4 lsl r4, r2, #0x3 ;08097A3E: 0400 lsl r0, r0, #0x10 ;08097A40: 0258 lsl r0, r3, #0x9 ;08097A42: 8100 strh r0, [r0, #0x08] ;08097A44: 0200 lsl r0, r0, #0x8 ;08097A46: 8100 strh r0, [r0, #0x08] ;08097A48: 1F08 sub r0, r1, #0x4 ;08097A4A: 0000 lsl r0, r0, #0x0 ;08097A4C: 1F09 sub r1, r1, #0x4 ;08097A4E: 0000 lsl r0, r0, #0x0
$08097A50 - (Register clearing, jump to Register Setup)
(As far as I can see it, this subroutine is only called from $080976DC. In that case, r0 is always = #$0202DE44, so I wrote all the comments here under the assumption that r0 = #$0202DE44. In the unlikely case that this is executed from elsewhere with a different value, you have to re-calculate the corresponding addresses.)
This subroutine
- clears a whole lot of addresses
- Sets $0202DEBA to #$00 or #$01, depending on the corresponding status of Bit 0 of $0203CAA2.
- Jumps to a subroutine
08097A50: B500 push {lr} 08097A52: 1C03 add r3, r0, #0x0 ; r3 = #$0202DE44 (Orig. r0) 08097A54: 1C1A add r2, r3, #0x0 08097A56: 3280 add r2, #0x80 ; r2 = #$0202DEC4 (Orig. r0 + #$80) 08097A58: 2100 mov r1, #0x00 08097A5A: 2003 mov r0, #0x03 08097A5C: 7010 strb r0, [r2] ; $0202DEC4 = #$03 08097A5E: 6699 str r1, [r3, #0x68] ; $0202DEAC-F = #$00000000 08097A60: 66D9 str r1, [r3, #0x6C] ; $0202DEB0-3 = #$00000000 08097A62: 6719 str r1, [r3, #0x70] ; $0202DEB4-7 = #$00000000 08097A64: 1C18 add r0, r3, #0x0 08097A66: 3081 add r0, #0x81 ; r0 = $0202DEC5 (Orig. r0 + #$81) 08097A68: 7001 strb r1, [r0] ; $0202DEC5 = #$00 08097A6A: 3809 sub r0, #0x09 08097A6C: 8001 strh r1, [r0] ; $0202DEBC-D = #$0000 08097A6E: 3002 add r0, #0x02 08097A70: 8001 strh r1, [r0] ; $0202DEBE-F = #$0000 08097A72: 3002 add r0, #0x02 08097A74: 8001 strh r1, [r0] ; $0202DEC0-1 = #$0000 08097A76: 3002 add r0, #0x02 08097A78: 8001 strh r1, [r0] ; $0202DEC2-3 = #$0000 08097A7A: 3204 add r2, #0x04 08097A7C: 2000 mov r0, #0x00 08097A7E: 7010 strb r0, [r2] ; $0202DEC8 = #$00 08097A80: 1C18 add r0, r3, #0x0 08097A82: 3074 add r0, #0x74 08097A84: 8001 strh r1, [r0] ; $0202DEB8/9 = #$0000 08097A86: 4807 ldr r0, =#0x0202DE30 08097A88: 6900 ldr r0, [r0, #0x10] ; r0 = [$0202DE40] = #$0203BC10 (by default) 08097A8A: 4907 ldr r1, =#0x00000E92 08097A8C: 1840 add r0, r0, r1 08097A8E: 7800 ldrb r0, [r0] ; r0 = [$0203CAA2] 08097A90: 2201 mov r2, #0x01 08097A92: 1C11 add r1, r2, #0x0 08097A94: 4001 and r1, r0 08097A96: 2900 cmp r1, #0x00 08097A98: D008 beq 0x08097AAC ; Branch if Bit 0 of $0203CAA2 is clear 08097A9A: 1C18 add r0, r3, #0x0 08097A9C: 3076 add r0, #0x76 08097A9E: 8002 strh r2, [r0] ; $0202DEBA = #$01 08097AA0: E007 b 0x08097AB2 ;08097AA2: 0000 lsl r0, r0, #0x0 ;08097AA4: DE30 ??? ;08097AA6: 0202 lsl r2, r0, #0x8 ;08097AA8: 0E92 lsr r2, r2, #0x1A ;08097AAA: 0000 lsl r0, r0, #0x0 ;08097AA2: 0000 lsl r0, r0, #0x0 ;08097AA4: DE30 ??? ;08097AA6: 0202 lsl r2, r0, #0x8 ;08097AA8: 0E92 lsr r2, r2, #0x1A ;08097AAA: 0000 lsl r0, r0, #0x0 08097AAC: 1C18 add r0, r3, #0x0 08097AAE: 3076 add r0, #0x76 08097AB0: 8001 strh r1, [r0] ; $0202DEBA = #$00 08097AB2: 1C18 add r0, r3, #0x0 08097AB4: 3030 add r0, #0x30 ; r0 = #$0202DE74 08097AB6: F000 bl 08097AB8: F803 bl 0x08097AC0 ; ? 08097ABA: BC01 pop {r0} 08097ABC: 4700 bx r0 08097ABE: 0000 lsl r0, r0, #0x0
$08097AC0 - (Register Setup)
(As far as I can see it, this subroutine is only called from $08097A50. In that case, r0 is always = #$0202DE74, so I wrote all the comments here under the assumption that r0 = #$0202DE44. In the unlikely case that this is executed from elsewhere with a different value, you have to re-calculate the corresponding addresses.)
08097AC0: 2100 mov r1, #0x00 08097AC2: 7201 strb r1, [r0, #0x08] ; $0202DE7C = #$00 08097AC4: 2201 mov r2, #0x01 08097AC6: 7602 strb r2, [r0, #0x18] ; $0202DE8C = #$01 08097AC8: 490D ldr r1, =#0x06000040 08097ACA: 6001 str r1, [r0] ; $0202DE74-7 = #$06000040 08097ACC: 490D ldr r1, =#0x06008040 08097ACE: 6101 str r1, [r0, #0x10] ; $0202DE84-7 = #$06080040 08097AD0: 2100 mov r1, #0x00 08097AD2: 8082 strh r2, [r0, #0x04] ; $0202DE78/9 = #$0001 08097AD4: 8282 strh r2, [r0, #0x14] ; $0202DE88/9 = #$0001 08097AD6: 7241 strb r1, [r0, #0x09] ; $0202DE7D = #$00 08097AD8: 2108 mov r1, #0x08 08097ADA: 7641 strb r1, [r0, #0x19] ; $0202DE8D = #$00 08097ADC: 2202 mov r2, #0x02 08097ADE: 7282 strb r2, [r0, #0x0A] ; $0202DE7E = #$02 08097AE0: 2103 mov r1, #0x03 08097AE2: 7681 strb r1, [r0, #0x1A] ; $0202DE8E = #$03 08097AE4: 72C2 strb r2, [r0, #0x0B] ; $0202DE8F = #$02 08097AE6: 76C1 strb r1, [r0, #0x1B] ; $0202DE8F = #$03 08097AE8: 7301 strb r1, [r0, #0x0C] ; $0202DE90 = #$03 08097AEA: 7702 strb r2, [r0, #0x1C] ; $0202DEA0 = #$02 08097AEC: 4906 ldr r1, =#0x00000844 08097AEE: 80C1 strh r1, [r0, #0x06] ; $0202DE7A/B = #$0844 08097AF0: 2189 mov r1, #0x89 08097AF2: 00C9 lsl r1, r1, #0x3 08097AF4: 82C1 strh r1, [r0, #0x16] ; $0202DE8A/B = #$0448 08097AF6: 1C01 add r1, r0, #0x0 08097AF8: 3110 add r1, #0x10 08097AFA: 6201 str r1, [r0, #0x20] ; $0202DE94 = #$0202DE84 08097AFC: 4770 bx lr ;08097AFE: 0000 lsl r0, r0, #0x0 ;08097B00: 0040 lsl r0, r0, #0x1 ;08097B02: 0600 lsl r0, r0, #0x18 ;08097B04: 8040 strh r0, [r0, #0x02] ;08097B06: 0600 lsl r0, r0, #0x18 ;08097B08: 0844 lsr r4, r0, #0x1 ;08097B0A: 0000 lsl r0, r0, #0x0
$08097B0C - (Register Setup)
(As far as I can see it, this subroutine is only called from $080976DC. In that case, r0 is always = #$0202DF70, so I wrote all the comments here under the assumption that r0 = #$0202DF70. In the unlikely case that this is executed from elsewhere with a different value, you have to re-calculate the corresponding addresses.)
This subroutine
- clears $020326C8 to $020326CA
- jumps to a subroutine
08097B0C: B510 push {r4, lr} 08097B0E: 4A08 ldr r2, =#0x00004758 08097B10: 1881 add r1, r0, r2 ; r1 = #$020326C8 08097B12: 2300 mov r3, #0x00 08097B14: 2200 mov r2, #0x00 08097B16: 800A strh r2, [r1] ; $020326C8/9 = #$0000 08097B18: 4C06 ldr r4, =#0x0000475A 08097B1A: 1901 add r1, r0, r4 08097B1C: 700B strb r3, [r1] ; $020326CA = #$00 08097B1E: 4B06 ldr r3, =#0x00004754 08097B20: 18C1 add r1, r0, r3 08097B22: 600A str r2, [r1] ; $020326C4-7 = #$00000000 08097B24: F000 bl 08097B26: F80A bl 0x08097B3C 08097B28: BC10 pop {r4} 08097B2A: BC01 pop {r0} 08097B2C: 4700 bx r0 ;08097B2E: 0000 lsl r0, r0, #0x0 ;08097B30: 4758 bx r11 ;08097B32: 0000 lsl r0, r0, #0x0 ;08097B34: 475A bx r11 ;08097B36: 0000 lsl r0, r0, #0x0 ;08097B38: 4754 bx r10 ;08097B3A: 0000 lsl r0, r0, #0x0
$08097B3C - (Register Setup)
(As far as I can see it, this subroutine is only called from $08097B0C. In that case, r0 is always = #$0202DF70, so I wrote all the comments here under the assumption that r0 = #$0202DF70. In the unlikely case that this is executed from elsewhere with a different value, you have to re-calculate the corresponding addresses.)
08097B3C: B510 push {r4, lr} 08097B3E: 4A11 ldr r2, =#0x00004408 08097B40: 1881 add r1, r0, r2 08097B42: 2200 mov r2, #0x00 08097B44: 700A strb r2, [r1] ; $02032378 = #$00 08097B46: 4C10 ldr r4, =#0x00004414 08097B48: 1903 add r3, r0, r4 08097B4A: 2101 mov r1, #0x01 08097B4C: 7019 strb r1, [r3] ; $02032384 = #$01 08097B4E: 4B0F ldr r3, =#0x00004409 08097B50: 18C1 add r1, r0, r3 08097B52: 700A strb r2, [r1] ; $02032379 = #$00 08097B54: 3401 add r4, #0x01 08097B56: 1901 add r1, r0, r4 08097B58: 700A strb r2, [r1] ; $02032385 = #$00 08097B5A: 2188 mov r1, #0x88 08097B5C: 01C9 lsl r1, r1, #0x7 08097B5E: 1843 add r3, r0, r1 ; r3 = #$02032370 08097B60: 3407 add r4, #0x07 08097B62: 1902 add r2, r0, r4 08097B64: 601A str r2, [r3] ; $0203238C-F = #$0202DF77 08097B66: 3C18 sub r4, #0x18 08097B68: 1901 add r1, r0, r4 08097B6A: 600A str r2, [r1] ; $02032374-7 = #$0202DF77 08097B6C: 3408 add r4, #0x08 08097B6E: 1901 add r1, r0, r4 08097B70: 600A str r2, [r1] ; $0203237C-F = #$0202DF77 08097B72: 3404 add r4, #0x04 08097B74: 1901 add r1, r0, r4 08097B76: 600A str r2, [r1] ; $02032380-3 = #$0202DF77 08097B78: 4905 ldr r1, =#0x00004418 08097B7A: 1840 add r0, r0, r1 08097B7C: 6003 str r3, [r0] ; $02032388-B = #$02032370 08097B7E: BC10 pop {r4} 08097B80: BC01 pop {r0} 08097B82: 4700 bx r0 ;08097B84: 4408 add r0, r1 ;08097B86: 0000 lsl r0, r0, #0x0 ;08097B88: 4414 add r4, r2 ;08097B8A: 0000 lsl r0, r0, #0x0 ;08097B8C: 4409 add r1, r1 ;08097B8E: 0000 lsl r0, r0, #0x0 ;08097B90: 4418 add r0, r3 ;08097B92: 0000 lsl r0, r0, #0x0
$08097B94 - Load Title Screen Graphic data
08097B94: B500 push {lr} 08097B96: F000 bl 08097B98: F805 bl 0x08097BA4 ; Load Title Screen (Sky/Castle) Graphic Data 08097B9A: F000 bl 08097B9C: F82F bl 0x08097BFC ; Load Title Screen (Game Title) Graphic Data 08097B9E: BC01 pop {r0} 08097BA0: 4700 bx r0 ;08097BA2: 0000 lsl r0, r0, #0x0
$08097BA4 - Load Title (Sky/Castle) Graphic Data
Loads the Sky/Castle Graphic Data.
08097BA4: B510 push {r4, lr} 08097BA6: 4C12 ldr r4, =#0x08699AA4 ; Graphic Data Table address 08097BA8: 1C20 add r0, r4, #0x0 08097BAA: 2106 mov r1, #0x06 ; Load Graphic Data Table entry #$06 08097BAC: F026 bl 08097BAE: FBC0 bl 0x080BE330 ; Calculate address of the Compressed Sky/Castle Tiles 08097BB0: 21C0 mov r1, #0xC0 08097BB2: 04C9 lsl r1, r1, #0x13 ; Destination Address: $06000000 (VRAM) 08097BB4: F027 bl 08097BB6: FEFE bl 0x080BF9B4 ; swi LZ77UnCompVram (decompress and transfer to VRAM) 08097BB8: 1C20 add r0, r4, #0x0 08097BBA: 2107 mov r1, #0x07 ; Load Graphic Data Table entry #$07 08097BBC: F026 bl 08097BBE: FBB8 bl 0x080BE330 ; Calculate address of the Compressed Sky/Castle Colors 08097BC0: 2280 mov r2, #0x80 08097BC2: 0092 lsl r2, r2, #0x2 ; Number of Bytes to transfer: #$200 08097BC4: 2100 mov r1, #0x00 08097BC6: F004 bl 08097BC8: FE57 bl 0x0809C878 ; Transfer palette in Palette RAM Buffer 08097BCA: 1C20 add r0, r4, #0x0 08097BCC: 2108 mov r1, #0x08 ; Load Graphic Data Table entry #$08 08097BCE: F026 bl 08097BD0: FBAF bl 0x080BE330 ; Load address from Address Table 08097BD2: 2101 mov r1, #0x01 ; Screenfilling Tilemap Builder Destination: BG1 08097BD4: 2200 mov r2, #0x00 ; No addition to each tile 08097BD6: F000 bl 08097BD8: FB19 bl 0x0809820C ; Screenfilling Tilemap Builder 08097BDA: 4806 ldr r0, =#0x0202DE30 08097BDC: 6840 ldr r0, [r0, #0x04] 08097BDE: 4906 ldr r1, =#0x00001F01 08097BE0: 1840 add r0, r0, r1 ; r0 = #$0203FD31 08097BE2: 7801 ldrb r1, [r0] 08097BE4: 2101 mov r1, #0x01 08097BE6: 7001 strb r1, [r0] ; Seems like some kind of Flag-like register? 08097BE8: BC10 pop {r4} 08097BEA: BC01 pop {r0} 08097BEC: 4700 bx r0 ;DATA ;============ ;08097BEE: 0000 lsl r0, r0, #0x0 ;08097BF0: 9AA4 ldr r2, [sp, #0x290] ;08097BF2: 0869 lsr r1, r5, #0x1 ;08097BF4: DE30 ??? ;08097BF6: 0202 lsl r2, r0, #0x8 ;08097BF8: 1F01 sub r1, r0, #0x4 ;08097BFA: 0000 lsl r0, r0, #0x0
$08097BFC - Load Title Screen (Game Title) Graphic Data
08097BFC: B510 push {r4, lr} 08097BFE: 4C23 ldr r4, =#0x08699AA4 08097C00: 1C20 add r0, r4, #0x0 ; Setup Address Table address in r0 08097C02: 2100 mov r1, #0x00 ; Address Table entry number to load 08097C04: F026 bl 08097C06: FB94 bl 0x080BE330 ; Load address from Address Table (The "MAGICAL VACATION" logo) 08097C08: 4921 ldr r1, =#0x06010000 08097C0A: F027 bl 08097C0C: FED3 bl 0x080BF9B4 ; swi LZ77UnCompVram 08097C0E: 1C20 add r0, r4, #0x0 ; Restore Address Table address 08097C10: 2101 mov r1, #0x01 ; Address Table entry number to load 08097C12: F026 bl 08097C14: FB8D bl 0x080BE330 ; Load address from Address Table (Title Screen Menu "Plates" 1/2) 08097C16: 491F ldr r1, =#0x06012000 08097C18: F027 bl 08097C1A: FECC bl 0x080BF9B4 ; swi LZ77UnCompVram 08097C1C: 1C20 add r0, r4, #0x0 ; Restore Address Table address 08097C1E: 2102 mov r1, #0x02 ; Address Table entry number to load 08097C20: F026 bl 08097C22: FB86 bl 0x080BE330 ; Load address from Address Table (Title Screen Menu "Plates" 2/2) 08097C24: 491C ldr r1, =#0x06015000 08097C26: F027 bl 08097C28: FEC5 bl 0x080BF9B4 ; swi LZ77UnCompVram 08097C2A: 1C20 add r0, r4, #0x0 ; Restore Address Table address 08097C2C: 2103 mov r1, #0x03 ; Address Table entry number to load 08097C2E: F026 bl 08097C30: FB7F bl 0x080BE330 ; Load address from Address Table (Color Data) 08097C32: 2110 mov r1, #0x10 ; Start Color Transfer at Palette #$10 08097C34: 2260 mov r2, #0x60 ; Transfer #$60 bytes (3 Palettes) 08097C36: F004 bl 08097C38: FE1F bl 0x0809C878 ; DMA to Palette RAM Buffer 08097C3A: 1C20 add r0, r4, #0x0 ; Restore Address Table address 08097C3C: 2104 mov r1, #0x04 ; Address Table entry number to load 08097C3E: F026 bl 08097C40: FB77 bl 0x080BE330 ; Load address from Address Table (Don't know which data) 08097C42: 4916 ldr r1, =#0x06016000 08097C44: F027 bl 08097C46: FEB6 bl 0x080BF9B4 ; swi LZ77UnCompVram 08097C48: 1C20 add r0, r4, #0x0 ; Restore Address Table address 08097C4A: 2105 mov r1, #0x05 ; Address Table entry number to load 08097C4C: F026 bl 08097C4E: FB70 bl 0x080BE330 ; Load address from Address Table (Color Data) 08097C50: 2113 mov r1, #0x13 ; Start Color Transfer at Palette #$13 08097C52: 2220 mov r2, #0x20 ; Transfer #$20 bytes (1 Palette) 08097C54: F004 bl 08097C56: FE10 bl 0x0809C878 ; DMA to Palette RAM Buffer 08097C58: 4911 ldr r1, =#0x040000D4 08097C5A: 4812 ldr r0, =#0x0861394C 08097C5C: 6008 str r0, [r1] ; DMA Source Address: $0861394C 08097C5E: 4812 ldr r0, =#0x06014F80 08097C60: 6048 str r0, [r1, #0x04] ; DMA Destination Address: $06014F80 08097C62: 4812 ldr r0, =#0x80000040 08097C64: 6088 str r0, [r1, #0x08] ; Transfer #$40 Doublebytes, start DMA 08097C66: 6888 ldr r0, [r1, #0x08] 08097C68: 6888 ldr r0, [r1, #0x08] 08097C6A: 2280 mov r2, #0x80 08097C6C: 0612 lsl r2, r2, #0x18 ; AND-Mask for DMA Enable Bit 08097C6E: 2800 cmp r0, #0x00 08097C70: DA03 bge 0x08097C7A ; Branch if DMA is completed 08097C72: 6888 ldr r0, [r1, #0x08] 08097C74: 4010 and r0, r2 08097C76: 2800 cmp r0, #0x00 08097C78: D1FB bne 0x08097C72 ; Loop if DMA is not completed 08097C7A: 480D ldr r0, =#0x086143EC ; Address of a Palette 08097C7C: 2114 mov r1, #0x14 ; Start Color Transfer at Palette #$14 08097C7E: 2220 mov r2, #0x20 ; Transfer #$20 bytes (1 Palette) 08097C80: F004 bl 08097C82: FDFA bl 0x0809C878 ; DMA to Palette RAM Buffer 08097C84: BC10 pop {r4} 08097C86: BC01 pop {r0} 08097C88: 4700 bx r0 ;DATA ;============= ;08097C8A: 0000 lsl r0, r0, #0x0 ;08097C8C: 9AA4 ldr r2, [sp, #0x290] ;08097C8E: 0869 lsr r1, r5, #0x1 ;08097C90: 0000 lsl r0, r0, #0x0 ;08097C92: 0601 lsl r1, r0, #0x18 ;08097C94: 2000 mov r0, #0x00 ;08097C96: 0601 lsl r1, r0, #0x18 ;08097C98: 5000 str r0, [r0, r0] ;08097C9A: 0601 lsl r1, r0, #0x18 ;08097C9C: 6000 str r0, [r0] ;08097C9E: 0601 lsl r1, r0, #0x18 ;08097CA0: 00D4 lsl r4, r2, #0x3 ;08097CA2: 0400 lsl r0, r0, #0x10 ;08097CA4: 394C sub r1, #0x4C ;08097CA6: 0861 lsr r1, r4, #0x1 ;08097CA8: 4F80 ldr r7, =#0x0C000400 ;08097CAA: 0601 lsl r1, r0, #0x18 ;08097CAC: 0040 lsl r0, r0, #0x1 ;08097CAE: 8000 strh r0, [r0] ;08097CB0: 43EC mvn r4, r5 ;08097CB2: 0861 lsr r1, r4, #0x1
$08097CB4 - Load scrolled Title Screen Tilemap
r0 contains the number of rows the Title Screen has to scroll down.
After this, a flag gets set.
08097CB4: B510 push {r4, lr} 08097CB6: 1C04 add r4, r0, #0x0 08097CB8: 0424 lsl r4, r4, #0x10 08097CBA: 0C24 lsr r4, r4, #0x10 ; Transfer value from r0 to r4 and remove upper doublebyte 08097CBC: 480A ldr r0, =#0x08699AA4 08097CBE: 2108 mov r1, #0x08 08097CC0: F026 bl 08097CC2: FB36 bl 0x080BE330 ; Load address of the Title Tilemap 08097CC4: 0121 lsl r1, r4, #0x4 08097CC6: 1B09 sub r1, r1, r4 08097CC8: 0089 lsl r1, r1, #0x2 ; r1 = Thirty times Orig. r0 08097CCA: 1840 add r0, r0, r1 ; Add ti the Tilemap address (shifts the start point of the tilemap address Orig.-r0-lines down) 08097CCC: 2101 mov r1, #0x01 ; Screenfilling Tilemap builder Destination: BG1 08097CCE: 2200 mov r2, #0x00 ; No addition to the tilemap entries 08097CD0: F000 bl 08097CD2: FA9C bl 0x0809820C ; Screenfilling Tilemap builder 08097CD4: 4805 ldr r0, =#0x0202DE30 08097CD6: 6840 ldr r0, [r0, #0x04] 08097CD8: 4905 ldr r1, =#0x00001F01 08097CDA: 1840 add r0, r0, r1 ; r0 = #$0203E9D1 (flag register) 08097CDC: 7801 ldrb r1, [r0] 08097CDE: 2101 mov r1, #0x01 08097CE0: 7001 strb r1, [r0] 08097CE2: BC10 pop {r4} 08097CE4: BC01 pop {r0} 08097CE6: 4700 bx r0 ;08097CE8: 9AA4 ldr r2, [sp, #0x290] ;08097CEA: 0869 lsr r1, r5, #0x1 ;08097CEC: DE30 ??? ;08097CEE: 0202 lsl r2, r0, #0x8 ;08097CF0: 1F01 sub r1, r0, #0x4 ;08097CF2: 0000 lsl r0, r0, #0x0
$08097CF4 - ?
r0 contains a value for the DAta Table at $086A55E8 which contains the Tiles and Palettes for the Background Images for the Story Demo. Th
08097CF4: B530 push {r4, r5, lr} 08097CF6: 1C01 add r1, r0, #0x0 08097CF8: 0449 lsl r1, r1, #0x11 08097CFA: 0C09 lsr r1, r1, #0x10 ; r1 = Orig. r0 * 2 AND #$0000FFFF 08097CFC: 2401 mov r4, #0x01 08097CFE: 430C orr r4, r1 ; r1 = Orig. r0 * 2 AND #$0000FFFF + 1 08097D00: 4D0F ldr r5, =#0x086A55E8 08097D02: 1C28 add r0, r5, #0x0 ; r0 = #$086A55E8 (Data Table address) 08097D04: F026 bl 08097D06: FB14 bl 0x080BE330 ; Load address of the Tiles from Address Table at $086A55E8 08097D08: 21C0 mov r1, #0xC0 08097D0A: 04C9 lsl r1, r1, #0x13 ; r1 = #$06000000 (VRAM) 08097D0C: F027 bl 08097D0E: FE52 bl 0x080BF9B4 ; swi LZ77UnCompVram - Decompress and put it in VRAM at #$06000000 08097D10: 1C28 add r0, r5, #0x0 ; r0 = #$086A55E8 (same Data Table again) 08097D12: 1C21 add r1, r4, #0x0 ; r1 = Orig. r0 * 2 + 1 (Palette Entry) 08097D14: F026 bl 08097D16: FB0C bl 0x080BE330 ; Load address of the Palette from Address Table at $086A55E8 08097D18: 2280 mov r2, #0x80 08097D1A: 0092 lsl r2, r2, #0x2 ; r2 = #$0200 Transfer #$10 Palettes (Whole Palette RAM) 08097D1C: 2100 mov r1, #0x00 ; r1 = #$00 Start at Palette #$00 08097D1E: F004 bl 08097D20: FDAB bl 0x0809C878 ; Transfer Palettes in Palette RAM 08097D22: 2001 mov r0, #0x01 08097D24: 2100 mov r1, #0x00 08097D26: F000 bl 08097D28: FA91 bl 0x0809824C 08097D2A: 4806 ldr r0, =#0x0202DE30 08097D2C: 6840 ldr r0, [r0, #0x04] 08097D2E: 4906 ldr r1, =#0x00001F01 08097D30: 1840 add r0, r0, r1 08097D32: 7801 ldrb r1, [r0] ; (Set some Flag in $0202FD31) 08097D34: 2101 mov r1, #0x01 08097D36: 7001 strb r1, [r0] ; ???? 08097D38: BC30 pop {r4, r5} 08097D3A: BC01 pop {r0} 08097D3C: 4700 bx r0 ;08097D3E: 0000 lsl r0, r0, #0x0 ;08097D40: 55E8 strb r0, [r5, r7] ;08097D42: 086A lsr r2, r5, #0x1 ;08097D44: DE30 ??? ;08097D46: 0202 lsl r2, r0, #0x8 ;08097D48: 1F01 sub r1, r0, #0x4 ;08097D4A: 0000 lsl r0, r0, #0x0
$08097D4C - ?
Loads Graphic Data.
08097D4C: B5F0 push {r4, r5, r6, r7, lr} 08097D4E: B081 add sp, #-0x004 08097D50: 1C05 add r5, r0, #0x0 08097D52: 042D lsl r5, r5, #0x10 08097D54: 0C2D lsr r5, r5, #0x10 ; r5 = Original r0 AND #$0000FFFF 08097D56: 006C lsl r4, r5, #0x1 08097D58: 1964 add r4, r4, r5 08097D5A: 0424 lsl r4, r4, #0x10 ; r4 = Original r0 * #$30000 08097D5C: 2080 mov r0, #0x80 08097D5E: 0240 lsl r0, r0, #0x9 ; r0 = #$00010000 08097D60: 1826 add r6, r4, r0 08097D62: 0C36 lsr r6, r6, #0x10 ; r6 = Original r0 * 3 + 1 08097D64: 0C21 lsr r1, r4, #0x10 ; r1 = Original r0 * 3 08097D66: 2080 mov r0, #0x80 08097D68: 0280 lsl r0, r0, #0xA ; r0 = #$00020000 08097D6A: 1824 add r4, r4, r0 08097D6C: 0C24 lsr r4, r4, #0x10 ; r4 = Original r0 * 3 + 2 08097D6E: 4F28 ldr r7, =#0x086D0A5C ; Graphics Table address: #$086D0A5C 08097D70: 1C38 add r0, r7, #0x0 08097D72: F026 bl 08097D74: FADD bl 0x080BE330 ; Load Address from Address Table 08097D76: 1C02 add r2, r0, #0x0 08097D78: 21C0 mov r1, #0xC0 08097D7A: 04C9 lsl r1, r1, #0x13 08097D7C: F027 bl 08097D7E: FE1A bl 0x080BF9B4 08097D80: 1C38 add r0, r7, #0x0 ; Graphics Table address: #$086D0A5C 08097D82: 1C31 add r1, r6, #0x0 08097D84: F026 bl 08097D86: FAD4 bl 0x080BE330 ; Load Address from Address Table 08097D88: 2280 mov r2, #0x80 08097D8A: 0092 lsl r2, r2, #0x2 ; Transfer #$200 Bytes (whole Palette RAM) 08097D8C: 2100 mov r1, #0x00 ; Start at Palette 0 08097D8E: F004 bl 08097D90: FD73 bl 0x0809C878 ; Transfer Data to Palette RAM Buffer 08097D92: 1C38 add r0, r7, #0x0 08097D94: 1C21 add r1, r4, #0x0 08097D96: F026 bl 08097D98: FACB bl 0x080BE330 ; Load Address from Address Table 08097D9A: 2114 mov r1, #0x14 08097D9C: 9100 str r1, [sp] 08097D9E: 2102 mov r1, #0x02 08097DA0: 2200 mov r2, #0x00 08097DA2: 230E mov r3, #0x0E 08097DA4: F000 bl 08097DA6: FA72 bl 0x0809828C 08097DA8: 2D00 cmp r5, #0x00 08097DAA: D126 bne 0x08097DFA 08097DAC: 1C38 add r0, r7, #0x0 08097DAE: 2131 mov r1, #0x31 08097DB0: F026 bl 08097DB2: FABE bl 0x080BE330 ; Load Address from Address Table 08097DB4: 1C02 add r2, r0, #0x0 08097DB6: 4D17 ldr r5, =#0x06010000 08097DB8: 2400 mov r4, #0x00 08097DBA: 4B17 ldr r3, =#0x040000D4 08097DBC: 4E17 ldr r6, =#0x80000040 08097DBE: 601A str r2, [r3] ; DMA Source Address: Table entry 08097DC0: 605D str r5, [r3, #0x04] ; DMA Destination Address: #$06010000 (VRAM) 08097DC2: 609E str r6, [r3, #0x08] ; Transfer #$40 Doublebytes 08097DC4: 6898 ldr r0, [r3, #0x08] 08097DC6: 6898 ldr r0, [r3, #0x08] 08097DC8: 2180 mov r1, #0x80 08097DCA: 0609 lsl r1, r1, #0x18 08097DCC: 3280 add r2, #0x80 08097DCE: 3401 add r4, #0x01 08097DD0: 2800 cmp r0, #0x00 08097DD2: DA03 bge 0x08097DDC ; Branch if DMA is completed
08097DD4: 6898 ldr r0, [r3, #0x08] 08097DD6: 4008 and r0, r1 08097DD8: 2800 cmp r0, #0x00 08097DDA: D1FB bne 0x08097DD4 ; Loop if DMA isn't completed 08097DDC: 2180 mov r1, #0x80 08097DDE: 00C9 lsl r1, r1, #0x3 08097DE0: 186D add r5, r5, r1 08097DE2: 0420 lsl r0, r4, #0x10 08097DE4: 0C04 lsr r4, r0, #0x10 08097DE6: 2C03 cmp r4, #0x03 08097DE8: D9E9 bls 0x08097DBE 08097DEA: 1C38 add r0, r7, #0x0 08097DEC: 2132 mov r1, #0x32 08097DEE: F026 bl 08097DF0: FA9F bl 0x080BE330 ; Load Address from Address Table 08097DF2: 2110 mov r1, #0x10 ; Transfer Data to Palette #$10 08097DF4: 2220 mov r2, #0x20 ; Transfer #$20 Bytes (one Palette) 08097DF6: F004 bl 08097DF8: FD3F bl 0x0809C878 08097DFA: 4809 ldr r0, =#0x0202DE30 08097DFC: 6840 ldr r0, [r0, #0x04] 08097DFE: 4909 ldr r1, =#0x00001F02 08097E00: 1840 add r0, r0, r1 08097E02: 7801 ldrb r1, [r0] 08097E04: 2101 mov r1, #0x01 08097E06: 7001 strb r1, [r0] 08097E08: B001 add sp, #0x004 08097E0A: BCF0 pop {r4, r5, r6, r7} 08097E0C: BC01 pop {r0} 08097E0E: 4700 bx r0 ;DATA ;================= ;08097E10: 0A5C lsr r4, r3, #0x9 ;08097E12: 086D lsr r5, r5, #0x1 ;08097E14: 0000 lsl r0, r0, #0x0 ;08097E16: 0601 lsl r1, r0, #0x18 ;08097E18: 00D4 lsl r4, r2, #0x3 ;08097E1A: 0400 lsl r0, r0, #0x10 ;08097E1C: 0040 lsl r0, r0, #0x1 ;08097E1E: 8000 strh r0, [r0] ;08097E20: DE30 ??? ;08097E22: 0202 lsl r2, r0, #0x8 ;08097E24: 1F02 sub r2, r0, #0x4 ;08097E26: 0000 lsl r0, r0, #0x0
$08097E28 - ?
08097E28: B5F0 push {r4, r5, r6, r7, lr} 08097E2A: 4647 mov r7, r8 08097E2C: B480 push {r7} 08097E2E: 4C0C ldr r4, =#0xFFFF9FFC 08097E30: 44A5 add sp, r4 08097E32: 0400 lsl r0, r0, #0x10 08097E34: 0C05 lsr r5, r0, #0x10 08097E36: 0409 lsl r1, r1, #0x10 08097E38: 0C0F lsr r7, r1, #0x10 08097E3A: 00A8 lsl r0, r5, #0x2 08097E3C: 1940 add r0, r0, r5 08097E3E: 0080 lsl r0, r0, #0x2 08097E40: 4908 ldr r1, =#0x080C2624 08097E42: 1840 add r0, r0, r1 08097E44: 4680 mov r8, r0 08097E46: 2D01 cmp r5, #0x01 08097E48: D12A bne 0x08097EA0 08097E4A: 4807 ldr r0, =#0x0202D7A0 ; r0 = #$0202D7A0 08097E4C: 2290 mov r2, #0x90 08097E4E: 0092 lsl r2, r2, #0x2 ; r2 = #$00000240 08097E50: 1881 add r1, r0, r2 ; r1 = #$0202D9E0 08097E52: 2300 mov r3, #0x00 08097E54: 5EC9 ldsh r1, [r1, r3] 08097E56: 1C05 add r5, r0, #0x0 08097E58: 2901 cmp r1, #0x01 08097E5A: D107 bne 0x08097E6C 08097E5C: 2606 mov r6, #0x06 08097E5E: E006 b 0x08097E6E ;08097E60: 9FFC ldr r7, [sp, #0x3F0] ;08097E62: FFFF bl 0x08094E62 ;08097E64: 2624 mov r6, #0x24 ;08097E66: 080C lsr r4, r1, #0x0 ;08097E68: D7A0 bvc 0x08097DAC ;08097E6A: 0202 lsl r2, r0, #0x8 08097E6C: 260C mov r6, #0x0C 08097E6E: 4C0B ldr r4, =#0x080C26CC 08097E70: 4640 mov r0, r8 08097E72: 8841 ldrh r1, [r0, #0x02] 08097E74: 1C38 add r0, r7, #0x0 08097E76: F028 bl 08097E78: FC83 bl 0x080C0780 08097E7A: 0400 lsl r0, r0, #0x10 08097E7C: 0C00 lsr r0, r0, #0x10 08097E7E: 2290 mov r2, #0x90 08097E80: 0092 lsl r2, r2, #0x2 08097E82: 18A9 add r1, r5, r2 08097E84: 2300 mov r3, #0x00 08097E86: 5EC9 ldsh r1, [r1, r3] 08097E88: 3901 sub r1, #0x01 08097E8A: 00C9 lsl r1, r1, #0x3 08097E8C: 1841 add r1, r0, r1 08097E8E: 1909 add r1, r1, r4 08097E90: 780C ldrb r4, [r1] 08097E92: 0040 lsl r0, r0, #0x1 08097E94: 1830 add r0, r6, r0 08097E96: 0400 lsl r0, r0, #0x10 08097E98: 0C06 lsr r6, r0, #0x10 08097E9A: E012 b 0x08097EC2 ;08097E9C: 26CC mov r6, #0xCC ;08097E9E: 080C lsr r4, r1, #0x0 08097EA0: 4646 mov r6, r8 08097EA2: 7C34 ldrb r4, [r6, #0x10] 08097EA4: 8871 ldrh r1, [r6, #0x02] 08097EA6: 1C38 add r0, r7, #0x0 08097EA8: F028 bl 08097EAA: FC6A bl 0x080C0780 08097EAC: 0400 lsl r0, r0, #0x10 08097EAE: 0C00 lsr r0, r0, #0x10 08097EB0: 0041 lsl r1, r0, #0x1 08097EB2: 1864 add r4, r4, r1 08097EB4: 0424 lsl r4, r4, #0x10 08097EB6: 0C26 lsr r6, r4, #0x10 08097EB8: 4A34 ldr r2, =#0x080C269C 08097EBA: 00E9 lsl r1, r5, #0x3 08097EBC: 1840 add r0, r0, r1 08097EBE: 1880 add r0, r0, r2 08097EC0: 7804 ldrb r4, [r0] 08097EC2: 4833 ldr r0, =#0x086EFB10 ; Table Address 08097EC4: 1C31 add r1, r6, #0x0 ; Entry Number to load 08097EC6: F026 bl 08097EC8: FA33 bl 0x080BE330 ; Load address from address table 08097ECA: 4669 mov r1, sp 08097ECC: F027 bl 08097ECE: FD74 bl 0x080BF9B8 ; swi LZ77UnCompWram 08097ED0: 2001 mov r0, #0x01 08097ED2: 4038 and r0, r7 08097ED4: 2800 cmp r0, #0x00 08097ED6: D10D bne 0x08097EF4 08097ED8: 2200 mov r2, #0x00 08097EDA: 4D2E ldr r5, =#0x80808080 08097EDC: 4B2E ldr r3, =#0x000017FF 08097EDE: 0090 lsl r0, r2, #0x2 08097EE0: 466E mov r6, sp 08097EE2: 1831 add r1, r6, r0 08097EE4: 6808 ldr r0, [r1] 08097EE6: 4328 orr r0, r5 08097EE8: 6008 str r0, [r1] 08097EEA: 1C50 add r0, r2, #0x1 08097EEC: 0400 lsl r0, r0, #0x10 08097EEE: 0C02 lsr r2, r0, #0x10 08097EF0: 429A cmp r2, r3 08097EF2: D9F4 bls 0x08097EDE 08097EF4: 4929 ldr r1, =#0x040000D4 ; Setup DMA 08097EF6: 4668 mov r0, sp 08097EF8: 6008 str r0, [r1] ; Source: Stack 08097EFA: 4A29 ldr r2, =#0x0202DE30 08097EFC: 6E50 ldr r0, [r2, #0x64] ; r0 = [$0202DE96] 08097EFE: 6800 ldr r0, [r0] ; r0 = $0202DE96 08097F00: 6048 str r0, [r1, #0x04] ; Destination 08097F02: 4828 ldr r0, =#0x80003000 08097F04: 6088 str r0, [r1, #0x08] ; Transfer #$3000 Double Bytes 08097F06: 6888 ldr r0, [r1, #0x08] 08097F08: 6888 ldr r0, [r1, #0x08] 08097F0A: 2380 mov r3, #0x80 08097F0C: 061B lsl r3, r3, #0x18 08097F0E: 1C15 add r5, r2, #0x0 08097F10: 2800 cmp r0, #0x00 08097F12: DA04 bge 0x08097F1E ; Branch if DMA is completed 08097F14: 1C1A add r2, r3, #0x0 08097F16: 6888 ldr r0, [r1, #0x08] 08097F18: 4010 and r0, r2 08097F1A: 2800 cmp r0, #0x00 08097F1C: D1FB bne 0x08097F16 ; Loop if DMA is not completed 08097F1E: 2001 mov r0, #0x01 08097F20: 4038 and r0, r7 08097F22: 2800 cmp r0, #0x00 08097F24: D101 bne 0x08097F2A 08097F26: 2080 mov r0, #0x80 08097F28: 4304 orr r4, r0 08097F2A: 22C0 mov r2, #0xC0 08097F2C: 01D2 lsl r2, r2, #0x7 08097F2E: 446A add r2, sp 08097F30: 0220 lsl r0, r4, #0x8 08097F32: 4304 orr r4, r0 08097F34: 8014 strh r4, [r2] 08097F36: 4919 ldr r1, =#0x040000D4 ; Setup fixed DMA 08097F38: 600A str r2, [r1] 08097F3A: 6E68 ldr r0, [r5, #0x64] 08097F3C: 6800 ldr r0, [r0] 08097F3E: 3840 sub r0, #0x40 08097F40: 6048 str r0, [r1, #0x04] 08097F42: 4819 ldr r0, =#0x81000020 ; Fixed Transfer, #$20 Double Bytes 08097F44: 6088 str r0, [r1, #0x08] 08097F46: 6888 ldr r0, [r1, #0x08] 08097F48: 6888 ldr r0, [r1, #0x08] 08097F4A: 2280 mov r2, #0x80 08097F4C: 0612 lsl r2, r2, #0x18 08097F4E: 2800 cmp r0, #0x00 08097F50: DA03 bge 0x08097F5A ; Branch if DMA is completed 08097F52: 6888 ldr r0, [r1, #0x08] 08097F54: 4010 and r0, r2 08097F56: 2800 cmp r0, #0x00 08097F58: D1FB bne 0x08097F52 ; Loop if DMA is not completed 08097F5A: 6E69 ldr r1, [r5, #0x64] 08097F5C: 7A88 ldrb r0, [r1, #0x0A] 08097F5E: 8889 ldrh r1, [r1, #0x04] 08097F60: 4643 mov r3, r8 08097F62: 791A ldrb r2, [r3, #0x04] 08097F64: 795B ldrb r3, [r3, #0x05] 08097F66: F000 bl 08097F68: F9D3 bl 0x08098310 08097F6A: 4810 ldr r0, =#0x086A55E8 ; Address Table address 08097F6C: 210B mov r1, #0x0B ; Number of Table Entry to load 08097F6E: F026 bl 08097F70: F9DF bl 0x080BE330 ; Load address from address table 08097F72: 211F mov r1, #0x1F ; Number of the palette to replace (#$1F) 08097F74: 2220 mov r2, #0x20 ; Number of Bytes to transfer: #$20 (1 Palette) 08097F76: F004 bl 08097F78: FC7F bl 0x0809C878 ; DMA to Palette RAM Buffer 08097F7A: 6E68 ldr r0, [r5, #0x64] 08097F7C: 7A00 ldrb r0, [r0, #0x08] 08097F7E: 2800 cmp r0, #0x00 08097F80: D118 bne 0x08097FB4 08097F82: 6868 ldr r0, [r5, #0x04] 08097F84: 4C0A ldr r4, =#0x00001F02 08097F86: 1900 add r0, r0, r4 08097F88: E017 b 0x08097FBA ;DATA ;========= ;08097F8A: 0000 lsl r0, r0, #0x0 ;08097F8C: 269C mov r6, #0x9C ;08097F8E: 080C lsr r4, r1, #0x0 ;08097F90: FB10 bl 0x080A45B2 ;08097F92: 086E lsr r6, r5, #0x1 ;08097F94: 8080 strh r0, [r0, #0x04] ;08097F96: 8080 strh r0, [r0, #0x04] ;08097F98: 17FF asr r7, r7, #0x1F ;08097F9A: 0000 lsl r0, r0, #0x0 ;08097F9C: 00D4 lsl r4, r2, #0x3 ;08097F9E: 0400 lsl r0, r0, #0x10 ;08097FA0: DE30 ??? ;08097FA2: 0202 lsl r2, r0, #0x8 ;08097FA4: 3000 add r0, #0x00 ;08097FA6: 8000 strh r0, [r0] ;08097FA8: 0020 lsl r0, r4, #0x0 ;08097FAA: 8100 strh r0, [r0, #0x08] ;08097FAC: 55E8 strb r0, [r5, r7] ;08097FAE: 086A lsr r2, r5, #0x1 ;08097FB0: 1F02 sub r2, r0, #0x4 ;08097FB2: 0000 lsl r0, r0, #0x0 08097FB4: 6868 ldr r0, [r5, #0x04] 08097FB6: 4E06 ldr r6, =#0x00001F03 08097FB8: 1980 add r0, r0, r6 08097FBA: 7801 ldrb r1, [r0] 08097FBC: 2101 mov r1, #0x01 08097FBE: 7001 strb r1, [r0] 08097FC0: 4B04 ldr r3, =#0x00006004 ; Restore old Stack pointer 08097FC2: 449D add sp, r3 08097FC4: BC08 pop {r3} 08097FC6: 4698 mov r8, r3 08097FC8: BCF0 pop {r4, r5, r6, r7} 08097FCA: BC01 pop {r0} 08097FCC: 4700 bx r0 ;08097FCE: 0000 lsl r0, r0, #0x0 ;08097FD0: 1F03 sub r3, r0, #0x4 ;08097FD2: 0000 lsl r0, r0, #0x0 ;08097FD4: 6004 str r4, [r0] ;08097FD6: 0000 lsl r0, r0, #0x0
$08097FD8 - ?
08097FD8: B570 push {r4, r5, r6, lr} 08097FDA: B081 add sp, #-0x004 08097FDC: 0400 lsl r0, r0, #0x10 08097FDE: 0C02 lsr r2, r0, #0x10 ; Remove upper Doublebyte 08097FE0: 0050 lsl r0, r2, #0x1 08097FE2: 1880 add r0, r0, r2 08097FE4: 0080 lsl r0, r0, #0x2 ; r0 = Original r0 multiplied by twelve (#12 / #$0C) 08097FE6: 490E ldr r1, =#0x080C26DC 08097FE8: 1846 add r6, r0, r1 08097FEA: 2A06 cmp r2, #0x06 ; If Original r0 was not #$06, leave out the Palette Buffer clear 08097FEC: D120 bne 0x08098030 08097FEE: 4669 mov r1, sp ; Clear whole Palette RAM Buffer 08097FF0: 2000 mov r0, #0x00 08097FF2: 8008 strh r0, [r1] ; Clear stack entry 08097FF4: 490B ldr r1, =#0x040000D4 08097FF6: 4668 mov r0, sp 08097FF8: 6008 str r0, [r1] ; Set cleared stack entry as DMA Source Address 08097FFA: 480B ldr r0, =#0x0202DE30 08097FFC: 6840 ldr r0, [r0, #0x04] ; Load Buffers Offset, presumably $0203CAD0 08097FFE: 22CE mov r2, #0xCE 08098000: 0152 lsl r2, r2, #0x5 ; r2 = #$000019C0 08098002: 1880 add r0, r0, r2 ; r0 = Address of Palette RAM Buffer, presumably #$0203E490 08098004: 6048 str r0, [r1, #0x04] ; Set Palette RAM Buffer as DMA Destination Address 08098006: 4809 ldr r0, =#0x81000100 08098008: 6088 str r0, [r1, #0x08] ; Fixed Transfer, #$100 Doublebytes (whole Palette RAM Buffer) 0809800A: 6888 ldr r0, [r1, #0x08] 0809800C: 6888 ldr r0, [r1, #0x08] 0809800E: 2280 mov r2, #0x80 08098010: 0612 lsl r2, r2, #0x18 08098012: 2800 cmp r0, #0x00 08098014: DA2E bge 0x08098074 ; Branch if the DMA is completed 08098016: 6888 ldr r0, [r1, #0x08] 08098018: 4010 and r0, r2 0809801A: 2800 cmp r0, #0x00 0809801C: D1FB bne 0x08098016 ; Loop if DMA is not completed 0809801E: E029 b 0x08098074 ;08098020: 26DC mov r6, #0xDC ;08098022: 080C lsr r4, r1, #0x0 ;08098024: 00D4 lsl r4, r2, #0x3 ;08098026: 0400 lsl r0, r0, #0x10 ;08098028: DE30 ??? ;0809802A: 0202 lsl r2, r0, #0x8 ;0809802C: 0100 lsl r0, r0, #0x4 ;0809802E: 8100 strh r0, [r0, #0x08] 08098030: 0451 lsl r1, r2, #0x11 08098032: 0C09 lsr r1, r1, #0x10 08098034: 2401 mov r4, #0x01 08098036: 430C orr r4, r1 08098038: 4D10 ldr r5, =#0x08733BBC ; Address Table address 0809803A: 1C28 add r0, r5, #0x0 0809803C: F026 bl 0809803E: F978 bl 0x080BE330 ; Load Address from Address Table 08098040: 21C0 mov r1, #0xC0 08098042: 04C9 lsl r1, r1, #0x13 08098044: F027 bl 08098046: FCB6 bl 0x080BF9B4 08098048: 1C28 add r0, r5, #0x0 ; Restore Table address 0809804A: 1C21 add r1, r4, #0x0 0809804C: F026 bl 0809804E: F970 bl 0x080BE330 ; Load Address from Address Table 08098050: 2280 mov r2, #0x80 08098052: 0092 lsl r2, r2, #0x2 ; r2 = #$200 (Bytes to transfer = whole Palette RAM buffer) 08098054: 2100 mov r1, #0x00 ; Start at Palette #$00 08098056: F004 bl 08098058: FC0F bl 0x0809C878 ; DMA to Palette RAM Buffer 0809805A: 7832 ldrb r2, [r6] 0809805C: 7873 ldrb r3, [r6, #0x01] 0809805E: 2001 mov r0, #0x01 08098060: 2100 mov r1, #0x00 08098062: F000 bl 08098064: F955 bl 0x08098310 08098066: 4806 ldr r0, =#0x0202DE30 08098068: 6840 ldr r0, [r0, #0x04] 0809806A: 4906 ldr r1, =#0x00001F01 0809806C: 1840 add r0, r0, r1 0809806E: 7801 ldrb r1, [r0] 08098070: 2101 mov r1, #0x01 08098072: 7001 strb r1, [r0] 08098074: B001 add sp, #0x004 08098076: BC70 pop {r4, r5, r6} 08098078: BC01 pop {r0} 0809807A: 4700 bx r0 ;0809807C: 3BBC sub r3, #0xBC ;0809807E: 0873 lsr r3, r6, #0x1 ;08098080: DE30 ??? ;08098082: 0202 lsl r2, r0, #0x8 ;08098084: 1F01 sub r1, r0, #0x4 ;08098086: 0000 lsl r0, r0, #0x0
$08098088 - ?
Some flexible Graphics Data Load
08098088: B570 push {r4, r5, r6, lr} 0809808A: 4646 mov r6, r8 0809808C: B440 push {r6} 0809808E: B081 add sp, #-0x004 08098090: 0409 lsl r1, r1, #0x10 08098092: 0C09 lsr r1, r1, #0x10 08098094: 004C lsl r4, r1, #0x1 08098096: 1864 add r4, r4, r1 ; r4 = Original r1 * 3 08098098: 00A0 lsl r0, r4, #0x2 ; r0 = Original r1 * #$0C (twelve) 0809809A: 4680 mov r8, r0 0809809C: 481A ldr r0, =#0x080C2730 0809809E: 4480 add r8, r0 080980A0: 0424 lsl r4, r4, #0x10 080980A2: 2180 mov r1, #0x80 080980A4: 0249 lsl r1, r1, #0x9 ; r1 = #$00010000 080980A6: 1865 add r5, r4, r1 ; "Increment" 080980A8: 0C2D lsr r5, r5, #0x10 080980AA: 0C21 lsr r1, r4, #0x10 080980AC: 2280 mov r2, #0x80 080980AE: 0292 lsl r2, r2, #0xA ; r2 = #$00020000 080980B0: 18A4 add r4, r4, r2 080980B2: 0C24 lsr r4, r4, #0x10 080980B4: 4E15 ldr r6, =#0x0877BA3C ; Address Table address 080980B6: 1C30 add r0, r6, #0x0 080980B8: F026 bl 080980BA: F93A bl 0x080BE330 ; Load Address from Address Table 080980BC: 21C0 mov r1, #0xC0 080980BE: 04C9 lsl r1, r1, #0x13 080980C0: F027 bl 080980C2: FC78 bl 0x080BF9B4 080980C4: 1C30 add r0, r6, #0x0 ; Restore Table address 080980C6: 1C29 add r1, r5, #0x0 080980C8: F026 bl 080980CA: F932 bl 0x080BE330 ; Load Address from Address Table 080980CC: 2280 mov r2, #0x80 080980CE: 0092 lsl r2, r2, #0x2 ; Transfer #$200 Byte (whole Palette RAM Buffer) 080980D0: 2100 mov r1, #0x00 ; Start at Palette #$00 080980D2: F004 bl 080980D4: FBD1 bl 0x0809C878 ; DMA to Palette RAM Buffer 080980D6: 1C30 add r0, r6, #0x0 ; Restore Table address 080980D8: 1C21 add r1, r4, #0x0 080980DA: F026 bl 080980DC: F929 bl 0x080BE330 ; Load Address from Address Table 080980DE: 4641 mov r1, r8 080980E0: 780B ldrb r3, [r1] 080980E2: 7849 ldrb r1, [r1, #0x01] 080980E4: 9100 str r1, [sp] 080980E6: 2101 mov r1, #0x01 080980E8: 2200 mov r2, #0x00 080980EA: F000 bl 080980EC: F94D bl 0x08098388 080980EE: 4808 ldr r0, =#0x0202DE30 080980F0: 6840 ldr r0, [r0, #0x04] 080980F2: 4A08 ldr r2, =#0x00001F01 080980F4: 1880 add r0, r0, r2 080980F6: 7801 ldrb r1, [r0] 080980F8: 2101 mov r1, #0x01 080980FA: 7001 strb r1, [r0] 080980FC: B001 add sp, #0x004 080980FE: BC08 pop {r3} 08098100: 4698 mov r8, r3 08098102: BC70 pop {r4, r5, r6} 08098104: BC01 pop {r0} 08098106: 4700 bx r0 ;08098108: 2730 mov r7, #0x30 ;0809810A: 080C lsr r4, r1, #0x0 ;0809810C: BA3C pop {r2, r3, r4, r5} ;0809810E: 0877 lsr r7, r6, #0x1 ;08098110: DE30 ??? ;08098112: 0202 lsl r2, r0, #0x8 ;08098114: 1F01 sub r1, r0, #0x4 ;08098116: 0000 lsl r0, r0, #0x0
$08098118 - ?
08098118: B530 push {r4, r5, lr} 0809811A: 1C04 add r4, r0, #0x0 0809811C: 0424 lsl r4, r4, #0x10 0809811E: 0409 lsl r1, r1, #0x10 08098120: 0AA4 lsr r4, r4, #0xA ; r4 = Original r0 * #$40 08098122: 0B09 lsr r1, r1, #0xC ; r1 = Original r1 * #$10 08098124: 4811 ldr r0, =#0x080C27E4 08098126: 1809 add r1, r1, r0 08098128: 1864 add r4, r4, r1 0809812A: 4D11 ldr r5, =#0x08733BBC ; Address Table address 0809812C: 78A1 ldrb r1, [r4, #0x02] 0809812E: 1C28 add r0, r5, #0x0 08098130: F026 bl 08098132: F8FE bl 0x080BE330 ; Load Address from Address Table 08098134: 21C0 mov r1, #0xC0 08098136: 04C9 lsl r1, r1, #0x13 08098138: F027 bl 0809813A: FC3C bl 0x080BF9B4 0809813C: 78E1 ldrb r1, [r4, #0x03] 0809813E: 1C28 add r0, r5, #0x0 ; Restore Table address 08098140: F026 bl 08098142: F8F6 bl 0x080BE330 ; Load Palette Address from Address Table 08098144: 2100 mov r1, #0x00 ; Palette Number to begin (#$00) 08098146: 2220 mov r2, #0x20 ; Number of Bytes to transfer: #$20 (1 Palette) 08098148: F004 bl 0809814A: FB96 bl 0x0809C878 ; DMA to Palette RAM Buffer 0809814C: 7822 ldrb r2, [r4] 0809814E: 7863 ldrb r3, [r4, #0x01] 08098150: 2001 mov r0, #0x01 08098152: 2100 mov r1, #0x00 08098154: F000 bl 08098156: F8DC bl 0x08098310 08098158: 4806 ldr r0, =#0x0202DE30 0809815A: 6840 ldr r0, [r0, #0x04] 0809815C: 4906 ldr r1, =#0x00001F01 0809815E: 1840 add r0, r0, r1 08098160: 7801 ldrb r1, [r0] 08098162: 2101 mov r1, #0x01 08098164: 7001 strb r1, [r0] 08098166: BC30 pop {r4, r5} 08098168: BC01 pop {r0} 0809816A: 4700 bx r0 ;0809816C: 27E4 mov r7, #0xE4 ;0809816E: 080C lsr r4, r1, #0x0 ;08098170: 3BBC sub r3, #0xBC ;08098172: 0873 lsr r3, r6, #0x1 ;08098174: DE30 ??? ;08098176: 0202 lsl r2, r0, #0x8 ;08098178: 1F01 sub r1, r0, #0x4 ;0809817A: 0000 lsl r0, r0, #0x0
$0809817C - ?
0809817C: B570 push {r4, r5, r6, lr} 0809817E: 1C04 add r4, r0, #0x0 08098180: 0424 lsl r4, r4, #0x10 08098182: 0BE4 lsr r4, r4, #0xF 08098184: 1C21 add r1, r4, #0x0 08098186: 3128 add r1, #0x28 08098188: 0409 lsl r1, r1, #0x10 0809818A: 0C09 lsr r1, r1, #0x10 ; Table Entry number 0809818C: 3429 add r4, #0x29 0809818E: 0424 lsl r4, r4, #0x10 08098190: 0C24 lsr r4, r4, #0x10 08098192: 4D19 ldr r5, =#0x08733BBC ; Address Table address 08098194: 1C28 add r0, r5, #0x0 08098196: F026 bl 08098198: F8CB bl 0x080BE330 ; Load Adress from Address Table 0809819A: 21C0 mov r1, #0xC0 0809819C: 04C9 lsl r1, r1, #0x13 0809819E: F027 bl 080981A0: FC09 bl 0x080BF9B4 080981A2: 1C28 add r0, r5, #0x0 ; Restore Table address 080981A4: 1C21 add r1, r4, #0x0 080981A6: F026 bl 080981A8: F8C3 bl 0x080BE330 ; Load Adress from Address Table 080981AA: 2280 mov r2, #0x80 080981AC: 0092 lsl r2, r2, #0x2 ; Transfer #$200 Bytes 080981AE: 2100 mov r1, #0x00 ; Start at Palette #$00 080981B0: F004 bl 080981B2: FB62 bl 0x0809C878 ; DMA to Palette RAM Buffer 080981B4: 2001 mov r0, #0x01 080981B6: 2100 mov r1, #0x00 080981B8: 221E mov r2, #0x1E 080981BA: 230F mov r3, #0x0F 080981BC: F000 bl 080981BE: F924 bl 0x08098408 080981C0: 1C28 add r0, r5, #0x0 ; Restore Table address 080981C2: 212C mov r1, #0x2C 080981C4: F026 bl 080981C6: F8B4 bl 0x080BE330 ; Load Adress from Address Table 080981C8: 490C ldr r1, =#0x06010000 080981CA: F027 bl 080981CC: FBF3 bl 0x080BF9B4 080981CE: 4E0C ldr r6, =#0x0202DE30 080981D0: 480C ldr r0, =#0x0000489E 080981D2: 1835 add r5, r6, r0 080981D4: 782C ldrb r4, [r5] 080981D6: 201E mov r0, #0x1E 080981D8: 8028 strh r0, [r5] 080981DA: F004 bl 080981DC: FB1D bl 0x0809C818 080981DE: 0624 lsl r4, r4, #0x18 080981E0: 1624 asr r4, r4, #0x18 080981E2: 802C strh r4, [r5] 080981E4: 6870 ldr r0, [r6, #0x04] 080981E6: 4908 ldr r1, =#0x00001F01 080981E8: 1840 add r0, r0, r1 080981EA: 7801 ldrb r1, [r0] 080981EC: 2101 mov r1, #0x01 080981EE: 7001 strb r1, [r0] 080981F0: BC70 pop {r4, r5, r6} 080981F2: BC01 pop {r0} 080981F4: 4700 bx r0 ;080981F6: 0000 lsl r0, r0, #0x0 ;080981F8: 3BBC sub r3, #0xBC ;080981FA: 0873 lsr r3, r6, #0x1 ;080981FC: 0000 lsl r0, r0, #0x0 ;080981FE: 0601 lsl r1, r0, #0x18 ;08098200: DE30 ??? ;08098202: 0202 lsl r2, r0, #0x8 ;08098204: 489E ldr r0, =#0x4700BC01 ;08098206: 0000 lsl r0, r0, #0x0 ;08098208: 1F01 sub r1, r0, #0x4 ;0809820A: 0000 lsl r0, r0, #0x0
$0809820C - Screenfilling Tilemap Builder
This is a Tile Map builder. It builds a tilemap sized #$1E*#$15 Tiles = 30 * 21 Tiles (for 8px-Tiles, this is 240*168px; GBA has resolution: 240×160px)
r0 contains the Data Load address.
r1 contains a value (valid between #$00 and #$03) for the Data Store address; it's the number of the BG the data is for.
r2 contains an double byte that gets added to each tile (like, set all the tiles to a certain palette)
0809820C: B530 push {r4, r5, lr} 0809820E: 1C04 add r4, r0, #0x0 ; Transfer Data Load address in r4 08098210: 1C08 add r0, r1, #0x0 08098212: 0400 lsl r0, r0, #0x10 08098214: 0C00 lsr r0, r0, #0x10 ; Transfer the Destination-BG-Number from r1 in r0 and remove Upper Double Byte 08098216: 0412 lsl r2, r2, #0x10 08098218: 0C15 lsr r5, r2, #0x10 ; Remove upper Double Byte from Addition value, store it in r5 0809821A: 2100 mov r1, #0x00 ; For Start Point calculation: Start at Tilemap's X = 0 0809821C: 2200 mov r2, #0x00 ; For Start Point calculation: Start at Tilemap's Y = 0 0809821E: F004 bl 08098220: F8A5 bl 0x0809C36C ; Calculate BG's Tilemap Buffer's Start Point to store Data there 08098222: 1C01 add r1, r0, #0x0 ; Transfer Data Store address in r1 08098224: 2000 mov r0, #0x00 08098226: 2200 mov r2, #0x00 ; Setup Inner Loop Counter 08098228: 1C43 add r3, r0, #0x1 ; Setup/Increment Outer Loop Counter 0809822A: 8820 ldrh r0, [r4] ; Load Data 0809822C: 1828 add r0, r5, r0 ; Add r5 to Data 0809822E: 8008 strh r0, [r1] ; Store Data 08098230: 1C50 add r0, r2, #0x1 ; Increment Loop Counter 08098232: 0400 lsl r0, r0, #0x10 08098234: 0C02 lsr r2, r0, #0x10 ; Remove Loop Counter's Upper Double Byte 08098236: 3402 add r4, #0x02 ; Increment Data Store Address 08098238: 3102 add r1, #0x02 ; Increment Data Load Address 0809823A: 2A1D cmp r2, #0x1D 0809823C: D9F5 bls 0x0809822A ; Loop if r2 hasn't SURPASSED #$1D 0809823E: 0418 lsl r0, r3, #0x10 ; Remove Loop Counter's Upper Double Byte 08098240: 0C00 lsr r0, r0, #0x10 08098242: 2814 cmp r0, #0x14 08098244: D9EF bls 0x08098226 ; Loop if r0/3 hasn't SURPASSED #$14 08098246: BC30 pop {r4, r5} 08098248: BC01 pop {r0} 0809824A: 4700 bx r0
$0809824C - Screenfilling upcounted Tilemap Builder
This builds a Tilemap. The Tilemap consists of values that increment per Tile. This always starts at the first Tile of a Tilemap and creates a #$1E*#$14 Tilemap. With 8px-Tiles, this is exactly screenfilling.
r0 contains the number of the Destination BG.
r1 contains the value the first Tile should start with (gets transferred in r4).
0809824C: B510 push {r4, lr} 0809824E: 1C0C add r4, r1, #0x0 08098250: 0400 lsl r0, r0, #0x10 08098252: 0C00 lsr r0, r0, #0x10 08098254: 0424 lsl r4, r4, #0x10 08098256: 0C24 lsr r4, r4, #0x10 08098258: 2100 mov r1, #0x00 ; For Start Point calculation: Start at Tilemap's X = 0 0809825A: 2200 mov r2, #0x00 ; For Start Point calculation: Start at Tilemap's Y = 0 0809825C: F004 bl 0809825E: F886 bl 0x0809C36C ; Calculate BG's Tilemap Buffer's Start Point to store Data there 08098260: 1C01 add r1, r0, #0x0 ; Transfer Data Store address in r1 08098262: 2000 mov r0, #0x00 08098264: 2200 mov r2, #0x00 ; Setup Inner Loop Counter 08098266: 1C43 add r3, r0, #0x1 ; Setup/Increment Outer Loop Counter 08098268: 800C strh r4, [r1] 0809826A: 1C50 add r0, r2, #0x1 ; Increment Inner Loop Counter 0809826C: 0400 lsl r0, r0, #0x10 0809826E: 0C02 lsr r2, r0, #0x10 ; Remove upper Double Byte from Inner Loop Counter, store back in r2 08098270: 1C60 add r0, r4, #0x1 08098272: 0400 lsl r0, r0, #0x10 08098274: 0C04 lsr r4, r0, #0x10 ; Increment Value for the next Tile, remove Upper Double Byte 08098276: 3102 add r1, #0x02 08098278: 2A1D cmp r2, #0x1D ; Has Inner Loop Counter reached #$1D? 0809827A: D9F5 bls 0x08098268 0809827C: 0418 lsl r0, r3, #0x10 ; Remove upper Double Byte from Outer Loop Counter 0809827E: 0C00 lsr r0, r0, #0x10 08098280: 2813 cmp r0, #0x13 ; Has Outer Loop Counter reached #$13? 08098282: D9EF bls 0x08098264 ; If not, loop, increment Outer Loop Counter and reset Inner Loop Counter 08098284: BC10 pop {r4} 08098286: BC01 pop {r0} 08098288: 4700 bx r0 ;0809828A: 0000 lsl r0, r0, #0x0
$0809828C - ?
r0 to r3 contain values for this subroutine
r0 contains some kind of loop counter value; seems to get incremented(!), loop is left on r0 = #$00
r1 contains a BG Tilemap number
0809828C: B5F0 push {r4, r5, r6, r7, lr} 0809828E: 4647 mov r7, r8 08098290: B480 push {r7} 08098292: 1C05 add r5, r0, #0x0 ; r5 = r0 08098294: 1C0C add r4, r1, #0x0 ; r4 = r1 08098296: 9806 ldr r0, [sp, #0x018] ; Original... r4, I guess? 08098298: 0424 lsl r4, r4, #0x10 0809829A: 0C24 lsr r4, r4, #0x10 ; r4 = Original r1 AND #$0000FFFF 0809829C: 0412 lsl r2, r2, #0x10 0809829E: 0C12 lsr r2, r2, #0x10 ; r2 AND #$0000FFFF 080982A0: 4690 mov r8, r2 ; r8 = r2 080982A2: 041B lsl r3, r3, #0x10 080982A4: 0C1E lsr r6, r3, #0x10 ; r6 = r3 AND #$0000FFFF 080982A6: 0400 lsl r0, r0, #0x10 080982A8: 0C07 lsr r7, r0, #0x10 ; r7 = r0 AND #$0000FFFF 080982AA: 2000 mov r0, #0x00 080982AC: 1C21 add r1, r4, #0x0 ; r1 = r4 080982AE: 2200 mov r2, #0x00 080982B0: F003 bl 080982B2: FFD0 bl 0x0809C254 080982B4: 1C20 add r0, r4, #0x0 ; r0 = BG Tilemap Number 080982B6: 2100 mov r1, #0x00 ; X-coordinate 080982B8: 2200 mov r2, #0x00 ; Y-coordinate 080982BA: F004 bl 080982BC: F857 bl 0x0809C36C ; Subroutine: Calculate address of a tile ($0202DE34) 080982BE: 1C02 add r2, r0, #0x0 ; r2 = The start point of the BG Tilemap 080982C0: 201E mov r0, #0x1E 080982C2: 1B80 sub r0, r0, r6 ; r0 = r0 - Original r3 080982C4: 0FC1 lsr r1, r0, #0x1F ; If r6 > #$1E, r1 = #$01, else r1 = #$00 080982C6: 1840 add r0, r0, r1 080982C8: 03C0 lsl r0, r0, #0xF 080982CA: 0C04 lsr r4, r0, #0x10 080982CC: 2000 mov r0, #0x00 080982CE: 42B8 cmp r0, r7 080982D0: D218 bcs 0x08098304 080982D2: 1931 add r1, r6, r4 080982D4: 468C mov r12, r1 080982D6: 1912 add r2, r2, r4 080982D8: 2100 mov r1, #0x00 080982DA: 1C43 add r3, r0, #0x1 080982DC: 42B1 cmp r1, r6 080982DE: D209 bcs 0x080982F4 080982E0: 7828 ldrb r0, [r5] 080982E2: 4440 add r0, r8 080982E4: 7010 strb r0, [r2] 080982E6: 1C48 add r0, r1, #0x1 080982E8: 0400 lsl r0, r0, #0x10 080982EA: 0C01 lsr r1, r0, #0x10 080982EC: 3501 add r5, #0x01 080982EE: 3201 add r2, #0x01 080982F0: 42B1 cmp r1, r6 080982F2: D3F5 bcc 0x080982E0 080982F4: 1C10 add r0, r2, #0x0 080982F6: 301E add r0, #0x1E 080982F8: 4661 mov r1, r12 080982FA: 1A42 sub r2, r0, r1 080982FC: 0418 lsl r0, r3, #0x10 080982FE: 0C00 lsr r0, r0, #0x10 08098300: 42B8 cmp r0, r7 08098302: D3E8 bcc 0x080982D6 08098304: BC08 pop {r3} 08098306: 4698 mov r8, r3 08098308: BCF0 pop {r4, r5, r6, r7} 0809830A: BC01 pop {r0} 0809830C: 4700 bx r0
;0809830E: 0000 lsl r0, r0, #0x0
$08098310 - ?
08098310: B5F0 push {r4, r5, r6, r7, lr} 08098312: 1C04 add r4, r0, #0x0 08098314: 1C0D add r5, r1, #0x0 08098316: 0424 lsl r4, r4, #0x10 08098318: 0C24 lsr r4, r4, #0x10 0809831A: 042D lsl r5, r5, #0x10 0809831C: 0C2D lsr r5, r5, #0x10 0809831E: 0412 lsl r2, r2, #0x10 08098320: 0C16 lsr r6, r2, #0x10 08098322: 041B lsl r3, r3, #0x10 08098324: 0C1F lsr r7, r3, #0x10 08098326: 2000 mov r0, #0x00 08098328: 1C21 add r1, r4, #0x0 0809832A: 2200 mov r2, #0x00 0809832C: F003 bl 0809832E: FF92 bl 0x0809C254 08098330: 1C20 add r0, r4, #0x0 08098332: 2100 mov r1, #0x00 08098334: 2200 mov r2, #0x00 08098336: F004 bl 08098338: F819 bl 0x0809C36C 0809833A: 1C02 add r2, r0, #0x0 0809833C: 241E mov r4, #0x1E 0809833E: 1BA0 sub r0, r4, r6 08098340: 0FC1 lsr r1, r0, #0x1F 08098342: 1840 add r0, r0, r1 08098344: 03C0 lsl r0, r0, #0xF 08098346: 0C01 lsr r1, r0, #0x10 08098348: 2300 mov r3, #0x00 0809834A: 42BB cmp r3, r7 0809834C: D218 bcs 0x08098380 ; Exit 0809834E: 1870 add r0, r6, r1 08098350: 1A20 sub r0, r4, r0 08098352: 0040 lsl r0, r0, #0x1 08098354: 4684 mov r12, r0 08098356: 004C lsl r4, r1, #0x1 08098358: 1912 add r2, r2, r4 0809835A: 2100 mov r1, #0x00 0809835C: 3301 add r3, #0x01 0809835E: 42B1 cmp r1, r6 08098360: D209 bcs 0x08098376 08098362: 8015 strh r5, [r2] 08098364: 1C48 add r0, r1, #0x1 08098366: 0400 lsl r0, r0, #0x10 08098368: 0C01 lsr r1, r0, #0x10 0809836A: 1C68 add r0, r5, #0x1 0809836C: 0400 lsl r0, r0, #0x10 0809836E: 0C05 lsr r5, r0, #0x10 08098370: 3202 add r2, #0x02 08098372: 42B1 cmp r1, r6 08098374: D3F5 bcc 0x08098362 08098376: 4462 add r2, r12 08098378: 0418 lsl r0, r3, #0x10 0809837A: 0C03 lsr r3, r0, #0x10 0809837C: 42BB cmp r3, r7 0809837E: D3EB bcc 0x08098358 08098380: BCF0 pop {r4, r5, r6, r7} 08098382: BC01 pop {r0} 08098384: 4700 bx r0 ;08098386: 0000 lsl r0, r0, #0x0
$08098388 - ?
08098388: B5F0 push {r4, r5, r6, r7, lr} 0809838A: 4647 mov r7, r8 0809838C: B480 push {r7} 0809838E: 1C05 add r5, r0, #0x0 08098390: 1C0C add r4, r1, #0x0 08098392: 9806 ldr r0, [sp, #0x018] ; load original r4 value in r0? 08098394: 0424 lsl r4, r4, #0x10 08098396: 0C24 lsr r4, r4, #0x10 08098398: 0412 lsl r2, r2, #0x10 0809839A: 0C12 lsr r2, r2, #0x10 0809839C: 4690 mov r8, r2 0809839E: 041B lsl r3, r3, #0x10 080983A0: 0C1E lsr r6, r3, #0x10 080983A2: 0400 lsl r0, r0, #0x10 080983A4: 0C07 lsr r7, r0, #0x10 080983A6: 2000 mov r0, #0x00 080983A8: 1C21 add r1, r4, #0x0 080983AA: 2200 mov r2, #0x00 080983AC: F003 bl 080983AE: FF52 bl 0x0809C254 080983B0: 1C20 add r0, r4, #0x0 080983B2: 2100 mov r1, #0x00 080983B4: 2200 mov r2, #0x00 080983B6: F003 bl 080983B8: FFD9 bl 0x0809C36C 080983BA: 1C02 add r2, r0, #0x0 080983BC: 201E mov r0, #0x1E 080983BE: 1B80 sub r0, r0, r6 080983C0: 0400 lsl r0, r0, #0x10 080983C2: 0C04 lsr r4, r0, #0x10 080983C4: 2300 mov r3, #0x00 080983C6: 42BB cmp r3, r7 080983C8: D219 bcs 0x080983FE 080983CA: 1931 add r1, r6, r4 080983CC: 201E mov r0, #0x1E 080983CE: 1A40 sub r0, r0, r1 080983D0: 0040 lsl r0, r0, #0x1 080983D2: 4684 mov r12, r0 080983D4: 0064 lsl r4, r4, #0x1 080983D6: 1912 add r2, r2, r4 080983D8: 2100 mov r1, #0x00 080983DA: 3301 add r3, #0x01 080983DC: 42B1 cmp r1, r6 080983DE: D209 bcs 0x080983F4 080983E0: 7828 ldrb r0, [r5] 080983E2: 4440 add r0, r8 080983E4: 8010 strh r0, [r2] 080983E6: 1C48 add r0, r1, #0x1 080983E8: 0400 lsl r0, r0, #0x10 080983EA: 0C01 lsr r1, r0, #0x10 080983EC: 3501 add r5, #0x01 080983EE: 3202 add r2, #0x02 080983F0: 42B1 cmp r1, r6 080983F2: D3F5 bcc 0x080983E0 080983F4: 4462 add r2, r12 080983F6: 0418 lsl r0, r3, #0x10 080983F8: 0C03 lsr r3, r0, #0x10 080983FA: 42BB cmp r3, r7 080983FC: D3EB bcc 0x080983D6 080983FE: BC08 pop {r3} 08098400: 4698 mov r8, r3 08098402: BCF0 pop {r4, r5, r6, r7} 08098404: BC01 pop {r0} 08098406: 4700 bx r0
$08098408 - ?
08098408: B5F0 push {r4, r5, r6, r7, lr} 0809840A: 1C04 add r4, r0, #0x0 0809840C: 1C0D add r5, r1, #0x0 0809840E: 0424 lsl r4, r4, #0x10 08098410: 0C24 lsr r4, r4, #0x10 08098412: 042D lsl r5, r5, #0x10 08098414: 0C2D lsr r5, r5, #0x10 08098416: 0412 lsl r2, r2, #0x10 08098418: 0C16 lsr r6, r2, #0x10 0809841A: 041B lsl r3, r3, #0x10 0809841C: 0C1F lsr r7, r3, #0x10 0809841E: 2000 mov r0, #0x00 08098420: 1C21 add r1, r4, #0x0 08098422: 2200 mov r2, #0x00 08098424: F003 bl 08098426: FF16 bl 0x0809C254 08098428: 2214 mov r2, #0x14 0809842A: 1BD2 sub r2, r2, r7 0809842C: 0412 lsl r2, r2, #0x10 0809842E: 0C12 lsr r2, r2, #0x10 08098430: 1C20 add r0, r4, #0x0 08098432: 2100 mov r1, #0x00 08098434: F003 bl 08098436: FF9A bl 0x0809C36C 08098438: 1C02 add r2, r0, #0x0 0809843A: 241E mov r4, #0x1E 0809843C: 1BA0 sub r0, r4, r6 0809843E: 0FC1 lsr r1, r0, #0x1F 08098440: 1840 add r0, r0, r1 08098442: 03C0 lsl r0, r0, #0xF 08098444: 0C01 lsr r1, r0, #0x10 08098446: 2300 mov r3, #0x00 08098448: 42BB cmp r3, r7 0809844A: D218 bcs 0x0809847E 0809844C: 1870 add r0, r6, r1 0809844E: 1A20 sub r0, r4, r0 08098450: 0040 lsl r0, r0, #0x1 08098452: 4684 mov r12, r0 08098454: 004C lsl r4, r1, #0x1 08098456: 1912 add r2, r2, r4 08098458: 2100 mov r1, #0x00 0809845A: 3301 add r3, #0x01 0809845C: 42B1 cmp r1, r6 0809845E: D209 bcs 0x08098474 08098460: 8015 strh r5, [r2] 08098462: 1C48 add r0, r1, #0x1 08098464: 0400 lsl r0, r0, #0x10 08098466: 0C01 lsr r1, r0, #0x10 08098468: 1C68 add r0, r5, #0x1 0809846A: 0400 lsl r0, r0, #0x10 0809846C: 0C05 lsr r5, r0, #0x10 0809846E: 3202 add r2, #0x02 08098470: 42B1 cmp r1, r6 08098472: D3F5 bcc 0x08098460 08098474: 4462 add r2, r12 08098476: 0418 lsl r0, r3, #0x10 08098478: 0C03 lsr r3, r0, #0x10 0809847A: 42BB cmp r3, r7 0809847C: D3EB bcc 0x08098456 0809847E: BCF0 pop {r4, r5, r6, r7} 08098480: BC01 pop {r0} 08098482: 4700 bx r0
$08098484 - ?
Disables Interrupts, transfers data to $020000D0 (WRAM), re-enables Interrupts
08098484: B510 push {r4, lr} 08098486: 4C0F ldr r4, =#0x04000208 08098488: 2000 mov r0, #0x00 0809848A: 8020 strh r0, [r4] ; Disable all interrupts 0809848C: 4A0E ldr r2, =#0x04000200 0809848E: 8811 ldrh r1, [r2] ; r1 contains all Interrupts that are activated 08098490: 480E ldr r0, =#0x0000FFFC 08098492: 4008 and r0, r1 ; Deactivate LCD V-Blank and H-Blank 08098494: 8010 strh r0, [r2] ; Store back 08098496: 4A0E ldr r2, =#0x04000004 08098498: 8811 ldrh r1, [r2] ; Load General LCD Status 0809849A: 480E ldr r0, =#0x0000FFE7 0809849C: 4008 and r0, r1 ; Disable V-Blank and H-Blank IRQ Enable 0809849E: 8010 strh r0, [r2] ; Store back 080984A0: 480D ldr r0, =#0x0202DE30 080984A2: 4A0E ldr r2, =#0x000048A8 080984A4: 1881 add r1, r0, r2 080984A6: 2200 mov r2, #0x00 080984A8: 600A str r2, [r1] ; $020326D8 = #$00000000 080984AA: 490D ldr r1, =#0x000048AC 080984AC: 1840 add r0, r0, r1 080984AE: 6002 str r2, [r0] ; $020326DC = #$00000000 080984B0: 480C ldr r0, =#0x020000D0 ; Store Address 080984B2: 490D ldr r1, =#0x080C23C8 ; Load Address 080984B4: 2238 mov r2, #0x38 ; Bytes to transfer 080984B6: F029 bl 080984B8: FD95 bl 0x080C1FE4 ; Data Transfer ; Transfers $080C23C8-080C2400 to $020000D0-$02000107 080984BA: 2001 mov r0, #0x01 ; $04000208 = #$00000001 080984BC: 8020 strh r0, [r4] ; [Re-Enable interrupts] 080984BE: BC10 pop {r4} 080984C0: BC01 pop {r0} 080984C2: 4700 bx r0 ; DATA ; 080984C4: 0208 lsl r0, r1, #0x8 ; 080984C6: 0400 lsl r0, r0, #0x10 ; 080984C8: 0200 lsl r0, r0, #0x8 ; 080984CA: 0400 lsl r0, r0, #0x10 ; 080984CC: FFFC bl 0x07C994C6 ; 080984CE: 0000 lsl r0, r0, #0x0 ; 080984D0: 0004 lsl r4, r0, #0x0 ; 080984D2: 0400 lsl r0, r0, #0x10 ; 080984D4: FFE7 bl 0x07C994A4 ; 080984D6: 0000 lsl r0, r0, #0x0 ; 080984D8: DE30 ??? ; 080984DA: 0202 lsl r2, r0, #0x8 ; 080984DC: 48A8 ldr r0, =#0x00004770 ; 080984DE: 0000 lsl r0, r0, #0x0 ; 080984E0: 48AC ldr r0, =#0x78281825 ; 080984E2: 0000 lsl r0, r0, #0x0 ; 080984E4: 00D0 lsl r0, r2, #0x3 ; 080984E6: 0200 lsl r0, r0, #0x8 ; 080984E8: 23C8 mov r3, #0xC8 ; 080984EA: 080C lsr r4, r1, #0x0
$08098530 - (Jump to subroutines, Enable interrupts?)
08098530: B500 push {lr} 08098532: 4807 ldr r0, =#0x0202DF00 08098534: F025 bl 08098536: FE5C bl 0x080BE1F0 ; ? 08098538: F026 bl 0809853A: FF70 bl 0x080BF41C ; ? 0809853C: 4A05 ldr r2, =#0x04000208 0809853E: 2000 mov r0, #0x00 08098540: 8010 strh r0, [r2] ; Disable All Interrupts 08098542: 4905 ldr r1, =#0x03007FF8 08098544: 2001 mov r0, #0x01 08098546: 8008 strh r0, [r1] ; Store value in $03007FF8 (Buffer for $04000208) 08098548: 8010 strh r0, [r2] ; Enable Interrupts 0809854A: BC01 pop {r0} 0809854C: 4700 bx r0
;0809854E: 0000 lsl r0, r0, #0x0 ;08098550: DF00 swi SoftReset ;08098552: 0202 lsl r2, r0, #0x8 ;08098554: 0208 lsl r0, r1, #0x8 ;08098556: 0400 lsl r0, r0, #0x10 ;08098558: 7FF8 ldrb r0, [r7, #0x1F] ;0809855A: 0300 lsl r0, r0, #0xC
$08098580 - Increment Intro Frame Counters, Update Graphics
Increment values in $0202DEAC-F and $0202DEB0-3, load values from $0202DE30-3 and $0202DE34-7 in r0 and r1.
08098580: B500 push {lr} 08098582: 4908 ldr r1, =#0x0202DE30 ; Increment the value in $0202DEAC (Global Intro Frame Counter) 08098584: 6FC8 ldr r0, [r1, #0x7C] 08098586: 3001 add r0, #0x01 08098588: 67C8 str r0, [r1, #0x7C] 0809858A: 1C0A add r2, r1, #0x0 0809858C: 3280 add r2, #0x80 ; r2 = #$0202DEB0 (Intro Segment Frame Counter) 0809858E: 6810 ldr r0, [r2] ; Increment the value in $0202DEB0 08098590: 3001 add r0, #0x01 08098592: 6010 str r0, [r2] 08098594: 6808 ldr r0, [r1] ; r0 = [$0202DE30] 08098596: 6849 ldr r1, [r1, #0x04] ; r1 = [$0202DE34] 08098598: F000 bl 0809859A: F806 bl 0x080985A8 ; Transfer Settings in LCD I/O registers 0809859C: F000 bl 0809859E: F8AC bl 0x080986F8 ; (General Graphics Updater?) 080985A0: BC01 pop {r0} 080985A2: 4700 bx r0 ;DATA ;==================== ;080985A4: DE30 ??? ;080985A6: 0202 lsl r2, r0, #0x8
$080985A8 - Transfer Settings in LCD I/O registers
r0 (later transferred in r3) contains the address of the beginning of a list of values. These values are transferred in many registers around $04000000.
080985A8: B510 push {r4, lr} 080985AA: 1C03 add r3, r0, #0x0 080985AC: 1C0C add r4, r1, #0x0 080985AE: 2180 mov r1, #0x80 080985B0: 04C9 lsl r1, r1, #0x13 ; r1 = #$04000000 080985B2: 8918 ldrh r0, [r3, #0x08] 080985B4: 8008 strh r0, [r1] ; DISPCNT - LCD Control 080985B6: 3108 add r1, #0x08 ; r1 = #$04000008 080985B8: 8958 ldrh r0, [r3, #0x0A] 080985BA: 8008 strh r0, [r1] ; BG0CNT - BG0 Control 080985BC: 3102 add r1, #0x02 ; r1 = #$0400000A 080985BE: 8998 ldrh r0, [r3, #0x0C] 080985C0: 8008 strh r0, [r1] ; BG1CNT - BG1 Control 080985C2: 3102 add r1, #0x02 ; r1 = #$0400000C 080985C4: 89D8 ldrh r0, [r3, #0x0E] 080985C6: 8008 strh r0, [r1] ; BG2CNT - BG2 Control 080985C8: 3102 add r1, #0x02 ; r1 = #$0400000E 080985CA: 8A18 ldrh r0, [r3, #0x10] 080985CC: 8008 strh r0, [r1] ; BG3CNT - BG3 Control 080985CE: 3102 add r1, #0x02 ; r1 = #$04000010 080985D0: 8A58 ldrh r0, [r3, #0x12] 080985D2: 8008 strh r0, [r1] ; BG0HOFS - BG0 X-Offset 080985D4: 3102 add r1, #0x02 ; r1 = #$04000012 080985D6: 8A98 ldrh r0, [r3, #0x14] 080985D8: 8008 strh r0, [r1] ; BG0VOFS - BG0 Y-Offset 080985DA: 3102 add r1, #0x02 ; r1 = #$04000014 080985DC: 8AD8 ldrh r0, [r3, #0x16] 080985DE: 8008 strh r0, [r1] ; BG1HOFS - BG1 X-Offset 080985E0: 3102 add r1, #0x02 ; r1 = #$04000016 080985E2: 8B18 ldrh r0, [r3, #0x18] 080985E4: 8008 strh r0, [r1] ; BG1VOFS - BG1 Y-Offset 080985E6: 3102 add r1, #0x02 ; r1 = #$04000018 080985E8: 8B58 ldrh r0, [r3, #0x1A] 080985EA: 8008 strh r0, [r1] ; BG2HOFS - BG2 X-Offset 080985EC: 3102 add r1, #0x02 ; r1 = #$0400001A 080985EE: 8B98 ldrh r0, [r3, #0x1C] 080985F0: 8008 strh r0, [r1] ; BG2VOFS - BG2 Y-Offset 080985F2: 3102 add r1, #0x02 ; r1 = #$0400001C 080985F4: 8BD8 ldrh r0, [r3, #0x1E] 080985F6: 8008 strh r0, [r1] ; BG3HOFS - BG3 X-Offset 080985F8: 3102 add r1, #0x02 ; r1 = #$0400001E 080985FA: 8C18 ldrh r0, [r3, #0x20] 080985FC: 8008 strh r0, [r1] ; BG3VOFS - BG3 Y-Offset 080985FE: 3132 add r1, #0x32 ; r1 = #$04000050 08098600: 8818 ldrh r0, [r3] 08098602: 8008 strh r0, [r1] ; BLDCNT - Color Special Effects Selection 08098604: 3102 add r1, #0x02 ; r1 = #$04000052 08098606: 8858 ldrh r0, [r3, #0x02] 08098608: 8008 strh r0, [r1] ; BLDALPHA - Alpha Blending Coefficients 0809860A: 3102 add r1, #0x02 ; r1 = #$04000054 0809860C: 8898 ldrh r0, [r3, #0x04] 0809860E: 8008 strh r0, [r1] ; BLDY - Brightness (Fade-In/Out) Coefficient 08098610: 8919 ldrh r1, [r3, #0x08] ; Load value for DISPCNT - LCD Control ($04000000) 08098612: 2007 mov r0, #0x07 08098614: 4008 and r0, r1 ; Exempt BG Mode bits 08098616: 2802 cmp r0, #0x02 08098618: D138 bne 0x0809868C ; Branch if BG Mode is not 2 0809861A: 4932 ldr r1, =#0x04000020 ; r1 = #$04000020 0809861C: 8C58 ldrh r0, [r3, #0x22] 0809861E: 8008 strh r0, [r1] ; BG2PA - BG2 Rotation/Scaling Parameter A (alias dx) 08098620: 3102 add r1, #0x02 ; r1 = #$04000022 08098622: 8C98 ldrh r0, [r3, #0x24] 08098624: 8008 strh r0, [r1] ; BG2PB - BG2 Rotation/Scaling Parameter B (alias dmx) 08098626: 3102 add r1, #0x02 ; r1 = #$04000024 08098628: 8CD8 ldrh r0, [r3, #0x26] 0809862A: 8008 strh r0, [r1] ; BG2PC - BG2 Rotation/Scaling Parameter C (alias dy) 0809862C: 3102 add r1, #0x02 ; r1 = #$04000026 0809862E: 8D18 ldrh r0, [r3, #0x28] 08098630: 8008 strh r0, [r1] ; BG2PD - BG2 Rotation/Scaling Parameter D (alias dmy) 08098632: 310A add r1, #0x0A ; r1 = #$04000030 08098634: 8D58 ldrh r0, [r3, #0x2A] 08098636: 8008 strh r0, [r1] ; BG3PA - BG3 Rotation/Scaling Parameter A (alias dx) 08098638: 3102 add r1, #0x02 ; r1 = #$04000032 0809863A: 8D98 ldrh r0, [r3, #0x2C] 0809863C: 8008 strh r0, [r1] ; BG3PB - BG3 Rotation/Scaling Parameter B (alias dmx) 0809863E: 3102 add r1, #0x02 ; r1 = #$04000034 08098640: 8DD8 ldrh r0, [r3, #0x2E] 08098642: 8008 strh r0, [r1] ; BG3PC - BG3 Rotation/Scaling Parameter C (alias dy) 08098644: 3102 add r1, #0x02 ; r1 = #$04000036 08098646: 8E18 ldrh r0, [r3, #0x30] 08098648: 8008 strh r0, [r1] ; BG3PD - BG3 Rotation/Scaling Parameter D (alias dmy) 0809864A: 390E sub r1, #0x0E ; r1 = #$04000028 0809864C: 6B58 ldr r0, [r3, #0x34] 0809864E: 8008 strh r0, [r1] ; BG2X_L - BG2 Reference Point X-Coordinate, lower 16 bit 08098650: 3102 add r1, #0x02 ; r1 = #$0400002A 08098652: 6B58 ldr r0, [r3, #0x34] 08098654: 4A24 ldr r2, =#0x0FFF0000 ; For the upper half, only 12 bit values are valid, so the most significant nibble gets removed 08098656: 4010 and r0, r2 08098658: 1400 asr r0, r0, #0x10 ; ... and then the whole upper double byte gets shifted downwards, so STRH can work 0809865A: 8008 strh r0, [r1] ; BG2X_H - BG2 Reference Point X-Coordinate, upper 12 bit 0809865C: 3102 add r1, #0x02 ; r1 = #$0400002C 0809865E: 6B98 ldr r0, [r3, #0x38] 08098660: 8008 strh r0, [r1] ; BG2Y_L - BG2 Reference Point Y-Coordinate, lower 16 bit 08098662: 3102 add r1, #0x02 ; r1 = #$0400002E 08098664: 6B98 ldr r0, [r3, #0x38] 08098666: 4010 and r0, r2 08098668: 1400 asr r0, r0, #0x10 0809866A: 8008 strh r0, [r1] ; BG2Y_H - BG2 Reference Point Y-Coordinate, upper 12 bit 0809866C: 310A add r1, #0x0A ; r1 = #$04000038 0809866E: 6BD8 ldr r0, [r3, #0x3C] 08098670: 8008 strh r0, [r1] ; BG3X_L - BG3 Reference Point X-Coordinate, lower 16 bit 08098672: 3102 add r1, #0x02 ; r1 = #$0400003A 08098674: 6BD8 ldr r0, [r3, #0x3C] 08098676: 4010 and r0, r2 08098678: 1400 asr r0, r0, #0x10 0809867A: 8008 strh r0, [r1] ; BG3X_H - BG3 Reference Point X-Coordinate, upper 12 bit 0809867C: 3102 add r1, #0x02 ; r1 = #$0400003C 0809867E: 6C18 ldr r0, [r3, #0x40] 08098680: 8008 strh r0, [r1] ; BG3Y_L - BG3 Reference Point Y-Coordinate, lower 16 bit 08098682: 3102 add r1, #0x02 ; r1 = #$0400003E 08098684: 6C18 ldr r0, [r3, #0x40] 08098686: 4010 and r0, r2 08098688: 1400 asr r0, r0, #0x10 0809868A: 8008 strh r0, [r1] ; BG3Y_H - BG3 Reference Point Y-Coordinate, upper 12 bit 0809868C: 4917 ldr r1, =#0x00001F08 0809868E: 1860 add r0, r4, r1 ; Note that this is now the SECOND address that got transferred in this subroutine in r1!) 08098690: 7802 ldrb r2, [r0] ; Load first BYTE 08098692: 3101 add r1, #0x01 08098694: 1860 add r0, r4, r1 ; Increment load address 08098696: 7801 ldrb r1, [r0] ; Load second BYTE 08098698: 0149 lsl r1, r1, #0x5 ; Multiply second byte by #$20 0809869A: 4311 orr r1, r2 ; Put both bytes together 0809869C: 4A14 ldr r2, =#0x00001F0A 0809869E: 18A0 add r0, r4, r2 080986A0: 7800 ldrb r0, [r0] ; Load third BYTE 080986A2: 0280 lsl r0, r0, #0xA ; Multiply third byte by #$3FC00 080986A4: 4301 orr r1, r0 ; Add to other two bytes: #%0000.00cc.cccc.cc0b.bbbb.bbb0.aaaa.aaaa 080986A6: 22CE mov r2, #0xCE 080986A8: 0152 lsl r2, r2, #0x5 ; r2 = #$000019C0 080986AA: 18A0 add r0, r4, r2 080986AC: 8802 ldrh r2, [r0] 080986AE: 2200 mov r2, #0x00 080986B0: 8001 strh r1, [r0] ; Store newly calculated value 080986B2: 8919 ldrh r1, [r3, #0x08] ; Load value for DISPCNT - LCD Control ($04000000) 080986B4: 480F ldr r0, =#0x000080FF ; Load AND-Mask to remove Screen Display for all BGs/OBJs/Windows but OBJ Window Display 080986B6: 4008 and r0, r1 080986B8: 8919 ldrh r1, [r3, #0x08] ; Load old value for DISPCNT - LCD Control ($04000000) 080986BA: 8118 strh r0, [r3, #0x08] ; Store new value for DISPCNT - LCD Control ($04000000) (with the removed flags, see above) 080986BC: 8A58 ldrh r0, [r3, #0x12] ; Load old value for BG0HOFS - BG0 X-Offset ($04000010) 080986BE: 825A strh r2, [r3, #0x12] ; Clear value for BG0HOFS - BG0 X-Offset ($04000010) 080986C0: 8A98 ldrh r0, [r3, #0x14] ; Load old value for BG0VOFS - BG0 Y-Offset ($04000012) 080986C2: 829A strh r2, [r3, #0x14] ; Clear value for BG0VOFS - BG0 Y-Offset ($04000012) 080986C4: 8AD8 ldrh r0, [r3, #0x16] ; Load old value for BG1HOFS - BG1 X-Offset ($04000014) 080986C6: 82DA strh r2, [r3, #0x16] ; Clear value for BG1HOFS - BG1 X-Offset ($04000014) 080986C8: 8B18 ldrh r0, [r3, #0x18] ; Load old value for BG1VOFS - BG1 Y-Offset ($04000016) 080986CA: 831A strh r2, [r3, #0x18] ; Clear value for BG1VOFS - BG1 Y-Offset ($04000016) 080986CC: 8B58 ldrh r0, [r3, #0x1A] ; Load old value for BG2HOFS - BG2 X-Offset ($04000018) 080986CE: 835A strh r2, [r3, #0x1A] ; Clear value for BG2HOFS - BG2 X-Offset ($04000018) 080986D0: 8B98 ldrh r0, [r3, #0x1C] ; Load old value for BG2VOFS - BG2 Y-Offset ($0400001A) 080986D2: 839A strh r2, [r3, #0x1C] ; Clear value for BG2VOFS - BG2 Y-Offset ($0400001A) 080986D4: 8BD8 ldrh r0, [r3, #0x1E] ; Load old value for BG3HOFS - BG3 X-Offset ($0400001C) 080986D6: 83DA strh r2, [r3, #0x1E] ; Clear value for BG3HOFS - BG3 X-Offset ($0400001C) 080986D8: 8C18 ldrh r0, [r3, #0x20] ; Load old value for BG3VOFS - BG3 Y-Offset ($0400001E) 080986DA: 841A strh r2, [r3, #0x20] ; Clear value for BG3VOFS - BG3 Y-Offset ($0400001E) 080986DC: BC10 pop {r4} 080986DE: BC01 pop {r0} 080986E0: 4700 bx r0 ;DATA ;======================= ;080986E2: 0000 lsl r0, r0, #0x0 ;080986E4: 0020 lsl r0, r4, #0x0 ;080986E6: 0400 lsl r0, r0, #0x10 ;080986E8: 0000 lsl r0, r0, #0x0 ;080986EA: 0FFF lsr r7, r7, #0x1F ;080986EC: 1F08 sub r0, r1, #0x4 ;080986EE: 0000 lsl r0, r0, #0x0 ;080986F0: 1F0A sub r2, r1, #0x4 ;080986F2: 0000 lsl r0, r0, #0x0 ;080986F4: 80FF strh r7, [r7, #0x06] ;080986F6: 0000 lsl r0, r0, #0x0
$080986F8 - (General Graphics Updater?)
080986F8: B510 push {r4, lr} 080986FA: 4C09 ldr r4, =#0x0202DE30 080986FC: 6860 ldr r0, [r4, #0x04] ; r0 = $02020DE34 = Offset to the OAM buffer 080986FE: F000 bl 08098700: F811 bl 0x08098724 ; DMA the whole OAM buffer in OAM 08098702: F000 bl 08098704: F843 bl 0x0809878C ; (Load different Graphics depending on set flags) 08098706: F000 bl 08098708: F8EB bl 0x080988E0 ; (Update VRAM depending on set flags) 0809870A: 21A0 mov r1, #0xA0 0809870C: 0049 lsl r1, r1, #0x1 ; r1 = #$00000140 0809870E: 1860 add r0, r4, r1 ; r0 = #$0202DF70 08098710: F000 bl 08098712: F96A bl 0x080989E8 08098714: 6860 ldr r0, [r4, #0x04] ; r0 = Offset to the Palette buffer 08098716: F000 bl 08098718: F81F bl 0x08098758 ; DMA the whole Palette buffer in Palette RAM 0809871A: BC10 pop {r4} 0809871C: BC01 pop {r0} 0809871E: 4700 bx r0 ;DATA ;============= ;08098720: DE30 ??? ;08098722: 0202 lsl r2, r0, #0x8
$08098724 - DMA to OAM
r0 + #$000012C0 is the address for the OAM buffer. A DMA transfers the whole buffer in OAM.
08098724: 490A ldr r1, =#0x040000D4 08098726: 2296 mov r2, #0x96 08098728: 0152 lsl r2, r2, #0x5 ; r2 = #$000012C0 0809872A: 1880 add r0, r0, r2 0809872C: 6008 str r0, [r1] ; DMA Source Address = Original r0 + #$000012C0 0809872E: 20E0 mov r0, #0xE0 08098730: 04C0 lsl r0, r0, #0x13 ; r0 = #$07000000 08098732: 6048 str r0, [r1, #0x04] ; DMA Source Address = $07000000 (OAM - OBJ Attributes) 08098734: 4807 ldr r0, =#0x80000200 ; $200 Double Bytes to transfer - Whole OAM content 08098736: 6088 str r0, [r1, #0x08] 08098738: 6888 ldr r0, [r1, #0x08] 0809873A: 6888 ldr r0, [r1, #0x08] 0809873C: 2280 mov r2, #0x80 0809873E: 0612 lsl r2, r2, #0x18 ; AND Mask for the DMA-Enable Bit 08098740: 2800 cmp r0, #0x00 08098742: DA03 bge 0x0809874C ; Overbranch if DMA is completed 08098744: 6888 ldr r0, [r1, #0x08] 08098746: 4010 and r0, r2 08098748: 2800 cmp r0, #0x00 0809874A: D1FB bne 0x08098744 ; Loop if DMA isn't completed 0809874C: 4770 bx lr ;DATA ;=============== ;0809874E: 0000 lsl r0, r0, #0x0 ;08098750: 00D4 lsl r4, r2, #0x3 ;08098752: 0400 lsl r0, r0, #0x10 ;08098754: 0200 lsl r0, r0, #0x8 ;08098756: 8000 strh r0, [r0]
$08098758 - DMA to BG/OBJ Palette RAM
Transfers the whole BG/OBJ Palette buffer into the actual Palette RAM.
08098758: 490A ldr r1, =#0x040000D4 0809875A: 22CE mov r2, #0xCE 0809875C: 0152 lsl r2, r2, #0x5 ; r2 = #$000019C0 0809875E: 1880 add r0, r0, r2 08098760: 6008 str r0, [r1] ; DMA Source: r0 + #$000019C0 08098762: 20A0 mov r0, #0xA0 08098764: 04C0 lsl r0, r0, #0x13 08098766: 6048 str r0, [r1, #0x04] ; DMA Destination: $05000000 (BG/OBJ Palette RAM) 08098768: 4807 ldr r0, =#0x80000200 0809876A: 6088 str r0, [r1, #0x08] ; Data Size: 200 Doublebytes to transfer - Whole Pal RAM content 0809876C: 6888 ldr r0, [r1, #0x08] 0809876E: 6888 ldr r0, [r1, #0x08] 08098770: 2280 mov r2, #0x80 08098772: 0612 lsl r2, r2, #0x18 08098774: 2800 cmp r0, #0x00 08098776: DA03 bge 0x08098780 ; Overbranch if DMA is completed 08098778: 6888 ldr r0, [r1, #0x08] 0809877A: 4010 and r0, r2 0809877C: 2800 cmp r0, #0x00 0809877E: D1FB bne 0x08098778 ; Loop if DMA isn't completed 08098780: 4770 bx lr ;DATA ;=================== 08098782: 0000 lsl r0, r0, #0x0 08098784: 00D4 lsl r4, r2, #0x3 08098786: 0400 lsl r0, r0, #0x10 08098788: 0200 lsl r0, r0, #0x8 0809878A: 8000 strh r0, [r0]
$0809878C - (Load different graphics depending on set flags)
0809878C: B570 push {r4, r5, r6, lr} 0809878E: B081 add sp, #-0x004 08098790: 4C4C ldr r4, =#0x0202DE30 08098792: 484D ldr r0, =#0x000048A4 08098794: 1825 add r5, r4, r0 ; r5 = #$020326D4 08098796: 7828 ldrb r0, [r5] 08098798: 0680 lsl r0, r0, #0x1A ; only the lowest 6 bits are left over, these are the highest 6 bits 0809879A: 2800 cmp r0, #0x00 0809879C: DA01 bge 0x080987A2 ; Branch if bit 5 of the original value is not set 0809879E: F7FF bl 080987A0: F9F9 bl 0x08097B94 ; Load Title Screen Graphic data 080987A2: 7828 ldrb r0, [r5] 080987A4: 0640 lsl r0, r0, #0x19 ; only the lowest 7 bits are left over, these are the highest 7 bits 080987A6: 2800 cmp r0, #0x00 080987A8: DA04 bge 0x080987B4 ; Branch if bit 6 of the original value is not set 080987AA: 1C20 add r0, r4, #0x0 080987AC: 308E add r0, #0x8E 080987AE: 8800 ldrh r0, [r0] ; Load value from $0202DEBE - The number of Rows the title screen has to be scrolled down 080987B0: F7FF bl 080987B2: FA80 bl 0x08097CB4 ; Load title screen 080987B4: 7828 ldrb r0, [r5] 080987B6: 09C0 lsr r0, r0, #0x7 080987B8: 2800 cmp r0, #0x00 080987BA: D004 beq 0x080987C6 ; Branch if the MSB of the loaded byte is set 080987BC: 4943 ldr r1, =#0x000048A3 080987BE: 1860 add r0, r4, r1 080987C0: 7800 ldrb r0, [r0] ; Load value from $020326D3 (Which Story Demo Background should be loaded, #$00-03) 080987C2: F7FF bl 080987C4: FA97 bl 0x08097CF4 ; Load Intro Story Demo Background 080987C6: 4A42 ldr r2, =#0x000048A5 080987C8: 18A5 add r5, r4, r2 080987CA: 7828 ldrb r0, [r5] ; Load value from $020326D5 080987CC: 07C0 lsl r0, r0, #0x1F 080987CE: 2800 cmp r0, #0x00 080987D0: D004 beq 0x080987DC ; Branch if bit 0 of $020326D5 is clear 080987D2: 493E ldr r1, =#0x000048A3 080987D4: 1860 add r0, r4, r1 080987D6: 7800 ldrb r0, [r0] ; Load value from $020326D3 080987D8: F7FF bl 080987DA: FAB8 bl 0x08097D4C 080987DC: 7828 ldrb r0, [r5] ; Load value from $020326D5 080987DE: 0780 lsl r0, r0, #0x1E 080987E0: 2800 cmp r0, #0x00 080987E2: DA07 bge 0x080987F4 ; Branch if bit 1 of $020326D5 is clear 080987E4: 4A3B ldr r2, =#0x000048A2 080987E6: 18A0 add r0, r4, r2 080987E8: 7800 ldrb r0, [r0] ; Load value from $020326D2 080987EA: 3201 add r2, #0x01 080987EC: 18A1 add r1, r4, r2 080987EE: 7809 ldrb r1, [r1] 080987F0: F7FF bl 080987F2: FB1A bl 0x08097E28 080987F4: 7828 ldrb r0, [r5] ; Load value from $020326D5 080987F6: 0740 lsl r0, r0, #0x1D 080987F8: 1C26 add r6, r4, #0x0 080987FA: 2800 cmp r0, #0x00 080987FC: DA14 bge 0x08098828 ; Branch if bit 2 of $020326D5 is clear 080987FE: 4669 mov r1, sp 08098800: 2000 mov r0, #0x00 08098802: 8008 strh r0, [r1] ; Clear newly added entry on Stack 08098804: 4934 ldr r1, =#0x040000D4 08098806: 4668 mov r0, sp 08098808: 6008 str r0, [r1] ; DMA Source Address: Cleared Stack entry 0809880A: 20C0 mov r0, #0xC0 0809880C: 04C0 lsl r0, r0, #0x13 0809880E: 6048 str r0, [r1, #0x04] ; DMA Destination Address: $06000000 (VRAM) 08098810: 4832 ldr r0, =#0x81008000 08098812: 6088 str r0, [r1, #0x08] ; Fixed DMA, clears $8000 Doublebytes (two thirds) 08098814: 6888 ldr r0, [r1, #0x08] 08098816: 6888 ldr r0, [r1, #0x08] 08098818: 2280 mov r2, #0x80 0809881A: 0612 lsl r2, r2, #0x18 ; AND Mask for DMA Enable bit 0809881C: 2800 cmp r0, #0x00 0809881E: DA03 bge 0x08098828 ; Overbranch if DMA is completed 08098820: 6888 ldr r0, [r1, #0x08] 08098822: 4010 and r0, r2 08098824: 2800 cmp r0, #0x00 08098826: D1FB bne 0x08098820 ; Loop if DMA is not completed 08098828: 1C34 add r4, r6, #0x0 ; r4 = #$0202DE30 0809882A: 4929 ldr r1, =#0x000048A5 0809882C: 1865 add r5, r4, r1 ; r5 = #$020326D5 0809882E: 7828 ldrb r0, [r5] 08098830: 0700 lsl r0, r0, #0x1C ; Branch if bit 3 of $020326D5 is clear 08098832: 2800 cmp r0, #0x00 08098834: DA04 bge 0x08098840 08098836: 4A25 ldr r2, =#0x000048A3 08098838: 18A0 add r0, r4, r2 0809883A: 7800 ldrb r0, [r0] ; Load value from $020326D3 0809883C: F7FF bl 0809883E: FBCC bl 0x08097FD8 08098840: 7828 ldrb r0, [r5] 08098842: 06C0 lsl r0, r0, #0x1B 08098844: 2800 cmp r0, #0x00 08098846: DA07 bge 0x08098858 ; Branch if bit 4 of $020326D5 is clear 08098848: 1C20 add r0, r4, #0x0 0809884A: 3041 add r0, #0x41 0809884C: 7800 ldrb r0, [r0] 0809884E: 4A1F ldr r2, =#0x000048A3 08098850: 18A1 add r1, r4, r2 08098852: 7809 ldrb r1, [r1] 08098854: F7FF bl 08098856: FC18 bl 0x08098088 08098858: 7828 ldrb r0, [r5] 0809885A: 0680 lsl r0, r0, #0x1A 0809885C: 2800 cmp r0, #0x00 0809885E: DA07 bge 0x08098870 ; Branch if bit 5 of $020326D5 is clear 08098860: 1C20 add r0, r4, #0x0 08098862: 3041 add r0, #0x41 08098864: 7800 ldrb r0, [r0] 08098866: 4A19 ldr r2, =#0x000048A3 08098868: 18A1 add r1, r4, r2 0809886A: 7809 ldrb r1, [r1] 0809886C: F7FF bl 0809886E: FC54 bl 0x08098118 08098870: 7828 ldrb r0, [r5] 08098872: 0640 lsl r0, r0, #0x19 08098874: 2800 cmp r0, #0x00 08098876: DA04 bge 0x08098882 08098878: 4914 ldr r1, =#0x000048A3 0809887A: 1860 add r0, r4, r1 0809887C: 7800 ldrb r0, [r0] 0809887E: F7FF bl 08098880: FC7D bl 0x0809817C 08098882: 4811 ldr r0, =#0x000048A4 08098884: 1832 add r2, r6, r0 08098886: 7811 ldrb r1, [r2] 08098888: 2421 mov r4, #0x21 0809888A: 4264 neg r4, r4 0809888C: 1C20 add r0, r4, #0x0 0809888E: 4008 and r0, r1 08098890: 2341 mov r3, #0x41 08098892: 425B neg r3, r3 08098894: 4018 and r0, r3 08098896: 217F mov r1, #0x7F 08098898: 4008 and r0, r1 0809889A: 7010 strb r0, [r2] 0809889C: 7829 ldrb r1, [r5] 0809889E: 2002 mov r0, #0x02 080988A0: 4240 neg r0, r0 080988A2: 4008 and r0, r1 080988A4: 2103 mov r1, #0x03 080988A6: 4249 neg r1, r1 080988A8: 4008 and r0, r1 080988AA: 3902 sub r1, #0x02 080988AC: 4008 and r0, r1 080988AE: 3904 sub r1, #0x04 080988B0: 4008 and r0, r1 080988B2: 3908 sub r1, #0x08 080988B4: 4008 and r0, r1 080988B6: 4020 and r0, r4 080988B8: 4018 and r0, r3 080988BA: 7028 strb r0, [r5] 080988BC: B001 add sp, #0x004 080988BE: BC70 pop {r4, r5, r6} 080988C0: BC01 pop {r0} 080988C2: 4700 bx r0 ;DATA ;=================== ;080988C4: DE30 ??? ;080988C6: 0202 lsl r2, r0, #0x8 ;080988C8: 48A4 ldr r0, =#0x401068A0 ;080988CA: 0000 lsl r0, r0, #0x0 ;080988CC: 48A3 ldr r0, =#0x401068A0 ;080988CE: 0000 lsl r0, r0, #0x0 ;080988D0: 48A5 ldr r0, =#0x80283001 ;080988D2: 0000 lsl r0, r0, #0x0 ;080988D4: 48A2 ldr r0, =#0xD1FB2800 ;080988D6: 0000 lsl r0, r0, #0x0 ;080988D8: 00D4 lsl r4, r2, #0x3 ;080988DA: 0400 lsl r0, r0, #0x10 ;080988DC: 8000 strh r0, [r0] ;080988DE: 8100 strh r0, [r0, #0x08]
$080988E0 - ?
$0203E9D0 to $0203E9D3 are four registers that can trigger something if they're unequal 0. Afterwards, all these flag registers are cleared.
080988E0: B510 push {r4, lr} 080988E2: 4C15 ldr r4, =#0x0202DE30 080988E4: 6862 ldr r2, [r4, #0x04] ; Load the Offset of the Graphics Buffer (presumably #$0203CAD0) 080988E6: 21F8 mov r1, #0xF8 080988E8: 0149 lsl r1, r1, #0x5 ; #$00001F00 080988EA: 1850 add r0, r2, r1 ; r0 = #$0203E9D0 080988EC: 7800 ldrb r0, [r0] 080988EE: 2800 cmp r0, #0x00 080988F0: D003 beq 0x080988FA 080988F2: 4912 ldr r1, =#0x0600E000 ; VRAM Destination 080988F4: 1C10 add r0, r2, #0x0 ; (presumably #$0203CAD0) 080988F6: F000 bl 080988F8: F917 bl 0x08098B28 080988FA: 6861 ldr r1, [r4, #0x04] 080988FC: 4A10 ldr r2, =#0x00001F01 080988FE: 1888 add r0, r1, r2 ; r0 = #$0203E9D1 08098900: 7800 ldrb r0, [r0] 08098902: 2800 cmp r0, #0x00 08098904: D005 beq 0x08098912 08098906: 2396 mov r3, #0x96 08098908: 00DB lsl r3, r3, #0x3 ; Additional Load Address Offset #$000004B0 0809890A: 18C8 add r0, r1, r3 ; (presumably #$0203CF80) 0809890C: 490D ldr r1, =#0x0600E800 ; VRAM Destination 0809890E: F000 bl 08098910: F90B bl 0x08098B28 08098912: 6862 ldr r2, [r4, #0x04] 08098914: 490C ldr r1, =#0x00001F02 08098916: 1850 add r0, r2, r1 ; r0 = #$0203E9D2 08098918: 7800 ldrb r0, [r0] 0809891A: 2800 cmp r0, #0x00 0809891C: D01E beq 0x0809895C 0809891E: 6820 ldr r0, [r4] 08098920: 8901 ldrh r1, [r0, #0x08] ; r1 = [$0202DE38] 08098922: 2007 mov r0, #0x07 08098924: 4008 and r0, r1 08098926: 2802 cmp r0, #0x02 08098928: D112 bne 0x08098950 0809892A: 2396 mov r3, #0x96 0809892C: 011B lsl r3, r3, #0x4 ; Additional Load Address Offset #$00000960 0809892E: 18D0 add r0, r2, r3 ; (presumably #$0203D430) 08098930: 4906 ldr r1, =#0x0600F000 ; VRAM Destination 08098932: F000 bl 08098934: F927 bl 0x08098B84 08098936: E011 b 0x0809895C ;DATA ;================= ;08098938: DE30 ??? ;0809893A: 0202 lsl r2, r0, #0x8 ;0809893C: E000 b 0x08098940 ;0809893E: 0600 lsl r0, r0, #0x18 ;08098940: 1F01 sub r1, r0, #0x4 ;08098942: 0000 lsl r0, r0, #0x0 ;08098944: E800 ??? ;08098946: 0600 lsl r0, r0, #0x18 ;08098948: 1F02 sub r2, r0, #0x4 ;0809894A: 0000 lsl r0, r0, #0x0 ;0809894C: F000 bl ;0809894E: 0600 lsl r0, r0, #0x18 08098950: 2196 mov r1, #0x96 08098952: 0109 lsl r1, r1, #0x4 08098954: 1850 add r0, r2, r1 08098956: 490B ldr r1, =#0x0600F000 08098958: F000 bl 0809895A: F8E6 bl 0x08098B28 0809895C: 490A ldr r1, =#0x0202DE30 0809895E: 684A ldr r2, [r1, #0x04] 08098960: 4B0A ldr r3, =#0x00001F03 08098962: 18D0 add r0, r2, r3 ; r0 = #$0203E9D3 08098964: 7800 ldrb r0, [r0] 08098966: 2800 cmp r0, #0x00 08098968: D01A beq 0x080989A0 0809896A: 6808 ldr r0, [r1] 0809896C: 8901 ldrh r1, [r0, #0x08] 0809896E: 2007 mov r0, #0x07 08098970: 4008 and r0, r1 08098972: 2802 cmp r0, #0x02 08098974: D10E bne 0x08098994 08098976: 21E1 mov r1, #0xE1 08098978: 0109 lsl r1, r1, #0x4 0809897A: 1850 add r0, r2, r1 0809897C: 4904 ldr r1, =#0x0600F800 ; VRAM Destination 0809897E: F000 bl 08098980: F901 bl 0x08098B84 08098982: E00D b 0x080989A0 ;DATA ;=============== ;08098984: F000 bl ;08098986: 0600 lsl r0, r0, #0x18 ;08098988: DE30 ??? ;0809898A: 0202 lsl r2, r0, #0x8 ;0809898C: 1F03 sub r3, r0, #0x4 ;0809898E: 0000 lsl r0, r0, #0x0 ;08098990: F800 bl 0x08098992 ;08098992: 0600 lsl r0, r0, #0x18 08098994: 23E1 mov r3, #0xE1 08098996: 011B lsl r3, r3, #0x4 08098998: 18D0 add r0, r2, r3 0809899A: 490E ldr r1, =#0x0600F800 0809899C: F000 bl 0809899E: F8C4 bl 0x08098B28 080989A0: 4A0D ldr r2, =#0x0202DE30 ; Clear the four "flag registers" 080989A2: 6850 ldr r0, [r2, #0x04] 080989A4: 21F8 mov r1, #0xF8 080989A6: 0149 lsl r1, r1, #0x5 ; r1 = #$00001F00 080989A8: 1840 add r0, r0, r1 ; r0 = #$0203E9D0 080989AA: 7801 ldrb r1, [r0] 080989AC: 2100 mov r1, #0x00 080989AE: 7001 strb r1, [r0] 080989B0: 6850 ldr r0, [r2, #0x04] 080989B2: 4B0A ldr r3, =#0x00001F01 080989B4: 18C0 add r0, r0, r3 ; r0 = #$0203E9D1 080989B6: 7803 ldrb r3, [r0] 080989B8: 7001 strb r1, [r0] 080989BA: 6850 ldr r0, [r2, #0x04] 080989BC: 4B08 ldr r3, =#0x00001F02 080989BE: 18C0 add r0, r0, r3 ; r0 = #$0203E9D2 080989C0: 7803 ldrb r3, [r0] 080989C2: 7001 strb r1, [r0] 080989C4: 6850 ldr r0, [r2, #0x04] 080989C6: 4A07 ldr r2, =#0x00001F03 080989C8: 1880 add r0, r0, r2 ; r0 = #$0203E9D3 080989CA: 7802 ldrb r2, [r0] 080989CC: 7001 strb r1, [r0] 080989CE: BC10 pop {r4} 080989D0: BC01 pop {r0} 080989D2: 4700 bx r0 ;DATA ;====================== ;080989D4: F800 bl 0x07F989D6 ;080989D6: 0600 lsl r0, r0, #0x18 ;080989D8: DE30 ??? ;080989DA: 0202 lsl r2, r0, #0x8 ;080989DC: 1F01 sub r1, r0, #0x4 ;080989DE: 0000 lsl r0, r0, #0x0 ;080989E0: 1F02 sub r2, r0, #0x4 ;080989E2: 0000 lsl r0, r0, #0x0 ;080989E4: 1F03 sub r3, r0, #0x4 ;080989E6: 0000 lsl r0, r0, #0x0
$080989E8 - ?
r0 contains an address. The Data at that Address starts with it's destination (as a 32-bit-address), followed by the actual data (#$40 Bytes). This gets transferred with a DMA. Behind the Data are 48 Bytes(?) of additional Data for this subroutine (settings?).
080989E8: B5F0 push {r4, r5, r6, r7, lr} 080989EA: 464F mov r7, r9 080989EC: 4646 mov r6, r8 080989EE: B4C0 push {r6, r7} 080989F0: B081 add sp, #-0x004 080989F2: 1C06 add r6, r0, #0x0 080989F4: 1C32 add r2, r6, #0x0 080989F6: 4669 mov r1, sp 080989F8: 3102 add r1, #0x02 080989FA: 4B39 ldr r3, =#0x0000475A 080989FC: 18F0 add r0, r6, r3 ; r0 = Original r0 + #$0000475A 080989FE: 7800 ldrb r0, [r0] ; Load Byte from there 08098A00: 8008 strh r0, [r1] ; Store Double Byte in newly added Stack Entry 08098A02: 8808 ldrh r0, [r1] ; Load that Double Byte in r0 08098A04: 2800 cmp r0, #0x00 08098A06: D041 beq 0x08098A8C ; (Leave out a whole lot if is =#$00) 08098A08: 4B36 ldr r3, =#0x040000D4 08098A0A: 4C37 ldr r4, =#0x80000020 ; DMA Enable Bit, Transfer $20 Double Bytes 08098A0C: 46A1 mov r9, r4 ; Temp Store it in r9 08098A0E: 2080 mov r0, #0x80 08098A10: 0600 lsl r0, r0, #0x18 08098A12: 4680 mov r8, r0 ; Set up AND-Mask for Enable Bit, Temp Store it in r8 08098A14: 1C0F add r7, r1, #0x0 ; r7 = Address of the Double Byte on Stack 08098A16: 1C10 add r0, r2, #0x0 ; r0 = Original r0 08098A18: 3087 add r0, #0x87 ; r0 = The address of the forty-fourth byte after the DMA transferred data 08098A1A: 7801 ldrb r1, [r0] 08098A1C: 200C mov r0, #0x0C ; Setup AND-Mask (#%0000.1100) 08098A1E: 4008 and r0, r1 08098A20: 2188 mov r1, #0x88 08098A22: 1889 add r1, r1, r2 08098A24: 468C mov r12, r1 ; r12 = The address of the forty-fifth byte after the DMA transferred data 08098A26: 2800 cmp r0, #0x00 ; Branch if bits 2 and 3 of the forty-fourth byte are not clear 08098A28: D129 bne 0x08098A7E 08098A2A: 1D10 add r0, r2, #0x4 08098A2C: 6018 str r0, [r3] ; DMA Source is the address in Original r0 + 4 08098A2E: 6811 ldr r1, [r2] ; r2 (Original r0) CONTAINS the address of the DMA Destination 08098A30: 6059 str r1, [r3, #0x04] 08098A32: 464C mov r4, r9 08098A34: 609C str r4, [r3, #0x08] ; Activate Transfer, #$20 Double Bytes 08098A36: 6898 ldr r0, [r3, #0x08] 08098A38: 1C1D add r5, r3, #0x0 ; r5 = #$040000D4 08098A3A: 6898 ldr r0, [r3, #0x08] 08098A3C: 4644 mov r4, r8 ; r8 is the AND-Mask for the DMA-Enable bit 08098A3E: 4020 and r0, r4 08098A40: 1C0C add r4, r1, #0x0 ; r4 is now the DMA Destination Address 08098A42: 1C11 add r1, r2, #0x0 ; r1 is now the Original r0 08098A44: 3144 add r1, #0x44 ; r1 is now the address of the Data right behind the DMA data 08098A46: 2800 cmp r0, #0x00 08098A48: D005 beq 0x08098A56 ; Branch if DMA is completed 08098A4A: 2280 mov r2, #0x80 08098A4C: 0612 lsl r2, r2, #0x18 08098A4E: 68A8 ldr r0, [r5, #0x08] 08098A50: 4010 and r0, r2 08098A52: 2800 cmp r0, #0x00 08098A54: D1FB bne 0x08098A4E ; Loop if DMA is not completed 08098A56: 6019 str r1, [r3] 08098A58: 2180 mov r1, #0x80 08098A5A: 00C9 lsl r1, r1, #0x3 08098A5C: 1860 add r0, r4, r1 08098A5E: 6058 str r0, [r3, #0x04] 08098A60: 464A mov r2, r9 08098A62: 609A str r2, [r3, #0x08] 08098A64: 6898 ldr r0, [r3, #0x08] 08098A66: 1C1A add r2, r3, #0x0 08098A68: 6890 ldr r0, [r2, #0x08] 08098A6A: 4644 mov r4, r8 08098A6C: 4020 and r0, r4 08098A6E: 2800 cmp r0, #0x00 08098A70: D005 beq 0x08098A7E 08098A72: 2180 mov r1, #0x80 08098A74: 0609 lsl r1, r1, #0x18 08098A76: 6890 ldr r0, [r2, #0x08] 08098A78: 4008 and r0, r1 08098A7A: 2800 cmp r0, #0x00 08098A7C: D1FB bne 0x08098A76 08098A7E: 8838 ldrh r0, [r7] 08098A80: 3801 sub r0, #0x01 08098A82: 8038 strh r0, [r7] 08098A84: 4662 mov r2, r12 08098A86: 8838 ldrh r0, [r7] 08098A88: 2800 cmp r0, #0x00 08098A8A: D1C4 bne 0x08098A16 08098A8C: 4914 ldr r1, =#0x0000475A 08098A8E: 1870 add r0, r6, r1 08098A90: 7801 ldrb r1, [r0] 08098A92: 2900 cmp r1, #0x00 08098A94: D118 bne 0x08098AC8 08098A96: 4668 mov r0, sp 08098A98: 8001 strh r1, [r0] 08098A9A: 8800 ldrh r0, [r0] 08098A9C: 287F cmp r0, #0x7F 08098A9E: D813 bhi 0x08098AC8 08098AA0: 4D12 ldr r5, =#0xFFFFF000 08098AA2: 4C13 ldr r4, =#0xFFFFFC00 08098AA4: 466B mov r3, sp 08098AA6: 1C32 add r2, r6, #0x0 08098AA8: 3284 add r2, #0x84 08098AAA: 8811 ldrh r1, [r2] 08098AAC: 1C28 add r0, r5, #0x0 08098AAE: 4008 and r0, r1 08098AB0: 8010 strh r0, [r2] 08098AB2: 8851 ldrh r1, [r2, #0x02] 08098AB4: 1C20 add r0, r4, #0x0 08098AB6: 4008 and r0, r1 08098AB8: 8050 strh r0, [r2, #0x02] 08098ABA: 8818 ldrh r0, [r3] 08098ABC: 3001 add r0, #0x01 08098ABE: 8018 strh r0, [r3] 08098AC0: 3288 add r2, #0x88 08098AC2: 8818 ldrh r0, [r3] 08098AC4: 287F cmp r0, #0x7F 08098AC6: D9F0 bls 0x08098AAA 08098AC8: 4B0A ldr r3, =#0x00004418 08098ACA: 18F2 add r2, r6, r3 08098ACC: 2488 mov r4, #0x88 08098ACE: 01E4 lsl r4, r4, #0x7 08098AD0: 1931 add r1, r6, r4 08098AD2: 6810 ldr r0, [r2] 08098AD4: 4288 cmp r0, r1 08098AD6: D111 bne 0x08098AFC 08098AD8: 4907 ldr r1, =#0x0000440C 08098ADA: 1870 add r0, r6, r1 08098ADC: E00F b 0x08098AFE 08098ADE: 0000 lsl r0, r0, #0x0 08098AE0: 475A bx r11 08098AE2: 0000 lsl r0, r0, #0x0 08098AE4: 00D4 lsl r4, r2, #0x3 08098AE6: 0400 lsl r0, r0, #0x10 08098AE8: 0020 lsl r0, r4, #0x0 08098AEA: 8000 strh r0, [r0] 08098AEC: F000 bl 08098AEE: FFFF bl 0x08099AEE 08098AF0: FC00 bl 0x080982F2 08098AF2: FFFF bl 0x07C99AF2 08098AF4: 4418 add r0, r3 08098AF6: 0000 lsl r0, r0, #0x0 08098AF8: 440C add r4, r1 08098AFA: 0000 lsl r0, r0, #0x0 08098AFC: 1C08 add r0, r1, #0x0 08098AFE: 6010 str r0, [r2] 08098B00: 4A07 ldr r2, =#0x00004418 08098B02: 18B0 add r0, r6, r2 08098B04: 6800 ldr r0, [r0] 08098B06: 2100 mov r1, #0x00 08098B08: 7241 strb r1, [r0, #0x09] 08098B0A: 4B06 ldr r3, =#0x0000475A 08098B0C: 18F0 add r0, r6, r3 08098B0E: 7001 strb r1, [r0] 08098B10: B001 add sp, #0x004 08098B12: BC18 pop {r3, r4} 08098B14: 4698 mov r8, r3 08098B16: 46A1 mov r9, r4 08098B18: BCF0 pop {r4, r5, r6, r7} 08098B1A: BC01 pop {r0} 08098B1C: 4700 bx r0 ;DATA ;================== ;08098B1E: 0000 lsl r0, r0, #0x0 ;08098B20: 4418 add r0, r3 ;08098B22: 0000 lsl r0, r0, #0x0 ;08098B24: 475A bx r11 ;08098B26: 0000 lsl r0, r0, #0x0
$08098B28 - (#$15 smaller DMAs with Gaps)
r0 contains a DMA Source Address.
r1 contains a DMA Destination Address.
- $15 (twenty-one) DMAs are executed here, but after each time, the destination address gets #$40 added, while the Source address gets #$3C added, so each time, a 4 byte gap is created.
08098B28: B570 push {r4, r5, r6, lr} 08098B2A: B081 add sp, #-0x004 ; Add Entry on Stack (Used as counter) 08098B2C: 1C03 add r3, r0, #0x0 08098B2E: 1C0E add r6, r1, #0x0 08098B30: 4669 mov r1, sp 08098B32: 2000 mov r0, #0x00 08098B34: 8008 strh r0, [r1] ; Clear newly add Stack Entry (Set up Counter) 08098B36: 4668 mov r0, sp 08098B38: 8800 ldrh r0, [r0] 08098B3A: 2814 cmp r0, #0x14 08098B3C: D819 bhi 0x08098B72 08098B3E: 4C0F ldr r4, =#0x040000D4 08098B40: 466D mov r5, sp 08098B42: 6023 str r3, [r4] ; Setup DMA Source Address 08098B44: 6066 str r6, [r4, #0x04] ; Setup DMA Destination Address 08098B46: 480E ldr r0, =#0x8000001E ; Transfer #$1E Double Bytes 08098B48: 60A0 str r0, [r4, #0x08] 08098B4A: 68A0 ldr r0, [r4, #0x08] 08098B4C: 68A0 ldr r0, [r4, #0x08] 08098B4E: 2280 mov r2, #0x80 08098B50: 0612 lsl r2, r2, #0x18 08098B52: 333C add r3, #0x3C ; Add #$3C to Source Address 08098B54: 1C31 add r1, r6, #0x0 08098B56: 3140 add r1, #0x40 ; Add #$40 to Destination Address 08098B58: 2800 cmp r0, #0x00 08098B5A: DA03 bge 0x08098B64 ; Branch if the DMA is completed 08098B5C: 68A0 ldr r0, [r4, #0x08] 08098B5E: 4010 and r0, r2 08098B60: 2800 cmp r0, #0x00 08098B62: D1FB bne 0x08098B5C ; Loop if the DMA is not completed 08098B64: 1C0E add r6, r1, #0x0 ; Transfer modified Destination address back to r6 08098B66: 8828 ldrh r0, [r5] 08098B68: 3001 add r0, #0x01 ; Increment Loop counter 08098B6A: 8028 strh r0, [r5] 08098B6C: 8828 ldrh r0, [r5] 08098B6E: 2814 cmp r0, #0x14 ; Has Loop counter SURPASSED #$14? Loop if not. 08098B70: D9E7 bls 0x08098B42 08098B72: B001 add sp, #0x004 ; Restore registers and Stack, Exit 08098B74: BC70 pop {r4, r5, r6} 08098B76: BC01 pop {r0} 08098B78: 4700 bx r0 ;08098B7A: 0000 lsl r0, r0, #0x0 ;08098B7C: 00D4 lsl r4, r2, #0x3 ;08098B7E: 0400 lsl r0, r0, #0x10 ;08098B80: 001E lsl r6, r3, #0x0 ;08098B82: 8000 strh r0, [r0]
$08098B84 - (#$15 smaller DMAs with Gaps)
r0 contains a DMA Source Address.
r1 contains a DMA Destination Address.
$15 (twenty-one) DMAs are executed here, but after each time, the destination address gets #$20 added, while the Source address gets #$1E added, so each time, a 2 byte gap is created.
Maybe used for Palettes?
08098B84: B570 push {r4, r5, r6, lr} 08098B86: B081 add sp, #-0x004 ; Add 4 bytes to stack (used as Loop Counter) 08098B88: 1C03 add r3, r0, #0x0 08098B8A: 1C0E add r6, r1, #0x0 08098B8C: 4669 mov r1, sp 08098B8E: 2000 mov r0, #0x00 08098B90: 8008 strh r0, [r1] ; Clear newly added 4 bytes on stack (Setup Loop Counter) 08098B92: 4668 mov r0, sp 08098B94: 8800 ldrh r0, [r0] 08098B96: 2814 cmp r0, #0x14 08098B98: D819 bhi 0x08098BCE ; Branch and exit if the Loop Counter SURPASSED #$14 08098B9A: 4C0F ldr r4, =#0x040000D4 08098B9C: 466D mov r5, sp 08098B9E: 6023 str r3, [r4] ; Setup DMA Source Address 08098BA0: 6066 str r6, [r4, #0x04] ; Setup DMA Destination Address 08098BA2: 480E ldr r0, =#0x8000000F 08098BA4: 60A0 str r0, [r4, #0x08] ; Activate DMA, transfer #$0F Doublebytes 08098BA6: 68A0 ldr r0, [r4, #0x08] 08098BA8: 68A0 ldr r0, [r4, #0x08] 08098BAA: 2280 mov r2, #0x80 08098BAC: 0612 lsl r2, r2, #0x18 08098BAE: 331E add r3, #0x1E ; Add #$1E to Source Address 08098BB0: 1C31 add r1, r6, #0x0 08098BB2: 3120 add r1, #0x20 ; Add #$20 to Destination Address 08098BB4: 2800 cmp r0, #0x00 08098BB6: DA03 bge 0x08098BC0 ; Branch if the DMA is completed 08098BB8: 68A0 ldr r0, [r4, #0x08] 08098BBA: 4010 and r0, r2 08098BBC: 2800 cmp r0, #0x00 08098BBE: D1FB bne 0x08098BB8 ; Loop if the DMA is not completed 08098BC0: 1C0E add r6, r1, #0x0 ; Transfer newly calculated Destination Address back 08098BC2: 8828 ldrh r0, [r5] 08098BC4: 3001 add r0, #0x01 ; Increment Loop counter 08098BC6: 8028 strh r0, [r5] 08098BC8: 8828 ldrh r0, [r5] 08098BCA: 2814 cmp r0, #0x14 ; Has the Loop Counter SURPASSED #$14? 08098BCC: D9E7 bls 0x08098B9E 08098BCE: B001 add sp, #0x004 08098BD0: BC70 pop {r4, r5, r6} 08098BD2: BC01 pop {r0} 08098BD4: 4700 bx r0 ;DATA ;================== ;08098BD6: 0000 lsl r0, r0, #0x0 ;08098BD8: 00D4 lsl r4, r2, #0x3 ;08098BDA: 0400 lsl r0, r0, #0x10 ;08098BDC: 000F lsl r7, r1, #0x0 ;08098BDE: 8000 strh r0, [r0]
$08098BE0 - ?
08098BE0: B500 push {lr} 08098BE2: 1C02 add r2, r0, #0x0 08098BE4: 1C11 add r1, r2, #0x0 08098BE6: 3180 add r1, #0x80 08098BE8: 7808 ldrb r0, [r1] 08098BEA: 2819 cmp r0, #0x19 08098BEC: D807 bhi 0x08098BFE 08098BEE: 4805 ldr r0, =#0x086993A8 08098BF0: 7809 ldrb r1, [r1] 08098BF2: 0089 lsl r1, r1, #0x2 08098BF4: 1809 add r1, r1, r0 08098BF6: 6809 ldr r1, [r1] 08098BF8: 1C10 add r0, r2, #0x0 08098BFA: F027 bl 08098BFC: FCB5 bl 0x080C0568 08098BFE: BC01 pop {r0} 08098C00: 4700 bx r0 ;08098C02: 0000 lsl r0, r0, #0x0 ;08098C04: 93A8 str r3, [sp, #0x2A0] ;08098C06: 0869 lsr r1, r5, #0x1
$08098C08 - ?
08098C08: B510 push {r4, lr} 08098C0A: 1C04 add r4, r0, #0x0 08098C0C: F003 bl 08098C0E: FD34 bl 0x0809C678 08098C10: 1C20 add r0, r4, #0x0 08098C12: 2101 mov r1, #0x01 08098C14: F000 bl 08098C16: FFD0 bl 0x08099BB8 08098C18: BC10 pop {r4} 08098C1A: BC01 pop {r0} 08098C1C: 4700 bx r0 ;08098C1E: 0000 lsl r0, r0, #0x0
$08098C20 - ?
08098C20: B510 push {r4, lr} 08098C22: 1C04 add r4, r0, #0x0 08098C24: F003 bl 08098C26: FD28 bl 0x0809C678 08098C28: 480A ldr r0, =#0x0202DE30 08098C2A: 490B ldr r1, =#0x0000489E 08098C2C: 1840 add r0, r0, r1 ; r0 = #$020326CE 08098C2E: 8801 ldrh r1, [r0] 08098C30: 3901 sub r1, #0x01 08098C32: 8001 strh r1, [r0] ; Decrement Double Byte in $020326CE 08098C34: 0409 lsl r1, r1, #0x10 08098C36: 1409 asr r1, r1, #0x10 08098C38: 2001 mov r0, #0x01 08098C3A: 4240 neg r0, r0 ; r0 = #$FFFFFFFE(?) 08098C3C: 4281 cmp r1, r0 ; Is Double Byte 08098C3E: D106 bne 0x08098C4E ; Exit if not equal 08098C40: 1C20 add r0, r4, #0x0 08098C42: 2102 mov r1, #0x02 08098C44: F000 bl 08098C46: FFB8 bl 0x08099BB8 08098C48: 2040 mov r0, #0x40 08098C4A: F7C2 bl 08098C4C: FC8B bl 0x0805B564 08098C4E: BC10 pop {r4} 08098C50: BC01 pop {r0} 08098C52: 4700 bx r0 ;DATA ;================= ;08098C54: DE30 ??? ;08098C56: 0202 lsl r2, r0, #0x8 ;08098C58: 489E ldr r0, =#0x000048A3 ;08098C5A: 0000 lsl r0, r0, #0x0
$080997A8 - ?
080997A8: B530 push {r4, r5, lr} 080997AA: 1C05 add r5, r0, #0x0 080997AC: 1C0C add r4, r1, #0x0 080997AE: 1C20 add r0, r4, #0x0 080997B0: F000 bl 080997B2: F9C6 bl 0x08099B40 080997B4: 7B21 ldrb r1, [r4, #0x0C] 080997B6: 2002 mov r0, #0x02 080997B8: 4008 and r0, r1 080997BA: 2800 cmp r0, #0x00 080997BC: D00E beq 0x080997DC 080997BE: 1C2A add r2, r5, #0x0 080997C0: 3280 add r2, #0x80 080997C2: 7810 ldrb r0, [r2] 080997C4: 2819 cmp r0, #0x19 080997C6: D809 bhi 0x080997DC 080997C8: 4909 ldr r1, =#0x08699410 080997CA: 0080 lsl r0, r0, #0x2 080997CC: 1840 add r0, r0, r1 080997CE: 6802 ldr r2, [r0] 080997D0: 2A00 cmp r2, #0x00 080997D2: D003 beq 0x080997DC 080997D4: 1C28 add r0, r5, #0x0 080997D6: 1C21 add r1, r4, #0x0 080997D8: F026 bl 080997DA: FEC8 bl 0x080C056C ; bx r2 080997DC: 1C28 add r0, r5, #0x0 080997DE: F000 bl 080997E0: F9CF bl 0x08099B80 080997E2: 8860 ldrh r0, [r4, #0x02] 080997E4: 2800 cmp r0, #0x00 080997E6: D105 bne 0x080997F4 080997E8: 6F28 ldr r0, [r5, #0x70] 080997EA: 3001 add r0, #0x01 080997EC: E003 b 0x080997F6 080997EE: 0000 lsl r0, r0, #0x0 080997F0: 9410 str r4, [sp, #0x040] 080997F2: 0869 lsr r1, r5, #0x1 080997F4: 2000 mov r0, #0x00 080997F6: 6728 str r0, [r5, #0x70] 080997F8: BC30 pop {r4, r5} 080997FA: BC01 pop {r0} 080997FC: 4700 bx r0 ;080997FE: 0000 lsl r0, r0, #0x0
$08099B40 - (Register inspection of $020326D0 and $0202E2D0)
08099B40: B500 push {lr} 08099B42: 1C02 add r2, r0, #0x0 08099B44: 4905 ldr r1, =#0x0202DE30 08099B46: 4B06 ldr r3, =#0x000048A0 08099B48: 18C8 add r0, r1, r3 08099B4A: 7800 ldrb r0, [r0] ; Load #$020326D0 08099B4C: 2800 cmp r0, #0x00 08099B4E: D009 beq 0x08099B64 ; Branch if $020326D0 = #$00 08099B50: 2800 cmp r0, #0x00 08099B52: DB13 blt 0x08099B7C ; Exit if $020326D0 is negative 08099B54: 2804 cmp r0, #0x04 08099B56: DC11 bgt 0x08099B7C ; Exit if $020326D0 > #$04 08099B58: E00A b 0x08099B70 ; Branch if $020326D0 = {#$01, #$02, #$03} ;08099B5A: 0000 lsl r0, r0, #0x0 ;08099B5C: DE30 ??? ;08099B5E: 0202 lsl r2, r0, #0x8 ;08099B60: 48A0 ldr r0, =#0x0000489C ;08099B62: 0000 lsl r0, r0, #0x0 08099B64: 2394 mov r3, #0x94 ; $020326D0 = #$00 08099B66: 005B lsl r3, r3, #0x1 08099B68: 18C8 add r0, r1, r3 08099B6A: 8800 ldrh r0, [r0] ; Load $0202E2D0 08099B6C: 2801 cmp r0, #0x01 08099B6E: D105 bne 0x08099B7C ; Exit if $0202E2D0 <> #$01 08099B70: 8850 ldrh r0, [r2, #0x02] ; $020326D0 = {#$01, #$02, #$03} 08099B72: 280F cmp r0, #0x0F 08099B74: D102 bne 0x08099B7C 08099B76: 20FF mov r0, #0xFF 08099B78: F025 bl 08099B7A: FF22 bl 0x080BF9C0 08099B7C: BC01 pop {r0} 08099B7E: 4700 bx r0
$08099B80 - ?
08099B80: B500 push {lr} 08099B82: 1C03 add r3, r0, #0x0 08099B84: 3080 add r0, #0x80 08099B86: 7800 ldrb r0, [r0] 08099B88: 2804 cmp r0, #0x04 08099B8A: D112 bne 0x08099BB2 08099B8C: 1C1A add r2, r3, #0x0 08099B8E: 3274 add r2, #0x74 08099B90: 8810 ldrh r0, [r2] 08099B92: 2804 cmp r0, #0x04 08099B94: D10D bne 0x08099BB2 08099B96: 6ED9 ldr r1, [r3, #0x6C] 08099B98: 2096 mov r0, #0x96 08099B9A: 0080 lsl r0, r0, #0x2 08099B9C: 4281 cmp r1, r0 08099B9E: D908 bls 0x08099BB2 08099BA0: 2100 mov r1, #0x00 08099BA2: 8011 strh r1, [r2] 08099BA4: 3202 add r2, #0x02 08099BA6: 2002 mov r0, #0x02 08099BA8: 8010 strh r0, [r2] 08099BAA: 66D9 str r1, [r3, #0x6C] 08099BAC: 2045 mov r0, #0x45 08099BAE: F7C1 bl 08099BB0: FCD9 bl 0x0805B564 08099BB2: BC01 pop {r0} 08099BB4: 4700 bx r0 ;08099BB6: 0000 lsl r0, r0, #0x0
$08099BB8 - Jump to Subroutine Address Table Entry
Besides some other settings, this subroutine jumps to a subroutine at the Subroutine Address Table at $0869948C. That table is really big (about three hundred entries).
r0 contains an address. (In Intro, it's $0202DE44 and seems to always stay the same everafter)
r1 contains the number of the Table Entry where to jump.
08099BB8: B5F0 push {r4, r5, r6, r7, lr} 08099BBA: 1C06 add r6, r0, #0x0 ; Copy r0 in r6 08099BBC: 0409 lsl r1, r1, #0x10 08099BBE: 0C09 lsr r1, r1, #0x10 08099BC0: 008F lsl r7, r1, #0x2 ; Remove Upper Double Byte from Table Entry, multiply by 4 (each address is 4 bytes in size) 08099BC2: 4C13 ldr r4, =#0x080C2560 08099BC4: 193C add r4, r7, r4 ; r4 is now the selected Jump Table's Entries address 08099BC6: 3080 add r0, #0x80 08099BC8: 2200 mov r2, #0x00 08099BCA: 7001 strb r1, [r0] ; Store Table Entry number in Orig. r0 + #$80 08099BCC: 66F2 str r2, [r6, #0x6C] ; Clear Orig. r0 + #$6C (4 byteS) 08099BCE: 6732 str r2, [r6, #0x70] ; Clear Orig. r0 + #$6C (4 byteS) 08099BD0: 6822 ldr r2, [r4] ; Load value from first Table's Entry 08099BD2: 07D2 lsl r2, r2, #0x1F 08099BD4: 1C35 add r5, r6, #0x0 08099BD6: 3584 add r5, #0x84 08099BD8: 0FD2 lsr r2, r2, #0x1F ; From the first loaded entry, r2 only contains the lowest bit 08099BDA: 782B ldrb r3, [r5] ; r3 = [Orig. r0 + #$84] 08099BDC: 2002 mov r0, #0x02 08099BDE: 4240 neg r0, r0 08099BE0: 4018 and r0, r3 ; Remove bit 0 from loaded value 08099BE2: 4302 orr r2, r0 ; Add first loaded bit 08099BE4: 702A strb r2, [r5] ; Store back 08099BE6: 6823 ldr r3, [r4] ; Load first value again. 08099BE8: 2002 mov r0, #0x02 08099BEA: 4003 and r3, r0 08099BEC: 3805 sub r0, #0x05 08099BEE: 4002 and r2, r0 08099BF0: 431A orr r2, r3 08099BF2: 207F mov r0, #0x7F 08099BF4: 4002 and r2, r0 08099BF6: 702A strb r2, [r5] 08099BF8: 2919 cmp r1, #0x19 08099BFA: D805 bhi 0x08099C08 08099BFC: 4805 ldr r0, =#0x0869948C 08099BFE: 1838 add r0, r7, r0 ; Add Table Entry Number *4 to the Table Offset 08099C00: 6801 ldr r1, [r0] ; Load address in r1 08099C02: 1C30 add r0, r6, #0x0 ; r0 = Orig. r0 08099C04: F026 bl 08099C06: FCB0 bl 0x080C0568 ; bx r1 08099C08: BCF0 pop {r4, r5, r6, r7} 08099C0A: BC01 pop {r0} 08099C0C: 4700 bx r0 ;08099C0E: 0000 lsl r0, r0, #0x0 ;08099C10: 2560 mov r5, #0x60 ;08099C12: 080C lsr r4, r1, #0x0 ;08099C14: 948C str r4, [sp, #0x230] ;08099C16: 0869 lsr r1, r5, #0x1
$08099C18 - (Subroutine Address Table Entry #$005)
Stores #$003F in $020326CC/D and #$001E in $020326CE/F.
08099C18: 4905 ldr r1, =#0x0202DE30 08099C1A: 4806 ldr r0, =#0x0000489C 08099C1C: 180A add r2, r1, r0 08099C1E: 8810 ldrh r0, [r2] ; $020326CC 08099C20: 203F mov r0, #0x3F 08099C22: 8010 strh r0, [r2] 08099C24: 4804 ldr r0, =#0x0000489E 08099C26: 1809 add r1, r1, r0 08099C28: 201E mov r0, #0x1E 08099C2A: 8008 strh r0, [r1] ; $020326CE 08099C2C: 4770 bx lr ;08099C2E: 0000 lsl r0, r0, #0x0 ;08099C30: DE30 ??? ;08099C32: 0202 lsl r2, r0, #0x8 ;08099C34: 489C ldr r0, =#0x20028008 ;08099C36: 0000 lsl r0, r0, #0x0 ;08099C38: 489E ldr r0, =#0x0202DE30 ;08099C3A: 0000 lsl r0, r0, #0x0
$08099C3C - (Subroutine Address Table Entry #$006)
08099C3C: B530 push {r4, r5, lr} 08099C3E: 1C02 add r2, r0, #0x0 08099C40: 4C18 ldr r4, =#0x0202DE30 08099C42: 4819 ldr r0, =#0x0000489C 08099C44: 1821 add r1, r4, r0 ; r1 = #$020326CC 08099C46: 8808 ldrh r0, [r1] 08099C48: 2500 mov r5, #0x00 08099C4A: 203F mov r0, #0x3F 08099C4C: 8008 strh r0, [r1] ; Set $020326CC/D to #$003F 08099C4E: 4817 ldr r0, =#0x0000489E 08099C50: 1821 add r1, r4, r0 08099C52: 201E mov r0, #0x1E 08099C54: 8008 strh r0, [r1] ; Set $020326CE/F to #$001E 08099C56: 1C10 add r0, r2, #0x0 08099C58: 3078 add r0, #0x78 08099C5A: 8005 strh r5, [r0] 08099C5C: 3002 add r0, #0x02 08099C5E: 8005 strh r5, [r0] 08099C60: 3284 add r2, #0x84 08099C62: 7810 ldrb r0, [r2] 08099C64: 2104 mov r1, #0x04 08099C66: 4308 orr r0, r1 08099C68: 2108 mov r1, #0x08 08099C6A: 4308 orr r0, r1 08099C6C: 2110 mov r1, #0x10 08099C6E: 4308 orr r0, r1 08099C70: 2120 mov r1, #0x20 08099C72: 4308 orr r0, r1 08099C74: 7010 strb r0, [r2] 08099C76: 6821 ldr r1, [r4] ; Load the Address in $0202DE30 08099C78: 8808 ldrh r0, [r1] 08099C7A: 2094 mov r0, #0x94 08099C7C: 0080 lsl r0, r0, #0x2 08099C7E: 8008 strh r0, [r1] ; Store #$0250 in that address 08099C80: 6821 ldr r1, [r4] ; Load the Address in $0202DE30 08099C82: 8848 ldrh r0, [r1, #0x02] 08099C84: 480A ldr r0, =#0x00001002 08099C86: 8048 strh r0, [r1, #0x02] ; Store #$1002 two bytes further 08099C88: 6820 ldr r0, [r4] 08099C8A: 8881 ldrh r1, [r0, #0x04] 08099C8C: 8085 strh r5, [r0, #0x04] ; Store #$0000 in the next two bytes further 08099C8E: F002 bl 08099C90: FCF3 bl 0x0809C678 ; ? 08099C92: 2000 mov r0, #0x00 08099C94: F7FD bl 08099C96: FE0E bl 0x080978B4 ; ? 08099C98: 6820 ldr r0, [r4] ; Load the Address in $0202DE30 08099C9A: 8901 ldrh r1, [r0, #0x08] 08099C9C: 8105 strh r5, [r0, #0x08] ; Store #$0000 eight bytes further 08099C9E: BC30 pop {r4, r5} 08099CA0: BC01 pop {r0} 08099CA2: 4700 bx r0 ;08099CA4: DE30 ??? ;08099CA6: 0202 lsl r2, r0, #0x8 ;08099CA8: 489C ldr r0, =#0xF0022200 ;08099CAA: 0000 lsl r0, r0, #0x0 ;08099CAC: 489E ldr r0, =#0x21007801 ;08099CAE: 0000 lsl r0, r0, #0x0 ;08099CB0: 1002 asr r2, r0, #0x0 ;08099CB2: 0000 lsl r0, r0, #0x0
$0809B620 - ?
0809B620: B5F0 push {r4, r5, r6, r7, lr} 0809B622: 4684 mov r12, r0 0809B624: 1C0C add r4, r1, #0x0 0809B626: 1C15 add r5, r2, #0x0 0809B628: 9805 ldr r0, [sp, #0x014] 0809B62A: 0400 lsl r0, r0, #0x10 0809B62C: 0C01 lsr r1, r0, #0x10 0809B62E: 1C0A add r2, r1, #0x0 0809B630: 88A7 ldrh r7, [r4, #0x04] 0809B632: 682E ldr r6, [r5] 0809B634: 4805 ldr r0, =#0x0000FBFF 0809B636: 4281 cmp r1, r0 0809B638: D047 beq 0x0809B6CA 0809B63A: 4281 cmp r1, r0 0809B63C: DC0C bgt 0x0809B658 0809B63E: 4804 ldr r0, =#0x0000F8FF 0809B640: 4281 cmp r1, r0 0809B642: D036 beq 0x0809B6B2 0809B644: 4803 ldr r0, =#0x0000FAFF 0809B646: 4281 cmp r1, r0 0809B648: D024 beq 0x0809B694 0809B64A: E03E b 0x0809B6CA ;0809B64C: FBFF bl 0x080D9E4C ;0809B64E: 0000 lsl r0, r0, #0x0 ;0809B650: F8FF bl 0x0809B850 ;0809B652: 0000 lsl r0, r0, #0x0 ;0809B654: FAFF bl 0x0809BC54 ;0809B656: 0000 lsl r0, r0, #0x0 0809B658: 4806 ldr r0, =#0x0000FDFF 0809B65A: 4282 cmp r2, r0 0809B65C: D00E beq 0x0809B67C 0809B65E: 4282 cmp r2, r0 0809B660: DD33 ble 0x0809B6CA 0809B662: 4805 ldr r0, =#0x0000FEFF 0809B664: 4282 cmp r2, r0 0809B666: D130 bne 0x0809B6CA 0809B668: 801F strh r7, [r3] 0809B66A: 8858 ldrh r0, [r3, #0x02] 0809B66C: 3010 add r0, #0x10 0809B66E: 8058 strh r0, [r3, #0x02] 0809B670: E02B b 0x0809B6CA ;0809B672: 0000 lsl r0, r0, #0x0 ;0809B674: FDFF bl 0x0809C274 ;0809B676: 0000 lsl r0, r0, #0x0 ;0809B678: FEFF bl 0x0809C478 ;0809B67A: 0000 lsl r0, r0, #0x0 0809B67C: 8871 ldrh r1, [r6, #0x02] 0809B67E: 4803 ldr r0, =#0x00000257 0809B680: 4281 cmp r1, r0 0809B682: D812 bhi 0x0809B6AA 0809B684: 4802 ldr r0, =#0x00004758 0809B686: 4460 add r0, r12 0809B688: 8001 strh r1, [r0] 0809B68A: E00E b 0x0809B6AA ;0809B68C: 0257 lsl r7, r2, #0x9 ;0809B68E: 0000 lsl r0, r0, #0x0 ;0809B690: 4758 bx r11 ;0809B692: 0000 lsl r0, r0, #0x0 0809B694: 8870 ldrh r0, [r6, #0x02] 0809B696: 280F cmp r0, #0x0F 0809B698: D817 bhi 0x0809B6CA 0809B69A: 210F mov r1, #0x0F 0809B69C: 4001 and r1, r0 0809B69E: 7AE2 ldrb r2, [r4, #0x0B] 0809B6A0: 2010 mov r0, #0x10 0809B6A2: 4240 neg r0, r0 0809B6A4: 4010 and r0, r2 0809B6A6: 4308 orr r0, r1 0809B6A8: 72E0 strb r0, [r4, #0x0B] 0809B6AA: 6828 ldr r0, [r5] 0809B6AC: 3002 add r0, #0x02 0809B6AE: 6028 str r0, [r5] 0809B6B0: E00B b 0x0809B6CA 0809B6B2: 4907 ldr r1, =#0x020323BC 0809B6B4: 20C0 mov r0, #0xC0 0809B6B6: 0080 lsl r0, r0, #0x2 0809B6B8: 180A add r2, r1, r0 0809B6BA: 4B06 ldr r3, =#0x00000302 0809B6BC: 18C9 add r1, r1, r3 0809B6BE: 8808 ldrh r0, [r1] 0809B6C0: 8813 ldrh r3, [r2] 0809B6C2: 18C0 add r0, r0, r3 0809B6C4: 8010 strh r0, [r2] 0809B6C6: 2001 mov r0, #0x01 0809B6C8: 8008 strh r0, [r1] 0809B6CA: BCF0 pop {r4, r5, r6, r7} 0809B6CC: BC01 pop {r0} 0809B6CE: 4700 bx r0 ;0809B6D0: 23BC mov r3, #0xBC ;0809B6D2: 0203 lsl r3, r0, #0x8 ;0809B6D4: 0302 lsl r2, r0, #0xC ;0809B6D6: 0000 lsl r0, r0, #0x0
$0809B2A4 - Jump to 0809B2B0
Really does nothing else
0809B2A4: B500 push {lr} 0809B2A6: F000 bl 0809B2A8: F803 bl 0x0809B2B0 0809B2AA: BC01 pop {r0} 0809B2AC: 4700 bx r0 ;0809B2AE: 0000 lsl r0, r0, #0x0
$06014000 is the address in VRAM where the Signs shown in the intro are stored
0809B2B0: B5F0 push {r4, r5, r6, r7, lr} 0809B2B2: 4657 mov r7, r10 0809B2B4: 464E mov r6, r9 0809B2B6: 4645 mov r5, r8 0809B2B8: B4E0 push {r5, r6, r7} 0809B2BA: B093 add sp, #-0x04C 0809B2BC: 9004 str r0, [sp, #0x010] ; Store r0 on Stack 0809B2BE: 4A09 ldr r2, =#0x0000475A 0809B2C0: 1881 add r1, r0, r2 0809B2C2: 2000 mov r0, #0x00 0809B2C4: 7008 strb r0, [r1] ; Orig. r0 + #$475A = #$00 0809B2C6: 9B04 ldr r3, [sp, #0x010] 0809B2C8: 4D07 ldr r5, =#0x00004418 0809B2CA: 1958 add r0, r3, r5 0809B2CC: 6800 ldr r0, [r0] ; r0 = [Orig. r0 + #$4418] 0809B2CE: 6841 ldr r1, [r0, #0x04] ; r1 = [ [Orig. r0 + #$4418] + #$04] 0809B2D0: 9105 str r1, [sp, #0x014] ; Store on stack 0809B2D2: 4699 mov r9, r3 ; r9 = Orig. r0 0809B2D4: 4A05 ldr r2, =#0x06014000 0809B2D6: 9206 str r2, [sp, #0x018] ; Store on Stack 0809B2D8: 2380 mov r3, #0x80 0809B2DA: 009B lsl r3, r3, #0x2 ; r3 = #$0200 0809B2DC: 9309 str r3, [sp, #0x024] ; Store on stack 0809B2DE: 2400 mov r4, #0x00 0809B2E0: E18E b 0x0809B600 ;0809B2E2: 0000 lsl r0, r0, #0x0 ;0809B2E4: 475A bx r11 ;0809B2E6: 0000 lsl r0, r0, #0x0 ;0809B2E8: 4418 add r0, r3 ;0809B2EA: 0000 lsl r0, r0, #0x0 ;0809B2EC: 4000 and r0, r0 ;0809B2EE: 0601 lsl r1, r0, #0x18 0809B2F0: 9D05 ldr r5, [sp, #0x014] 0809B2F2: 88AA ldrh r2, [r5, #0x04] 0809B2F4: 491C ldr r1, =#0xFFFF0000 0809B2F6: 9803 ldr r0, [sp, #0x00C] 0809B2F8: 4008 and r0, r1 0809B2FA: 4310 orr r0, r2 0809B2FC: 9003 str r0, [sp, #0x00C] 0809B2FE: 88EA ldrh r2, [r5, #0x06] 0809B300: 0412 lsl r2, r2, #0x10 0809B302: 491A ldr r1, =#0x0000FFFF 0809B304: 4008 and r0, r1 0809B306: 4310 orr r0, r2 0809B308: 9003 str r0, [sp, #0x00C] 0809B30A: 6828 ldr r0, [r5] 0809B30C: 9002 str r0, [sp, #0x008] 0809B30E: 2208 mov r2, #0x08 0809B310: 5EA9 ldsh r1, [r5, r2] 0809B312: F023 bl 0809B314: FDBD bl 0x080BEE90 0809B316: 0400 lsl r0, r0, #0x10 0809B318: 0C00 lsr r0, r0, #0x10 0809B31A: 9008 str r0, [sp, #0x020] 0809B31C: 2300 mov r3, #0x00 0809B31E: 9307 str r3, [sp, #0x01C] 0809B320: 3401 add r4, #0x01 0809B322: 940E str r4, [sp, #0x038] 0809B324: 350C add r5, #0x0C 0809B326: 9511 str r5, [sp, #0x044] 0809B328: 4283 cmp r3, r0 0809B32A: D300 bcc 0x0809B32E 0809B32C: E15F b 0x0809B5EE 0809B32E: 9802 ldr r0, [sp, #0x008] 0809B330: 8801 ldrh r1, [r0] 0809B332: 0A0D lsr r5, r1, #0x8 0809B334: 20FF mov r0, #0xFF 0809B336: 4008 and r0, r1 0809B338: 0200 lsl r0, r0, #0x8 0809B33A: 4305 orr r5, r0 0809B33C: 46AA mov r10, r5 0809B33E: 480C ldr r0, =#0x00000FFF 0809B340: 4582 cmp r10, r0 0809B342: D917 bls 0x0809B374 0809B344: 464A mov r2, r9 0809B346: 3287 add r2, #0x87 0809B348: 7810 ldrb r0, [r2] 0809B34A: 2108 mov r1, #0x08 0809B34C: 4308 orr r0, r1 0809B34E: 7010 strb r0, [r2] 0809B350: 9500 str r5, [sp] 0809B352: 9804 ldr r0, [sp, #0x010] 0809B354: 9905 ldr r1, [sp, #0x014] 0809B356: AA02 add r2, sp, #0x008 0809B358: AB03 add r3, sp, #0x00C 0809B35A: F000 bl 0809B35C: F961 bl 0x0809B620 0809B35E: 9907 ldr r1, [sp, #0x01C] 0809B360: 3101 add r1, #0x01 0809B362: 910F str r1, [sp, #0x03C] 0809B364: E137 b 0x0809B5D6 ;0809B366: 0000 lsl r0, r0, #0x0 ;0809B368: 0000 lsl r0, r0, #0x0 ;0809B36A: FFFF bl 0x0809C36A ;0809B36C: FFFF bl 0x0809B36C ;0809B36E: 0000 lsl r0, r0, #0x0 ;0809B370: 0FFF lsr r7, r7, #0x1F ;0809B372: 0000 lsl r0, r0, #0x0 0809B374: 2001 mov r0, #0x01 0809B376: F001 bl 0809B378: F837 bl 0x0809C3E8 0809B37A: 1C07 add r7, r0, #0x0 0809B37C: AE03 add r6, sp, #0x00C 0809B37E: 8832 ldrh r2, [r6] 0809B380: 4B3F ldr r3, =#0x000001FF 0809B382: 1C18 add r0, r3, #0x0 0809B384: 4002 and r2, r0 0809B386: 8878 ldrh r0, [r7, #0x02] 0809B388: 4D3E ldr r5, =#0xFFFFFE00 0809B38A: 1C29 add r1, r5, #0x0 0809B38C: 4008 and r0, r1 0809B38E: 4310 orr r0, r2 0809B390: 8078 strh r0, [r7, #0x02] 0809B392: 8870 ldrh r0, [r6, #0x02] 0809B394: 7038 strb r0, [r7] 0809B396: 797A ldrb r2, [r7, #0x05] 0809B398: 20F0 mov r0, #0xF0 0809B39A: 4302 orr r2, r0 0809B39C: 717A strb r2, [r7, #0x05] 0809B39E: 787B ldrb r3, [r7, #0x01] 0809B3A0: 213F mov r1, #0x3F 0809B3A2: 1C08 add r0, r1, #0x0 0809B3A4: 4018 and r0, r3 0809B3A6: 7078 strb r0, [r7, #0x01] 0809B3A8: 78F8 ldrb r0, [r7, #0x03] 0809B3AA: 4001 and r1, r0 0809B3AC: 2040 mov r0, #0x40 0809B3AE: 4301 orr r1, r0 0809B3B0: 70F9 strb r1, [r7, #0x03] 0809B3B2: 9905 ldr r1, [sp, #0x014] 0809B3B4: 7AC8 ldrb r0, [r1, #0x0B] 0809B3B6: 0680 lsl r0, r0, #0x1A 0809B3B8: 0F80 lsr r0, r0, #0x1E 0809B3BA: 0080 lsl r0, r0, #0x2 0809B3BC: 230D mov r3, #0x0D 0809B3BE: 425B neg r3, r3 0809B3C0: 1C19 add r1, r3, #0x0 0809B3C2: 400A and r2, r1 0809B3C4: 4302 orr r2, r0 0809B3C6: 717A strb r2, [r7, #0x05] 0809B3C8: 464C mov r4, r9 0809B3CA: 3484 add r4, #0x84 0809B3CC: 8822 ldrh r2, [r4] 0809B3CE: 0515 lsl r5, r2, #0x14 0809B3D0: 46A8 mov r8, r5 0809B3D2: 464B mov r3, r9 0809B3D4: 3385 add r3, #0x85 0809B3D6: 7818 ldrb r0, [r3] 0809B3D8: 0900 lsr r0, r0, #0x4 0809B3DA: 900A str r0, [sp, #0x028] 0809B3DC: 4648 mov r0, r9 0809B3DE: 3086 add r0, #0x86 0809B3E0: 9012 str r0, [sp, #0x048] 0809B3E2: 8800 ldrh r0, [r0] 0809B3E4: 0580 lsl r0, r0, #0x16 0809B3E6: 0D80 lsr r0, r0, #0x16 0809B3E8: 900B str r0, [sp, #0x02C] 0809B3EA: 4651 mov r1, r10 0809B3EC: 4D26 ldr r5, =#0x00000FFF 0809B3EE: 4029 and r1, r5 0809B3F0: 4D26 ldr r5, =#0xFFFFF000 0809B3F2: 1C28 add r0, r5, #0x0 0809B3F4: 4002 and r2, r0 0809B3F6: 430A orr r2, r1 0809B3F8: 8022 strh r2, [r4] 0809B3FA: 9805 ldr r0, [sp, #0x014] 0809B3FC: 7AC1 ldrb r1, [r0, #0x0B] 0809B3FE: 0709 lsl r1, r1, #0x1C 0809B400: 0E09 lsr r1, r1, #0x18 0809B402: 781A ldrb r2, [r3] 0809B404: 200F mov r0, #0x0F 0809B406: 4010 and r0, r2 0809B408: 4308 orr r0, r1 0809B40A: 7018 strb r0, [r3] 0809B40C: 464A mov r2, r9 0809B40E: 3287 add r2, #0x87 0809B410: 7810 ldrb r0, [r2] 0809B412: 2509 mov r5, #0x09 0809B414: 426D neg r5, r5 0809B416: 1C29 add r1, r5, #0x0 0809B418: 4008 and r0, r1 0809B41A: 7010 strb r0, [r2] 0809B41C: 8820 ldrh r0, [r4] 0809B41E: 0500 lsl r0, r0, #0x14 0809B420: 1C14 add r4, r2, #0x0 0809B422: 469C mov r12, r3 0809B424: 9D12 ldr r5, [sp, #0x048] 0809B426: 4540 cmp r0, r8 0809B428: D136 bne 0x0809B498 0809B42A: 7818 ldrb r0, [r3] 0809B42C: 0900 lsr r0, r0, #0x4 0809B42E: 990A ldr r1, [sp, #0x028] 0809B430: 4288 cmp r0, r1 0809B432: D131 bne 0x0809B498 0809B434: 9A09 ldr r2, [sp, #0x024] 0809B436: 9B0B ldr r3, [sp, #0x02C] 0809B438: 429A cmp r2, r3 0809B43A: D12D bne 0x0809B498 0809B43C: 4914 ldr r1, =#0x000003FF 0809B43E: 1C08 add r0, r1, #0x0 0809B440: 1C11 add r1, r2, #0x0 0809B442: 4001 and r1, r0 0809B444: 882A ldrh r2, [r5] 0809B446: 4813 ldr r0, =#0xFFFFFC00 0809B448: 4010 and r0, r2 0809B44A: 4308 orr r0, r1 0809B44C: 8028 strh r0, [r5] 0809B44E: 4910 ldr r1, =#0x000003FF 0809B450: 9A09 ldr r2, [sp, #0x024] 0809B452: 4011 and r1, r2 0809B454: 88BA ldrh r2, [r7, #0x04] 0809B456: 480F ldr r0, =#0xFFFFFC00 0809B458: 4010 and r0, r2 0809B45A: 4308 orr r0, r1 0809B45C: 80B8 strh r0, [r7, #0x04] 0809B45E: 7820 ldrb r0, [r4] 0809B460: 2104 mov r1, #0x04 0809B462: 4308 orr r0, r1 0809B464: 7020 strb r0, [r4] 0809B466: 464B mov r3, r9 0809B468: 3388 add r3, #0x88 0809B46A: 930C str r3, [sp, #0x030] 0809B46C: 9D09 ldr r5, [sp, #0x024] 0809B46E: 3502 add r5, #0x02 0809B470: 9510 str r5, [sp, #0x040] 0809B472: 9806 ldr r0, [sp, #0x018] 0809B474: 3040 add r0, #0x40 0809B476: 4680 mov r8, r0 0809B478: 9907 ldr r1, [sp, #0x01C] 0809B47A: 3101 add r1, #0x01 0809B47C: 910F str r1, [sp, #0x03C] 0809B47E: E088 b 0x0809B592 ;0809B480: 01FF lsl r7, r7, #0x7 ;0809B482: 0000 lsl r0, r0, #0x0 ;0809B484: FE00 bl 0x0809C086 ;0809B486: FFFF bl 0x07E9C486 ;0809B488: 0FFF lsr r7, r7, #0x1F ;0809B48A: 0000 lsl r0, r0, #0x0 ;0809B48C: F000 bl ;0809B48E: FFFF bl 0x0809C48E ;0809B490: 03FF lsl r7, r7, #0xF ;0809B492: 0000 lsl r0, r0, #0x0 ;0809B494: FC00 bl 0x0809BC96 ;0809B496: FFFF bl 0x07C9C496 0809B498: A901 add r1, sp, #0x004 0809B49A: 2000 mov r0, #0x00 0809B49C: 8008 strh r0, [r1] 0809B49E: 4A2D ldr r2, =#0x040000D4 0809B4A0: 6011 str r1, [r2] 0809B4A2: 4649 mov r1, r9 0809B4A4: 3104 add r1, #0x04 0809B4A6: 6051 str r1, [r2, #0x04] 0809B4A8: 482B ldr r0, =#0x81000020 0809B4AA: 6090 str r0, [r2, #0x08] 0809B4AC: 6890 ldr r0, [r2, #0x08] 0809B4AE: 1C16 add r6, r2, #0x0 0809B4B0: 6890 ldr r0, [r2, #0x08] 0809B4B2: 2280 mov r2, #0x80 0809B4B4: 0612 lsl r2, r2, #0x18 0809B4B6: 910D str r1, [sp, #0x034] 0809B4B8: 464B mov r3, r9 0809B4BA: 3344 add r3, #0x44 0809B4BC: 3184 add r1, #0x84 0809B4BE: 910C str r1, [sp, #0x030] 0809B4C0: 9909 ldr r1, [sp, #0x024] 0809B4C2: 3102 add r1, #0x02 0809B4C4: 9110 str r1, [sp, #0x040] 0809B4C6: 9906 ldr r1, [sp, #0x018] 0809B4C8: 3140 add r1, #0x40 0809B4CA: 4688 mov r8, r1 0809B4CC: 9907 ldr r1, [sp, #0x01C] 0809B4CE: 3101 add r1, #0x01 0809B4D0: 910F str r1, [sp, #0x03C] 0809B4D2: 2800 cmp r0, #0x00 0809B4D4: DA04 bge 0x0809B4E0 0809B4D6: 1C11 add r1, r2, #0x0 0809B4D8: 68B0 ldr r0, [r6, #0x08] 0809B4DA: 4008 and r0, r1 0809B4DC: 2800 cmp r0, #0x00 0809B4DE: D1FB bne 0x0809B4D8 0809B4E0: A901 add r1, sp, #0x004 0809B4E2: 2000 mov r0, #0x00 0809B4E4: 8008 strh r0, [r1] 0809B4E6: 4A1B ldr r2, =#0x040000D4 0809B4E8: 6011 str r1, [r2] 0809B4EA: 6053 str r3, [r2, #0x04] 0809B4EC: 481A ldr r0, =#0x81000020 0809B4EE: 6090 str r0, [r2, #0x08] 0809B4F0: 6890 ldr r0, [r2, #0x08] 0809B4F2: 6890 ldr r0, [r2, #0x08] 0809B4F4: 2180 mov r1, #0x80 0809B4F6: 0609 lsl r1, r1, #0x18 0809B4F8: 2800 cmp r0, #0x00 0809B4FA: DA03 bge 0x0809B504 0809B4FC: 6890 ldr r0, [r2, #0x08] 0809B4FE: 4008 and r0, r1 0809B500: 2800 cmp r0, #0x00 0809B502: D1FB bne 0x0809B4FC 0809B504: 4915 ldr r1, =#0x000003FF 0809B506: 1C08 add r0, r1, #0x0 0809B508: 9909 ldr r1, [sp, #0x024] 0809B50A: 4001 and r1, r0 0809B50C: 882A ldrh r2, [r5] 0809B50E: 4814 ldr r0, =#0xFFFFFC00 0809B510: 4010 and r0, r2 0809B512: 4308 orr r0, r1 0809B514: 8028 strh r0, [r5] 0809B516: 4811 ldr r0, =#0x000003FF 0809B518: 9A09 ldr r2, [sp, #0x024] 0809B51A: 4002 and r2, r0 0809B51C: 88B9 ldrh r1, [r7, #0x04] 0809B51E: 4810 ldr r0, =#0xFFFFFC00 0809B520: 4008 and r0, r1 0809B522: 4310 orr r0, r2 0809B524: 80B8 strh r0, [r7, #0x04] 0809B526: 9D06 ldr r5, [sp, #0x018] 0809B528: 4648 mov r0, r9 0809B52A: 6005 str r5, [r0] 0809B52C: 7820 ldrb r0, [r4] 0809B52E: 2205 mov r2, #0x05 0809B530: 4252 neg r2, r2 0809B532: 1C11 add r1, r2, #0x0 0809B534: 4008 and r0, r1 0809B536: 7020 strb r0, [r4] 0809B538: 9D04 ldr r5, [sp, #0x010] 0809B53A: 490A ldr r1, =#0x0000475B 0809B53C: 1868 add r0, r5, r1 0809B53E: 7800 ldrb r0, [r0] 0809B540: 2801 cmp r0, #0x01 0809B542: D011 beq 0x0809B568 0809B544: 2802 cmp r0, #0x02 0809B546: D01F beq 0x0809B588 0809B548: 1C28 add r0, r5, #0x0 0809B54A: 4649 mov r1, r9 0809B54C: 4652 mov r2, r10 0809B54E: F000 bl 0809B550: F8C3 bl 0x0809B6D8 0809B552: E01E b 0x0809B592 ;0809B554: 00D4 lsl r4, r2, #0x3 ;0809B556: 0400 lsl r0, r0, #0x10 ;0809B558: 0020 lsl r0, r4, #0x0 ;0809B55A: 8100 strh r0, [r0, #0x08] ;0809B55C: 03FF lsl r7, r7, #0xF ;0809B55E: 0000 lsl r0, r0, #0x0 ;0809B560: FC00 bl 0x0809BD62 ;0809B562: FFFF bl 0x07C9C562 ;0809B564: 475B bx r11 ;0809B566: 0000 lsl r0, r0, #0x0 0809B568: 9A04 ldr r2, [sp, #0x010] 0809B56A: 4D06 ldr r5, =#0x00004754 0809B56C: 1950 add r0, r2, r5 0809B56E: 6800 ldr r0, [r0] 0809B570: 4662 mov r2, r12 0809B572: 7811 ldrb r1, [r2] 0809B574: 0909 lsr r1, r1, #0x4 0809B576: 9100 str r1, [sp] 0809B578: 990D ldr r1, [sp, #0x034] 0809B57A: 1C1A add r2, r3, #0x0 0809B57C: 4653 mov r3, r10 0809B57E: F023 bl 0809B580: FB2B bl 0x080BEBD8 0809B582: E006 b 0x0809B592 ;0809B584: 4754 bx r10 ;0809B586: 0000 lsl r0, r0, #0x0 0809B588: 9804 ldr r0, [sp, #0x010] 0809B58A: 4649 mov r1, r9 0809B58C: 4652 mov r2, r10 0809B58E: F000 bl 0809B590: F8C9 bl 0x0809B724 0809B592: 9B04 ldr r3, [sp, #0x010] 0809B594: 4D20 ldr r5, =#0x0000475A 0809B596: 1959 add r1, r3, r5 0809B598: 7808 ldrb r0, [r1] 0809B59A: 3001 add r0, #0x01 0809B59C: 7008 strb r0, [r1] 0809B59E: 980C ldr r0, [sp, #0x030] 0809B5A0: 4681 mov r9, r0 0809B5A2: 9A10 ldr r2, [sp, #0x040] 0809B5A4: 0410 lsl r0, r2, #0x10 0809B5A6: 0C00 lsr r0, r0, #0x10 0809B5A8: 9009 str r0, [sp, #0x024] 0809B5AA: 4643 mov r3, r8 0809B5AC: 9306 str r3, [sp, #0x018] 0809B5AE: 7808 ldrb r0, [r1] 0809B5B0: 2110 mov r1, #0x10 0809B5B2: F024 bl 0809B5B4: F9FB bl 0x080BF9AC ; swi Div / add r0, r1, #0x0 0809B5B6: 2800 cmp r0, #0x00 0809B5B8: D108 bne 0x0809B5CC 0809B5BA: 9809 ldr r0, [sp, #0x024] 0809B5BC: 3020 add r0, #0x20 0809B5BE: 0400 lsl r0, r0, #0x10 0809B5C0: 0C00 lsr r0, r0, #0x10 0809B5C2: 9009 str r0, [sp, #0x024] 0809B5C4: 2580 mov r5, #0x80 0809B5C6: 00ED lsl r5, r5, #0x3 0809B5C8: 4445 add r5, r8 0809B5CA: 9506 str r5, [sp, #0x018] 0809B5CC: 4669 mov r1, sp 0809B5CE: 8988 ldrh r0, [r1, #0x0C] 0809B5D0: 300C add r0, #0x0C 0809B5D2: A903 add r1, sp, #0x00C 0809B5D4: 8008 strh r0, [r1] 0809B5D6: 9A0F ldr r2, [sp, #0x03C] 0809B5D8: 0410 lsl r0, r2, #0x10 0809B5DA: 0C00 lsr r0, r0, #0x10 0809B5DC: 9007 str r0, [sp, #0x01C] 0809B5DE: 9802 ldr r0, [sp, #0x008] 0809B5E0: 3002 add r0, #0x02 0809B5E2: 9002 str r0, [sp, #0x008] 0809B5E4: 9B07 ldr r3, [sp, #0x01C] 0809B5E6: 9D08 ldr r5, [sp, #0x020] 0809B5E8: 42AB cmp r3, r5 0809B5EA: D200 bcs 0x0809B5EE 0809B5EC: E69F b 0x0809B32E 0809B5EE: 990E ldr r1, [sp, #0x038] 0809B5F0: 0408 lsl r0, r1, #0x10 0809B5F2: 0C04 lsr r4, r0, #0x10 0809B5F4: 9A11 ldr r2, [sp, #0x044] 0809B5F6: 9205 str r2, [sp, #0x014] 0809B5F8: 9B04 ldr r3, [sp, #0x010] 0809B5FA: 4D08 ldr r5, =#0x00004418 0809B5FC: 1958 add r0, r3, r5 0809B5FE: 6800 ldr r0, [r0] 0809B600: 7A40 ldrb r0, [r0, #0x09] ; r0 = [Orig. r0 + #$4418] + #$09 0809B602: 4284 cmp r4, r0 ; Is r0 = #$00? 0809B604: D200 bcs 0x0809B608 0809B606: E673 b 0x0809B2F0 0809B608: B013 add sp, #0x04C 0809B60A: BC38 pop {r3, r4, r5} 0809B60C: 4698 mov r8, r3 0809B60E: 46A1 mov r9, r4 0809B610: 46AA mov r10, r5 0809B612: BCF0 pop {r4, r5, r6, r7} 0809B614: BC01 pop {r0} 0809B616: 4700 bx r0 ;0809B618: 475A bx r11 ;0809B61A: 0000 lsl r0, r0, #0x0 ;0809B61C: 4418 add r0, r3 ;0809B61E: 0000 lsl r0, r0, #0x0
$0809B620 - ?
The first time this gets executed is in the "Story"-Intro sequence when the first line of text is written. This gets executed at least about thirty times before the next letter gets written, and it seems like it is called even in between text lines afterwards.
r1, r2, r3 contain addresses r2 is a address that points to an address r3 is a writable address
0809B620: B5F0 push {r4, r5, r6, r7, lr} 0809B622: 4684 mov r12, r0 ; r12 = Orig. r12 0809B624: 1C0C add r4, r1, #0x0 ; r4 = Orig. r1 0809B626: 1C15 add r5, r2, #0x0 ; r5 = Orig. r2 0809B628: 9805 ldr r0, [sp, #0x014] ; r0 = Orig. r5 0809B62A: 0400 lsl r0, r0, #0x10 0809B62C: 0C01 lsr r1, r0, #0x10 0809B62E: 1C0A add r2, r1, #0x0 ; r2 = r1 = Orig. r5 AND #$0000FFFF 0809B630: 88A7 ldrh r7, [r4, #0x04] 0809B632: 682E ldr r6, [r5] 0809B634: 4805 ldr r0, =#0x0000FBFF 0809B636: 4281 cmp r1, r0 0809B638: D047 beq 0x0809B6CA ; Branch if Orig. r5 was #$xxxxFBFF 0809B63A: 4281 cmp r1, r0 0809B63C: DC0C bgt 0x0809B658 ; Branch if Orig. r5 was greater than #$xxxxF8FF 0809B63E: 4804 ldr r0, =#0x0000F8FF 0809B640: 4281 cmp r1, r0 0809B642: D036 beq 0x0809B6B2 ; Branch if Orig. r5 was #$xxxxF8FF 0809B644: 4803 ldr r0, =#0x0000FAFF 0809B646: 4281 cmp r1, r0 0809B648: D024 beq 0x0809B694 ; Branch if Orig. r5 was #$xxxxFAFF 0809B64A: E03E b 0x0809B6CA ; Exit if Orig. r5 was anything else ;0809B64C: FBFF bl 0x080D9E4C ;0809B64E: 0000 lsl r0, r0, #0x0 ;0809B650: F8FF bl 0x0809B850 ;0809B652: 0000 lsl r0, r0, #0x0 ;0809B654: FAFF bl 0x0809BC54 ;0809B656: 0000 lsl r0, r0, #0x0 ; IF ORIG. r5 WAS GREATER THAN #$xxxxF8FF 0809B658: 4806 ldr r0, =#0x0000FDFF 0809B65A: 4282 cmp r2, r0 0809B65C: D00E beq 0x0809B67C ; Branch if Orig. r5 was #$xxxxFDFF 0809B65E: 4282 cmp r2, r0 0809B660: DD33 ble 0x0809B6CA ; Branch if Orig. r5 was less than #$xxxxFDFF (and greater than #$xxxxF8FF) 0809B662: 4805 ldr r0, =#0x0000FEFF 0809B664: 4282 cmp r2, r0 0809B666: D130 bne 0x0809B6CA ; Exit if Orig. r5 was not #%xxxxFEFF 0809B668: 801F strh r7, [r3] ; Store Doublebyte loaded from [r4, #0x04] in [r3] 0809B66A: 8858 ldrh r0, [r3, #0x02] 0809B66C: 3010 add r0, #0x10 0809B66E: 8058 strh r0, [r3, #0x02] ; Add #$10 to Doublebyte in [r3, #0x02] 0809B670: E02B b 0x0809B6CA ; Exit ;0809B672: 0000 lsl r0, r0, #0x0 ;0809B674: FDFF bl 0x0809C274 ;0809B676: 0000 lsl r0, r0, #0x0 ;0809B678: FEFF bl 0x0809C478 ;0809B67A: 0000 lsl r0, r0, #0x0 ; IF ORIG. r5 WAS #$xxxxFDFF 0809B67C: 8871 ldrh r1, [r6, #0x02] ; Load Doublebyte from [Orig. r2, #0x02] 0809B67E: 4803 ldr r0, =#0x00000257 0809B680: 4281 cmp r1, r0 0809B682: D812 bhi 0x0809B6AA ; Branch if loaded value is higher than #$0257 0809B684: 4802 ldr r0, =#0x00004758 0809B686: 4460 add r0, r12 ; r0 = Orig. r0 + #$00004758 0809B688: 8001 strh r1, [r0] ; Orig. r0 + #$00004758 = r1 0809B68A: E00E b 0x0809B6AA ;0809B68C: 0257 lsl r7, r2, #0x9 ;0809B68E: 0000 lsl r0, r0, #0x0 ;0809B690: 4758 bx r11 ;0809B692: 0000 lsl r0, r0, #0x0 ; IF ORIG. r5 WAS #$xxxxFAFF 0809B694: 8870 ldrh r0, [r6, #0x02] ; Load Doublebyte from [Orig. r2, #0x02] 0809B696: 280F cmp r0, #0x0F 0809B698: D817 bhi 0x0809B6CA ; Exit if higher than #$000F 0809B69A: 210F mov r1, #0x0F 0809B69C: 4001 and r1, r0 ; AND with #$0000000F (doesn't make sense to me, unnecessary) 0809B69E: 7AE2 ldrb r2, [r4, #0x0B] 0809B6A0: 2010 mov r0, #0x10 0809B6A2: 4240 neg r0, r0 0809B6A4: 4010 and r0, r2 0809B6A6: 4308 orr r0, r1 0809B6A8: 72E0 strb r0, [r4, #0x0B] ; Set lower nybble of [Orig. r1, #$0x0B] 0809B6AA: 6828 ldr r0, [r5] 0809B6AC: 3002 add r0, #0x02 0809B6AE: 6028 str r0, [r5] ; Add #$02 to [Orig. r2] 0809B6B0: E00B b 0x0809B6CA ; Exit ; IF ORIG. r5 WAS #$xxxxF8FF 0809B6B2: 4907 ldr r1, =#0x020323BC 0809B6B4: 20C0 mov r0, #0xC0 0809B6B6: 0080 lsl r0, r0, #0x2 0809B6B8: 180A add r2, r1, r0 0809B6BA: 4B06 ldr r3, =#0x00000302 0809B6BC: 18C9 add r1, r1, r3 0809B6BE: 8808 ldrh r0, [r1] ; r0 = [$020326BE] 0809B6C0: 8813 ldrh r3, [r2] ; r3 = [$020326BC] 0809B6C2: 18C0 add r0, r0, r3 0809B6C4: 8010 strh r0, [r2] ; $020326BC = $020326BC + $020326BE 0809B6C6: 2001 mov r0, #0x01 0809B6C8: 8008 strh r0, [r1] ; $020326BE = #$0001 0809B6CA: BCF0 pop {r4, r5, r6, r7} 0809B6CC: BC01 pop {r0} 0809B6CE: 4700 bx r0 ;0809B6D0: 23BC mov r3, #0xBC ;0809B6D2: 0203 lsl r3, r0, #0x8 ;0809B6D4: 0302 lsl r2, r0, #0xC ;0809B6D6: 0000 lsl r0, r0, #0x0
$0809B6D8 - (Double Mini-Flexy-DMA)
This performs two DMAs of #$40 Bytes in size.
r0 contains an address r1 contains the DMA destination address (minus #$04...?!) r2 contains a doublebyte-sized value relevant for forming the Source address
Bits #$0 to #$3 get, kind of, multiplied by #$40 and added to the Source Address Bits #$4 to #$F get, kind of, multiplied by #$800 and added to the Source Address
0809B6D8: B510 push {r4, lr} 0809B6DA: 0412 lsl r2, r2, #0x10 0809B6DC: 4B0E ldr r3, =#0x00004754 0809B6DE: 18C0 add r0, r0, r3 0809B6E0: 6803 ldr r3, [r0] ; r3 = Orig. r0 + #$00004754 0809B6E2: 0D14 lsr r4, r2, #0x14 ; r4 = Orig. r2 AND #$0000FFFF div by #$10 0809B6E4: 20F0 mov r0, #0xF0 0809B6E6: 0300 lsl r0, r0, #0xC ; r0 = #$000F0000 0809B6E8: 4010 and r0, r2 ; r0 = Orig. r2 bits 0 to 3 at #$000x0000 0809B6EA: 0A80 lsr r0, r0, #0xA ; r0 = Orig. r2 bits o to at #$000003C0, if you know what I mean 0809B6EC: 181B add r3, r3, r0 ; Add to [Orig. r0 + #$00004754] 0809B6EE: 02E4 lsl r4, r4, #0xB ; r4 = Orig r2 bits 4 to 13 as #$007FF800 0809B6F0: 191B add r3, r3, r4 0809B6F2: 480A ldr r0, =#0x040000D4 0809B6F4: 6003 str r3, [r0] ; r3 = DMA Source Address 0809B6F6: 1D0A add r2, r1, #0x4 0809B6F8: 6042 str r2, [r0, #0x04] ; r2 = DMA Destination Address = Orig. r1 +#$04 0809B6FA: 4A09 ldr r2, =#0x80000020 0809B6FC: 6082 str r2, [r0, #0x08] ; Transfer #$20 Doublebytes 0809B6FE: 6884 ldr r4, [r0, #0x08] 0809B700: 2480 mov r4, #0x80 0809B702: 00E4 lsl r4, r4, #0x3 0809B704: 191B add r3, r3, r4 0809B706: 6003 str r3, [r0] ; DMA Source Address = First one + #$400 0809B708: 3144 add r1, #0x44 0809B70A: 6041 str r1, [r0, #0x04] ; DMA Destination Address = Orig. r1 + #$44 0809B70C: 6082 str r2, [r0, #0x08] ; Transfer #$20 Doublebytes 0809B70E: 6880 ldr r0, [r0, #0x08] 0809B710: BC10 pop {r4} 0809B712: BC01 pop {r0} 0809B714: 4700 bx r0 ;0809B716: 0000 lsl r0, r0, #0x0 ;0809B718: 4754 bx r10 ;0809B71A: 0000 lsl r0, r0, #0x0 ;0809B71C: 00D4 lsl r4, r2, #0x3 ;0809B71E: 0400 lsl r0, r0, #0x10 ;0809B720: 0020 lsl r0, r4, #0x0 ;0809B722: 8000 strh r0, [r0]
$0809B92C - (Set Bit 0 of $0202DEFC, clear $0202DEF9)
This is called from $080976DC. There, r0 is set to #$0202DECC.
0809B92C: 1C03 add r3, r0, #0x0 0809B92E: 3330 add r3, #0x30 0809B930: 7819 ldrb r1, [r3] 0809B932: 2201 mov r2, #0x01 0809B934: 4311 orr r1, r2 0809B936: 7019 strb r1, [r3] ; Set Bit 0 of Orig. r0 + #$30 ($0202DEFC) 0809B938: 302D add r0, #0x2D 0809B93A: 2100 mov r1, #0x00 0809B93C: 7001 strb r1, [r0] ; Clear r0 + #$2D ($0202DEF9) 0809B93E: 4770 bx lr
$0809B9EC - (Set Bit 0 of $0202DEFC, clear $0202DEF9)
THIS IS THE SAME AS $0809B92C(!?!)
This is called from $0809BF34. Then r0 = #$0202DECC. So it sets Bit 0 of $0202DEFC and clears $0202DEF9.
0809B9EC: 1C03 add r3, r0, #0x0 ; r3 = Orig. r0 0809B9EE: 3330 add r3, #0x30 ; r3 = Orig. r0 + #$30 0809B9F0: 7819 ldrb r1, [r3] ; r1 = [Orig. r0 + #$30] 0809B9F2: 2201 mov r2, #0x01 0809B9F4: 4311 orr r1, r2 ; Set Bit 0 0809B9F6: 7019 strb r1, [r3] ; Store back 0809B9F8: 302D add r0, #0x2D 0809B9FA: 2100 mov r1, #0x00 0809B9FC: 7001 strb r1, [r0] ; Clear Orig. r0 + #$2D (Byte sized) 0809B9FE: 4770 bx lr
$0809BA00 - ?
This seems to be called only from $0809BF34. In that case r0 = #$0202DECC, r1 = #$02, r2 = #$00. Comments are made under the assumption of these values.
0809BA00: B530 push {r4, r5, lr} 0809BA02: 4684 mov r12, r0 ; r12 = #$0202DECC 0809BA04: 0409 lsl r1, r1, #0x10 0809BA06: 0C09 lsr r1, r1, #0x10 ; r1 = #$02 0809BA08: 1C0C add r4, r1, #0x0 ; r4 = #$02 0809BA0A: 0412 lsl r2, r2, #0x10 0809BA0C: 0C12 lsr r2, r2, #0x10 ; r2 = #$00 0809BA0E: 1C15 add r5, r2, #0x0 ; r5 = #$00 0809BA10: 4663 mov r3, r12 ; r3 = #$0202DECC 0809BA12: 332D add r3, #0x2D ; r3 = #$0202DEF9 0809BA14: 7819 ldrb r1, [r3] 0809BA16: 42A1 cmp r1, r4 ; Is $0202DEF9 = Orig. r1? 0809BA18: D103 bne 0x0809BA22 ; Branch if not 0809BA1A: 302E add r0, #0x2E 0809BA1C: 7800 ldrb r0, [r0] 0809BA1E: 4290 cmp r0, r2 ; Is $0202DEFA = Orig. r1? 0809BA20: D00C beq 0x0809BA3C ; Exit if equal 0809BA22: 2900 cmp r1, #0x00 ; Is $0202DEF9 = #$00? 0809BA24: D10A bne 0x0809BA3C ; Exit if not 0809BA26: 701C strb r4, [r3] ; $0202DEF9 = Orig. r1 (#$02) 0809BA28: 4660 mov r0, r12 0809BA2A: 302E add r0, #0x2E 0809BA2C: 7005 strb r5, [r0] ; $0202DEFA = Orig. r2 (#$00) 0809BA2E: 7818 ldrb r0, [r3] 0809BA30: 2802 cmp r0, #0x02 ; Is $0202DEF9 = #$02? 0809BA32: D103 bne 0x0809BA3C ; Exit if not equal 0809BA34: 4661 mov r1, r12 ; (This is only executed if Orig. r1 = #$02) 0809BA36: 312F add r1, #0x2F 0809BA38: 2005 mov r0, #0x05 0809BA3A: 7008 strb r0, [r1] ; $0202DEFB = #$05 0809BA3C: BC30 pop {r4, r5} 0809BA3E: BC01 pop {r0} 0809BA40: 4700 bx r0 ;0809BA42: 0000 lsl r0, r0, #0x0
$0809BA44 - ?
0809BA44: B530 push {r4, r5, lr} 0809BA46: 1C05 add r5, r0, #0x0 0809BA48: 1C0C add r4, r1, #0x0 0809BA4A: 3030 add r0, #0x30 0809BA4C: 7801 ldrb r1, [r0] 0809BA4E: 2201 mov r2, #0x01 0809BA50: 1C10 add r0, r2, #0x0 0809BA52: 4008 and r0, r1 0809BA54: 2800 cmp r0, #0x00 0809BA56: D131 bne 0x0809BABC ; Exit if not equal 0809BA58: 2100 mov r1, #0x00 0809BA5A: 7860 ldrb r0, [r4, #0x01] 0809BA5C: 06C0 lsl r0, r0, #0x1B 0809BA5E: 2800 cmp r0, #0x00 0809BA60: DA00 bge 0x0809BA64 0809BA62: 2101 mov r1, #0x01 0809BA64: 7820 ldrb r0, [r4] 0809BA66: 0700 lsl r0, r0, #0x1C 0809BA68: 0F00 lsr r0, r0, #0x1C 0809BA6A: 4108 asr r0, r1 0809BA6C: 4010 and r0, r2 0809BA6E: 2800 cmp r0, #0x00 0809BA70: D01C beq 0x0809BAAC 0809BA72: 0109 lsl r1, r1, #0x4 0809BA74: 3118 add r1, #0x18 0809BA76: 1861 add r1, r4, r1 0809BA78: 3408 add r4, #0x08 0809BA7A: 1C28 add r0, r5, #0x0 0809BA7C: 3010 add r0, #0x10 ; r0 = Store Address 0809BA7E: 2210 mov r2, #0x10 ; r2 = Number of Bytes to Transfer 0809BA80: F026 bl 0809BA82: FAB0 bl 0x080C1FE4 ; Data Transfer 0809BA84: 1C28 add r0, r5, #0x0 0809BA86: 1C21 add r1, r4, #0x0 0809BA88: 2210 mov r2, #0x10 ; Transfer #$10 bytes 0809BA8A: F026 bl 0809BA8C: FAAB bl 0x080C1FE4 ; Data Transfer 0809BA8E: 1C28 add r0, r5, #0x0 0809BA90: F000 bl 0809BA92: F818 bl 0x0809BAC4 0809BA94: 1C28 add r0, r5, #0x0 0809BA96: F000 bl 0809BA98: F891 bl 0x0809BBBC 0809BA9A: 1C28 add r0, r5, #0x0 0809BA9C: F000 bl 0809BA9E: F8E8 bl 0x0809BC70 0809BAA0: 1C20 add r0, r4, #0x0 0809BAA2: 1C29 add r1, r5, #0x0 0809BAA4: 2210 mov r2, #0x10 0809BAA6: F026 bl 0809BAA8: FA9D bl 0x080C1FE4 0809BAAA: E007 b 0x0809BABC 0809BAAC: 1C28 add r0, r5, #0x0 0809BAAE: 302D add r0, #0x2D 0809BAB0: 7800 ldrb r0, [r0] 0809BAB2: 2802 cmp r0, #0x02 0809BAB4: D102 bne 0x0809BABC 0809BAB6: 1C28 add r0, r5, #0x0 0809BAB8: F000 bl 0809BABA: FA2A bl 0x0809BF10 0809BABC: BC30 pop {r4, r5} 0809BABE: BC01 pop {r0} 0809BAC0: 4700 bx r0 ;0809BAC2: 0000 lsl r0, r0, #0x0
$0809BAC4 - ?
0809BAC4: B500 push {lr} 0809BAC6: 1C02 add r2, r0, #0x0 0809BAC8: 7D90 ldrb r0, [r2, #0x16] ; Load Adress Table Index value 0809BACA: 2803 cmp r0, #0x03 ; Exit if it is >#$03 0809BACC: D807 bhi 0x0809BADE 0809BACE: 4805 ldr r0, =#0x08699508 ; Address Table Offset 0809BAD0: 7D91 ldrb r1, [r2, #0x16] ; Load Index for jump 0809BAD2: 0089 lsl r1, r1, #0x2 ; Index * 4 (each Table Entry is 4 bytes in size) 0809BAD4: 1809 add r1, r1, r0 ; Add to Table Offset 0809BAD6: 6809 ldr r1, [r1] ; Load address for jumping 0809BAD8: 1C10 add r0, r2, #0x0 0809BADA: F024 bl 0809BADC: FD45 bl 0x080C0568 ; bx r1 0809BADE: BC01 pop {r0} 0809BAE0: 4700 bx r0 ;0809BAE2: 0000 lsl r0, r0, #0x0 ;0809BAE4: 9508 str r5, [sp, #0x020] ;0809BAE6: 0869 lsr r1, r5, #0x1
$0809BF34 - ?
0809BF34: B510 push {r4, lr} 0809BF36: B081 add sp, #-0x004 0809BF38: 4669 mov r1, sp 0809BF3A: 7008 strb r0, [r1] ; Buffer Orig. r0 (byte sized) on Stack 0809BF3C: 4668 mov r0, sp 0809BF3E: 7800 ldrb r0, [r0] 0809BF40: 2800 cmp r0, #0x00 0809BF42: D00B beq 0x0809BF5C ; Branch if Orig. r0 was clear 0809BF44: 4C04 ldr r4, =#0x0202DECC 0809BF46: 1C20 add r0, r4, #0x0 0809BF48: F7FF bl 0809BF4A: FD50 bl 0x0809B9EC ; Set Bit 0 of $0202DEFC, clear $0202DEF9 0809BF4C: 3434 add r4, #0x34 0809BF4E: 1C20 add r0, r4, #0x0 ; r0 = #$0202DF00 0809BF50: F021 bl 0809BF52: FF90 bl 0x080BDE74 ; ? 0809BF54: E007 b 0x0809BF66 ;0809BF56: 0000 lsl r0, r0, #0x0 ;0809BF58: DECC ??? ;0809BF5A: 0202 lsl r2, r0, #0x8 0809BF5C: 4804 ldr r0, =#0x0202DECC 0809BF5E: 2102 mov r1, #0x02 0809BF60: 2200 mov r2, #0x00 0809BF62: F7FF bl 0809BF64: FD4D bl 0x0809BA00 ; ? 0809BF66: B001 add sp, #0x004 0809BF68: BC10 pop {r4} 0809BF6A: BC01 pop {r0} 0809BF6C: 4700 bx r0 ;0809BF6E: 0000 lsl r0, r0, #0x0 ;0809BF70: DECC ??? ;0809BF72: 0202 lsl r2, r0, #0x8
Maybe this is a Tilemap Buffer clearer?
r1 (and later r7) contains a BG number.
0809C254: B5F0 push {r4, r5, r6, r7, lr} 0809C256: B083 add sp, #-0x00C 0809C258: 1C03 add r3, r0, #0x0 ; r3 = r0 0809C25A: 0409 lsl r1, r1, #0x10 0809C25C: 0C0F lsr r7, r1, #0x10 ; r7 = r1 (BG number; with Upper Double Byte removed) 0809C25E: 4668 mov r0, sp 0809C260: 7002 strb r2, [r0] ; Store r2 on Stack 0809C262: 2B00 cmp r3, #0x00 0809C264: D014 beq 0x0809C290 0809C266: 8819 ldrh r1, [r3] 0809C268: 08C9 lsr r1, r1, #0x3 0809C26A: 4A08 ldr r2, =#0xFFFF0000 0809C26C: 9801 ldr r0, [sp, #0x004] 0809C26E: 4010 and r0, r2 0809C270: 4308 orr r0, r1 0809C272: 9001 str r0, [sp, #0x004] 0809C274: 8858 ldrh r0, [r3, #0x02] 0809C276: 08C0 lsr r0, r0, #0x3 0809C278: A901 add r1, sp, #0x004 0809C27A: 8048 strh r0, [r1, #0x02] 0809C27C: 8898 ldrh r0, [r3, #0x04] 0809C27E: 08C0 lsr r0, r0, #0x3 0809C280: 8088 strh r0, [r1, #0x04] 0809C282: 88D8 ldrh r0, [r3, #0x06] 0809C284: 08C0 lsr r0, r0, #0x3 0809C286: 80C8 strh r0, [r1, #0x06] 0809C288: 1C0D add r5, r1, #0x0 0809C28A: E009 b 0x0809C2A0 ;DATA ;============ ;0809C28C: 0000 lsl r0, r0, #0x0 ;0809C28E: FFFF bl 0x0809D28E 0809C290: A801 add r0, sp, #0x004 0809C292: 8003 strh r3, [r0] 0809C294: 8043 strh r3, [r0, #0x02] 0809C296: 211E mov r1, #0x1E 0809C298: 8081 strh r1, [r0, #0x04] 0809C29A: 2114 mov r1, #0x14 0809C29C: 80C1 strh r1, [r0, #0x06] 0809C29E: 1C05 add r5, r0, #0x0 0809C2A0: 8829 ldrh r1, [r5] ; r5 (sp+4) contains the X-coordinate for the upcoming SR 0809C2A2: AC01 add r4, sp, #0x004 0809C2A4: 8862 ldrh r2, [r4, #0x02] ; sp+6 contains the Y-coordinate for the upcoming SR 0809C2A6: 1C38 add r0, r7, #0x0 ; Transfer BG number back in r0 for the upcoming SR 0809C2A8: F000 bl 0809C2AA: F860 bl 0x0809C36C ; Calculate address of a Tile ($0202DE34) 0809C2AC: 1C03 add r3, r0, #0x0 0809C2AE: 2200 mov r2, #0x00 0809C2B0: 88E4 ldrh r4, [r4, #0x06] 0809C2B2: 42A2 cmp r2, r4 0809C2B4: D21C bcs 0x0809C2F0 0809C2B6: 466E mov r6, sp ; CLEAR-DMA FOR TILEMAP BUFFER 0809C2B8: 3602 add r6, #0x02 0809C2BA: 4C13 ldr r4, =#0x040000D4 0809C2BC: 2000 mov r0, #0x00 0809C2BE: 8030 strh r0, [r6] ; Clear Stack Entry (used as Source for a clearing Fixed DMA) 0809C2C0: 6026 str r6, [r4] ; DMA Source Address 0809C2C2: 6063 str r3, [r4, #0x04] ; DMA Destination Address (Tile Map buffer, calculated above) 0809C2C4: 88A8 ldrh r0, [r5, #0x04] 0809C2C6: 2181 mov r1, #0x81 0809C2C8: 0609 lsl r1, r1, #0x18 ; Fixed DMA 0809C2CA: 4308 orr r0, r1 ; Add number of Double Byte to Transfer 0809C2CC: 60A0 str r0, [r4, #0x08] ; Activate DMA 0809C2CE: 68A0 ldr r0, [r4, #0x08] 0809C2D0: 68A0 ldr r0, [r4, #0x08] 0809C2D2: 2180 mov r1, #0x80 0809C2D4: 0609 lsl r1, r1, #0x18 0809C2D6: 333C add r3, #0x3C ; ? 0809C2D8: 3201 add r2, #0x01 ; ? 0809C2DA: 2800 cmp r0, #0x00 0809C2DC: DA03 bge 0x0809C2E6 ; Branch if DMA is completed 0809C2DE: 68A0 ldr r0, [r4, #0x08] 0809C2E0: 4008 and r0, r1 0809C2E2: 2800 cmp r0, #0x00 0809C2E4: D1FB bne 0x0809C2DE ; Loop if DMA is not completed 0809C2E6: 0410 lsl r0, r2, #0x10 0809C2E8: 0C02 lsr r2, r0, #0x10 0809C2EA: 88E8 ldrh r0, [r5, #0x06] 0809C2EC: 4282 cmp r2, r0 0809C2EE: D3E5 bcc 0x0809C2BC 0809C2F0: 4668 mov r0, sp ; Exit if sp = #$00 0809C2F2: 7800 ldrb r0, [r0] 0809C2F4: 2800 cmp r0, #0x00 0809C2F6: D030 beq 0x0809C35A 0809C2F8: 2F01 cmp r7, #0x01 0809C2FA: D013 beq 0x0809C324 ; Branch if r7 = #$01 0809C2FC: 2F01 cmp r7, #0x01 0809C2FE: DC05 bgt 0x0809C30C ; Branch if r7 > #$01 0809C300: 2F00 cmp r7, #0x00 0809C302: D008 beq 0x0809C316 ; Branch if r7 = #$00 0809C304: E029 b 0x0809C35A ; Exit if r7 is negative ;DATA ;============ ;0809C306: 0000 lsl r0, r0, #0x0 ;0809C308: 00D4 lsl r4, r2, #0x3 ;0809C30A: 0400 lsl r0, r0, #0x10 0809C30C: 2F02 cmp r7, #0x02 0809C30E: D015 beq 0x0809C33C ; Branch if r7 = #$02 0809C310: 2F03 cmp r7, #0x03 0809C312: D01B beq 0x0809C34C ; Branch if r7 = #$03 0809C314: E021 b 0x0809C35A ; Exit 0809C316: 4802 ldr r0, =#0x0202DE30 ; r7 = #$00 0809C318: 6840 ldr r0, [r0, #0x04] 0809C31A: 21F8 mov r1, #0xF8 0809C31C: 0149 lsl r1, r1, #0x5 0809C31E: E018 b 0x0809C352 ;DATA ;=========== ;0809C320: DE30 ??? ;0809C322: 0202 lsl r2, r0, #0x8 0809C324: 4803 ldr r0, =#0x0202DE30 0809C326: 6840 ldr r0, [r0, #0x04] 0809C328: 4903 ldr r1, =#0x00001F01 0809C32A: 1840 add r0, r0, r1 0809C32C: 7801 ldrb r1, [r0] 0809C32E: 7007 strb r7, [r0] 0809C330: E013 b 0x0809C35A ;DATA ;========== ;0809C332: 0000 lsl r0, r0, #0x0 ;0809C334: DE30 ??? ;0809C336: 0202 lsl r2, r0, #0x8 ;0809C338: 1F01 sub r1, r0, #0x4 ;0809C33A: 0000 lsl r0, r0, #0x0 0809C33C: 4801 ldr r0, =#0x0202DE30 ; r7 = #$02 0809C33E: 6840 ldr r0, [r0, #0x04] 0809C340: 4901 ldr r1, =#0x00001F02 0809C342: E006 b 0x0809C352 ;DATA ;========== ;0809C344: DE30 ??? ;0809C346: 0202 lsl r2, r0, #0x8 ;0809C348: 1F02 sub r2, r0, #0x4 ;0809C34A: 0000 lsl r0, r0, #0x0 0809C34C: 4805 ldr r0, =#0x0202DE30 ; r7 = #$03 0809C34E: 6840 ldr r0, [r0, #0x04] 0809C350: 4905 ldr r1, =#0x00001F03 0809C352: 1840 add r0, r0, r1 0809C354: 7801 ldrb r1, [r0] 0809C356: 2101 mov r1, #0x01 0809C358: 7001 strb r1, [r0] 0809C35A: B003 add sp, #0x00C 0809C35C: BCF0 pop {r4, r5, r6, r7} 0809C35E: BC01 pop {r0} 0809C360: 4700 bx r0 ;DATA ;==================== ;0809C362: 0000 lsl r0, r0, #0x0 ;0809C364: DE30 ??? ;0809C366: 0202 lsl r2, r0, #0x8 ;0809C368: 1F03 sub r3, r0, #0x4 ;0809C36A: 0000 lsl r0, r0, #0x0
$0809C36C - Calculate address of a tile ($0202DE34)
r0 contains the BG number, r2 contains the Y-coordinate, r1 contains the X-coordinate. This turns these values into the address of that tile in the Tilemap buffer in WRAM.
- The main difference between this subroutine and the one at $080BD5E0 is that here the basic offset is loaded from $0202DE34.
0809C36C: B510 push {r4, lr} 0809C36E: 0400 lsl r0, r0, #0x10 0809C370: 0C00 lsr r0, r0, #0x10 0809C372: 1C03 add r3, r0, #0x0 ; r3 = r0 (with Upper Double Byte removed) 0809C374: 0409 lsl r1, r1, #0x10 0809C376: 0C09 lsr r1, r1, #0x10 ; r1 with Upper Double Byte removed 0809C378: 0412 lsl r2, r2, #0x10 0809C37A: 0C12 lsr r2, r2, #0x10 ; r2 with Upper Double Byte removed 0809C37C: 2801 cmp r0, #0x01 0809C37E: D00F beq 0x0809C3A0 ; r0 = #$01 0809C380: 2801 cmp r0, #0x01 0809C382: DC02 bgt 0x0809C38A 0809C384: 2800 cmp r0, #0x00 0809C386: D005 beq 0x0809C394 ; r0 = #$00 0809C388: E022 b 0x0809C3D0 ; r0 is negative(?) = Exit 0809C38A: 2B02 cmp r3, #0x02 0809C38C: D010 beq 0x0809C3B0 ; r0 = #$02 0809C38E: 2B03 cmp r3, #0x03 0809C390: D016 beq 0x0809C3C0 ; r0 = #$03 0809C392: E01D b 0x0809C3D0 ; r0 greater than #$03 = Exit 0809C394: 4801 ldr r0, =#0x0202DE30 ; If r0 = #$00... 0809C396: 6843 ldr r3, [r0, #0x04] ; Load the address in $0202DE34 (presumably #$0203CAD0) 0809C398: E01C b 0x0809C3D4 ;DATA ;=========== ;0809C39A: 0000 lsl r0, r0, #0x0 ;0809C39C: DE30 ??? ;0809C39E: 0202 lsl r2, r0, #0x8 0809C3A0: 4802 ldr r0, =#0x0202DE30 ; If r0 = #$01... 0809C3A2: 6840 ldr r0, [r0, #0x04] ; Load the address in $0202DE34 (presumably #$0203CAD0)... 0809C3A4: 2496 mov r4, #0x96 0809C3A6: 00E4 lsl r4, r4, #0x3 0809C3A8: 1903 add r3, r0, r4 ; ... and add #$000004B0 to it (could be #$0203CF80, then) 0809C3AA: E013 b 0x0809C3D4 ;DATA ;========= ;0809C3AC: DE30 ??? ;0809C3AE: 0202 lsl r2, r0, #0x8 0809C3B0: 4802 ldr r0, =#0x0202DE30 ; If r0 = #$02... 0809C3B2: 6840 ldr r0, [r0, #0x04] ; Load the address in $0202DE34 (presumably #$0203CAD0)... 0809C3B4: 2496 mov r4, #0x96 0809C3B6: 0124 lsl r4, r4, #0x4 0809C3B8: 1903 add r3, r0, r4 ; ... and add #$00000960 to it (could be #$0203D430, then) 0809C3BA: E00B b 0x0809C3D4 ;DATA ;================= ;0809C3BC: DE30 ??? ;0809C3BE: 0202 lsl r2, r0, #0x8 0809C3C0: 4802 ldr r0, =#0x0202DE30 ; If r0 = #$03... 0809C3C2: 6840 ldr r0, [r0, #0x04] ; Load the address in $0202DE34 (presumably #$0203CAD0)... 0809C3C4: 24E1 mov r4, #0xE1 0809C3C6: 0124 lsl r4, r4, #0x4 0809C3C8: 1903 add r3, r0, r4 ; ... and add #$00000E10 to it (could be #$0203D8E0, then) 0809C3CA: E003 b 0x0809C3D4 ;DATA ;================= ;0809C3CC: DE30 ??? ;0809C3CE: 0202 lsl r2, r0, #0x8 0809C3D0: 2000 mov r0, #0x00 0809C3D2: E006 b 0x0809C3E2 0809C3D4: 0110 lsl r0, r2, #0x4 ; r0 = r2 * #$10 0809C3D6: 1A80 sub r0, r0, r2 ; r0 = r0 - r2 = r2 * #$0F 0809C3D8: 0040 lsl r0, r0, #0x1 ; r0 = r2 * #$1E 0809C3DA: 1808 add r0, r1, r0 ; r0 = r1 + r2 * #$1E 0809C3DC: 0040 lsl r0, r0, #0x1 ; r0 = 2 * (r1 + r2 * #$1E) 0809C3DE: 181B add r3, r3, r0 ; Add this to the address loaded... 0809C3E0: 1C18 add r0, r3, #0x0 ; ... and move it to r0 before exiting 0809C3E2: BC10 pop {r4} 0809C3E4: BC02 pop {r1} 0809C3E6: 4708 bx r1
$0809C3E8 - ?
0809C3E8: B5F0 push {r4, r5, r6, r7, lr} 0809C3EA: 4657 mov r7, r10 0809C3EC: 464E mov r6, r9 0809C3EE: 4645 mov r5, r8 0809C3F0: B4E0 push {r5, r6, r7} 0809C3F2: 0400 lsl r0, r0, #0x10 0809C3F4: 0C06 lsr r6, r0, #0x10 0809C3F6: 4A24 ldr r2, =#0x0202DE30 0809C3F8: 6851 ldr r1, [r2, #0x04] ; r1 = #$0203CAD0 (Adress of the Graphics buffer) 0809C3FA: 4B24 ldr r3, =#0x00001F04 0809C3FC: 18C8 add r0, r1, r3 0809C3FE: 8800 ldrh r0, [r0] ; r0 = $0203E9D4 0809C400: 00C0 lsl r0, r0, #0x3 0809C402: 2396 mov r3, #0x96 0809C404: 015B lsl r3, r3, #0x5 0809C406: 18C0 add r0, r0, r3 0809C408: 1809 add r1, r1, r0 0809C40A: 4689 mov r9, r1 0809C40C: 464C mov r4, r9 0809C40E: 2500 mov r5, #0x00 0809C410: 42B5 cmp r5, r6 0809C412: D231 bcs 0x0809C478 0809C414: 2011 mov r0, #0x11 0809C416: 4240 neg r0, r0 0809C418: 4680 mov r8, r0 0809C41A: 2321 mov r3, #0x21 0809C41C: 425B neg r3, r3 0809C41E: 469C mov r12, r3 0809C420: 270D mov r7, #0x0D 0809C422: 427F neg r7, r7 0809C424: 3002 add r0, #0x02 0809C426: 4682 mov r10, r0 0809C428: 78E0 ldrb r0, [r4, #0x03] 0809C42A: 4643 mov r3, r8 0809C42C: 4003 and r3, r0 0809C42E: 4660 mov r0, r12 0809C430: 4003 and r3, r0 0809C432: 7860 ldrb r0, [r4, #0x01] 0809C434: 4662 mov r2, r12 0809C436: 4002 and r2, r0 0809C438: 403A and r2, r7 0809C43A: 4640 mov r0, r8 0809C43C: 4002 and r2, r0 0809C43E: 7961 ldrb r1, [r4, #0x05] 0809C440: 1C38 add r0, r7, #0x0 0809C442: 4008 and r0, r1 0809C444: 2104 mov r1, #0x04 0809C446: 4308 orr r0, r1 0809C448: 7160 strb r0, [r4, #0x05] 0809C44A: 2004 mov r0, #0x04 0809C44C: 4240 neg r0, r0 0809C44E: 4002 and r2, r0 0809C450: 7062 strb r2, [r4, #0x01] 0809C452: 4650 mov r0, r10 0809C454: 4003 and r3, r0 0809C456: 70E3 strb r3, [r4, #0x03] 0809C458: 2000 mov r0, #0x00 0809C45A: 80E0 strh r0, [r4, #0x06] 0809C45C: 1C68 add r0, r5, #0x1 0809C45E: 0400 lsl r0, r0, #0x10 0809C460: 0C05 lsr r5, r0, #0x10 0809C462: 3408 add r4, #0x08 0809C464: 4B08 ldr r3, =#0x0202DE30 0809C466: 6859 ldr r1, [r3, #0x04] 0809C468: 4808 ldr r0, =#0x00001F04 0809C46A: 1809 add r1, r1, r0 0809C46C: 8808 ldrh r0, [r1] 0809C46E: 3001 add r0, #0x01 0809C470: 880A ldrh r2, [r1] 0809C472: 8008 strh r0, [r1] 0809C474: 42B5 cmp r5, r6 0809C476: D3D7 bcc 0x0809C428 0809C478: 4648 mov r0, r9 0809C47A: BC38 pop {r3, r4, r5} 0809C47C: 4698 mov r8, r3 0809C47E: 46A1 mov r9, r4 0809C480: 46AA mov r10, r5 0809C482: BCF0 pop {r4, r5, r6, r7} 0809C484: BC02 pop {r1} 0809C486: 4708 bx r1 ;0809C488: DE30 ??? ;0809C48A: 0202 lsl r2, r0, #0x8 ;0809C48C: 1F04 sub r4, r0, #0x4 ;0809C48E: 0000 lsl r0, r0, #0x0
$0809C518 - AND r1 #$00FF, Jump to 080BEA78
Only does these two things
0809C518: B500 push {lr} 0809C51A: 0409 lsl r1, r1, #0x10 0809C51C: 0C09 lsr r1, r1, #0x10 ; r1 = AND #$0000FFFF 0809C51E: F022 bl 0809C520: FAAB bl 0x080BEA78 0809C522: BC01 pop {r0} 0809C524: 4700 bx r0 ;0809C526: 0000 lsl r0, r0, #0x0
$0809C528 - ?
0809C528: B5F0 push {r4, r5, r6, r7, lr} 0809C52A: 464F mov r7, r9 0809C52C: 4646 mov r6, r8 0809C52E: B4C0 push {r6, r7} 0809C530: B088 add sp, #-0x020 0809C532: 1C06 add r6, r0, #0x0 0809C534: 1C0D add r5, r1, #0x0 0809C536: 980F ldr r0, [sp, #0x03C] 0809C538: 0412 lsl r2, r2, #0x10 0809C53A: 0C12 lsr r2, r2, #0x10 0809C53C: 4690 mov r8, r2 0809C53E: 041B lsl r3, r3, #0x10 0809C540: 0C1F lsr r7, r3, #0x10 0809C542: 0400 lsl r0, r0, #0x10 0809C544: 0C00 lsr r0, r0, #0x10 0809C546: 4681 mov r9, r0 0809C548: 2400 mov r4, #0x00 0809C54A: 8830 ldrh r0, [r6] 0809C54C: 8829 ldrh r1, [r5] 0809C54E: 4642 mov r2, r8 0809C550: 1C3B add r3, r7, #0x0 0809C552: F022 bl 0809C554: F845 bl 0x080BE5E0 0809C556: 0061 lsl r1, r4, #0x1 0809C558: 4469 add r1, sp 0809C55A: 8008 strh r0, [r1] 0809C55C: 1C60 add r0, r4, #0x1 0809C55E: 0400 lsl r0, r0, #0x10 0809C560: 0C04 lsr r4, r0, #0x10 0809C562: 3602 add r6, #0x02 0809C564: 3502 add r5, #0x02 0809C566: 2C0F cmp r4, #0x0F 0809C568: D9EF bls 0x0809C54A 0809C56A: 4668 mov r0, sp 0809C56C: 4649 mov r1, r9 0809C56E: 2220 mov r2, #0x20 0809C570: F000 bl 0809C572: F982 bl 0x0809C878 0809C574: B008 add sp, #0x020 0809C576: BC18 pop {r3, r4} 0809C578: 4698 mov r8, r3 0809C57A: 46A1 mov r9, r4 0809C57C: BCF0 pop {r4, r5, r6, r7} 0809C57E: BC01 pop {r0} ;DATA ;========== ;0809C580: 4700 bx r0 ;0809C582: 0000 lsl r0, r0, #0x0
$0809C584 - ?
0809C584: B5F0 push {r4, r5, r6, r7, lr} 0809C586: 4647 mov r7, r8 0809C588: B480 push {r7} 0809C58A: B088 add sp, #-0x020 0809C58C: 1C05 add r5, r0, #0x0 0809C58E: 0409 lsl r1, r1, #0x10 0809C590: 0C0F lsr r7, r1, #0x10 0809C592: 0412 lsl r2, r2, #0x10 0809C594: 0C16 lsr r6, r2, #0x10 0809C596: 041B lsl r3, r3, #0x10 0809C598: 0C1B lsr r3, r3, #0x10 0809C59A: 4698 mov r8, r3 0809C59C: 2400 mov r4, #0x00 ; Loop 0809C59E: 8829 ldrh r1, [r5] 0809C5A0: 480C ldr r0, =#0x00007FFF 0809C5A2: 1C3A add r2, r7, #0x0 0809C5A4: 1C33 add r3, r6, #0x0 0809C5A6: F022 bl 0809C5A8: F81B bl 0x080BE5E0 0809C5AA: 0061 lsl r1, r4, #0x1 0809C5AC: 4469 add r1, sp 0809C5AE: 8008 strh r0, [r1] 0809C5B0: 1C60 add r0, r4, #0x1 ; Increment counter 0809C5B2: 0400 lsl r0, r0, #0x10 0809C5B4: 0C04 lsr r4, r0, #0x10 0809C5B6: 3502 add r5, #0x02 0809C5B8: 2C0F cmp r4, #0x0F 0809C5BA: D9F0 bls 0x0809C59E ;Register prep for DMA 0809C5BC: 4668 mov r0, sp 0809C5BE: 4641 mov r1, r8 0809C5C0: 2220 mov r2, #0x20 ; Number of colors to transfer 0809C5C2: F000 bl 0809C5C4: F959 bl 0x0809C878 ; DMA that transfers $20 colors from $03007E3C to the color temp store (starting at $0203E4B0) 0809C5C6: B008 add sp, #0x020 0809C5C8: BC08 pop {r3} 0809C5CA: 4698 mov r8, r3 0809C5CC: BCF0 pop {r4, r5, r6, r7} 0809C5CE: BC01 pop {r0} 0809C5D0: 4700 bx r0 ;0809C5D2: 0000 lsl r0, r0, #0x0 ;0809C5D4: 7FFF ldrb r7, [r7, #0x1F] ;0809C5D6: 0000 lsl r0, r0, #0x0
$0809C678 - ?
0809C678: B570 push {r4, r5, r6, lr} 0809C67A: 480D ldr r0, =#0x08699AA4 0809C67C: 2107 mov r1, #0x07 0809C67E: F021 bl 0809C680: FE57 bl 0x080BE330 ; Load address from Intro (Sky/Castle) Palette 0809C682: 1C05 add r5, r0, #0x0 ; Transfer Palette address in r5 0809C684: 2400 mov r4, #0x00 ; Setup counter 0809C686: 4E0B ldr r6, =#0x020326CE 0809C688: 8830 ldrh r0, [r6] 0809C68A: 211E mov r1, #0x1E 0809C68C: 1A09 sub r1, r1, r0 ; r1 = #$1E - [$020326CE] 0809C68E: 0409 lsl r1, r1, #0x10 0809C690: 0C09 lsr r1, r1, #0x10 0809C692: 1C28 add r0, r5, #0x0 0809C694: 221E mov r2, #0x1E 0809C696: 1C23 add r3, r4, #0x0 0809C698: F7FF bl 0809C69A: FF74 bl 0x0809C584 0809C69C: 3520 add r5, #0x20 0809C69E: 1C60 add r0, r4, #0x1 ; Increment Counter 0809C6A0: 0400 lsl r0, r0, #0x10 0809C6A2: 0C04 lsr r4, r0, #0x10 0809C6A4: 2C0F cmp r4, #0x0F 0809C6A6: D9EF bls 0x0809C688 ; Loop until r4 SURPASSED #$0F 0809C6A8: BC70 pop {r4, r5, r6} 0809C6AA: BC01 pop {r0} 0809C6AC: 4700 bx r0 0809C6AE: 0000 lsl r0, r0, #0x0 0809C6B0: 9AA4 ldr r2, [sp, #0x290] 0809C6B2: 0869 lsr r1, r5, #0x1 0809C6B4: 26CE mov r6, #0xCE 0809C6B6: 0203 lsl r3, r0, #0x8
$0809C818 - ?
0809C818: B500 push {lr} 0809C81A: B089 add sp, #-0x024 0809C81C: 4813 ldr r0, =#0x08733BBC ; Address Table address 0809C81E: 2129 mov r1, #0x29 ; Table Entry number 0809C820: F021 bl 0809C822: FD86 bl 0x080BE330 ; Load address from Address Table 0809C824: 1C03 add r3, r0, #0x0 ; Transfer Address in r3 0809C826: 3302 add r3, #0x02 0809C828: 2200 mov r2, #0x00 0809C82A: 0050 lsl r0, r2, #0x1 0809C82C: 4669 mov r1, sp 0809C82E: 1809 add r1, r1, r0 0809C830: 3104 add r1, #0x04 0809C832: 8818 ldrh r0, [r3] ; Load Double Byte from Address 0809C834: 8008 strh r0, [r1] ; Store on Stack 0809C836: 1C50 add r0, r2, #0x1 0809C838: 0400 lsl r0, r0, #0x10 0809C83A: 0C02 lsr r2, r0, #0x10 0809C83C: 2A0F cmp r2, #0x0F 0809C83E: D9F4 bls 0x0809C82A 0809C840: 480A ldr r0, =#0x08733BBC ; Address Table address 0809C842: 212D mov r1, #0x2D ; Table Entry number 0809C844: F021 bl 0809C846: FD74 bl 0x080BE330 ; Load address from Address Table 0809C848: 1C01 add r1, r0, #0x0 0809C84A: 4809 ldr r0, =#0x0202DE30 0809C84C: 4A09 ldr r2, =#0x0000489E 0809C84E: 1880 add r0, r0, r2 ; r0 = #$020326CE 0809C850: 8800 ldrh r0, [r0] ; r0 = [$020326CE] 0809C852: 221E mov r2, #0x1E 0809C854: 1A12 sub r2, r2, r0 0809C856: 0412 lsl r2, r2, #0x10 0809C858: 0C12 lsr r2, r2, #0x10 0809C85A: 2010 mov r0, #0x10 0809C85C: 9000 str r0, [sp] 0809C85E: A801 add r0, sp, #0x004 0809C860: 231E mov r3, #0x1E 0809C862: F7FF bl 0809C864: FE61 bl 0x0809C528 0809C866: B009 add sp, #0x024 0809C868: BC01 pop {r0} 0809C86A: 4700 bx r0 ;0809C86C: 3BBC sub r3, #0xBC ;0809C86E: 0873 lsr r3, r6, #0x1 ;0809C870: DE30 ??? ;0809C872: 0202 lsl r2, r0, #0x8 ;0809C874: 489E ldr r0, =#0x68687006 ;0809C876: 0000 lsl r0, r0, #0x0
$0809C878 - DMA to Palette RAM Buffer
r0 = Address of Data to transfer
r1 = Number of the palette to start
r2 = Number of Bytes to transfer (max.: #$200, of course)
0809C878: B510 push {r4, lr} 0809C87A: 0409 lsl r1, r1, #0x10 0809C87C: 0412 lsl r2, r2, #0x10 0809C87E: 4B0E ldr r3, =#0x0202DE30 0809C880: 0AC9 lsr r1, r1, #0xB 0809C882: 24CE mov r4, #0xCE 0809C884: 0164 lsl r4, r4, #0x5 ; r4 = #$000019C0 0809C886: 1909 add r1, r1, r4 0809C888: 685B ldr r3, [r3, #0x04] ; Load value from $0202DE34 in r3, contains the offset of the graphics buffer, $0203CAD0 0809C88A: 185B add r3, r3, r1 ; Offset of the graphics buffer + $000019C0 = Offset of the Palette RAM buffer 0809C88C: 490B ldr r1, =#0x040000D4 0809C88E: 6008 str r0, [r1] ; DMA Source Address 0809C890: 604B str r3, [r1, #0x04] ; DMA Destination Address 0809C892: 0C52 lsr r2, r2, #0x11 0809C894: 2380 mov r3, #0x80 ; DMA Enable Bit 0809C896: 061B lsl r3, r3, #0x18 0809C898: 431A orr r2, r3 ; Add Enable Bit to Number of Bytes to transfer 0809C89A: 608A str r2, [r1, #0x08] ; Activate DMA 0809C89C: 6888 ldr r0, [r1, #0x08] 0809C89E: 6888 ldr r0, [r1, #0x08] 0809C8A0: 4018 and r0, r3 0809C8A2: 2800 cmp r0, #0x00 0809C8A4: D004 beq 0x0809C8B0 ; Branch if DMA is done 0809C8A6: 1C1A add r2, r3, #0x0 0809C8A8: 6888 ldr r0, [r1, #0x08] 0809C8AA: 4010 and r0, r2 0809C8AC: 2800 cmp r0, #0x00 0809C8AE: D1FB bne 0x0809C8A8 ; Loop if DMA isn't done 0809C8B0: BC10 pop {r4} 0809C8B2: BC01 pop {r0} 0809C8B4: 4700 bx r0 ;DATA ;============ ;0809C8B6: 0000 lsl r0, r0, #0x0 ;0809C8B8: DE30 ??? ;0809C8BA: 0202 lsl r2, r0, #0x8 ;0809C8BC: 00D4 lsl r4, r2, #0x3 ;0809C8BE: 0400 lsl r0, r0, #0x10
$0809C8C0 - ?
0809C8C0: B5F0 push {r4, r5, r6, r7, lr} ; Store registers on Stack 0809C8C2: 464F mov r7, r9 0809C8C4: 4646 mov r6, r8 0809C8C6: B4C0 push {r6, r7} 0809C8C8: B081 add sp, #-0x004 ; Add 4 bytes on stack 0809C8CA: 0400 lsl r0, r0, #0x10 0809C8CC: 0C05 lsr r5, r0, #0x10 ; r5 = r0 AND #$0000FFFF 0809C8CE: 4669 mov r1, sp 0809C8D0: 2000 mov r0, #0x00 0809C8D2: 8008 strh r0, [r1] ; Clear two bytes of the newly add stack entry 0809C8D4: 491D ldr r1, =#0x040000D4 0809C8D6: 4668 mov r0, sp 0809C8D8: 6008 str r0, [r1] ; DMA Source Address: That Stack Entry 0809C8DA: 4A1D ldr r2, =#0x02032700 0809C8DC: 604A str r2, [r1, #0x04] ; DMA Destination: $02032700 (WRAM) 0809C8DE: 481D ldr r0, =#0x81004A2E 0809C8E0: 6088 str r0, [r1, #0x08] ; Fixed Transfer, 4A2E Doublebytes 0809C8E2: 6888 ldr r0, [r1, #0x08] 0809C8E4: 6888 ldr r0, [r1, #0x08] 0809C8E6: 2380 mov r3, #0x80 0809C8E8: 061B lsl r3, r3, #0x18 ; Set up AND Mask for DMA Enable Bit 0809C8EA: 1C14 add r4, r2, #0x0 ; r4 = $02032700 0809C8EC: 4E1A ldr r6, =#0x0203BBA0 ; r6 = $0203BBA0 0809C8EE: 4F1B ldr r7, =#0x0203CAD0 ; r7 = $0203CAD0 0809C8F0: 4A1B ldr r2, =#0x0203CAC0 0809C8F2: 4694 mov r12, r2 ; r12 = $0203CAC0 0809C8F4: 4A1B ldr r2, =#0x0203BBF0 0809C8F6: 4690 mov r8, r2 ; r8 = $0203BBF0 0809C8F8: 4A1B ldr r2, =#0x0203BC10 0809C8FA: 4691 mov r9, r2 ; r9 = $0203BC10 0809C8FC: 2800 cmp r0, #0x00 0809C8FE: DA04 bge 0x0809C90A ; Overbranch the next loop if DMA is completed 0809C900: 1C1A add r2, r3, #0x0 0809C902: 6888 ldr r0, [r1, #0x08] 0809C904: 4010 and r0, r2 ; Exempt DMA Enable bit 0809C906: 2800 cmp r0, #0x00 ; Is it still set? Is the DMA still active? 0809C908: D1FB bne 0x0809C902 ; Loop if not 0809C90A: 4918 ldr r1, =#0x00009448 0809C90C: 1860 add r0, r4, r1 ; r0 = $0400951C (Beyond used register area!?!) 0809C90E: 7005 strb r5, [r0] 0809C910: 6026 str r6, [r4] 0809C912: 6067 str r7, [r4, #0x04] 0809C914: 4662 mov r2, r12 0809C916: 60A2 str r2, [r4, #0x08] 0809C918: 4640 mov r0, r8 0809C91A: 60E0 str r0, [r4, #0x0C] 0809C91C: 4649 mov r1, r9 0809C91E: 6121 str r1, [r4, #0x10] 0809C920: F003 bl 0809C922: FD5C bl 0x080A03DC 0809C924: 6920 ldr r0, [r4, #0x10] 0809C926: 2300 mov r3, #0x00 0809C928: 2D08 cmp r5, #0x08 0809C92A: D100 bne 0x0809C92E 0809C92C: 2301 mov r3, #0x01 0809C92E: 2102 mov r1, #0x02 0809C930: 2200 mov r2, #0x00 0809C932: F01A bl 0809C934: F81D bl 0x080B6970 0809C936: F021 bl 0809C938: FFE9 bl 0x080BE90C 0809C93A: F000 bl 0809C93C: FBC1 bl 0x0809D0C0 0809C93E: 2D0A cmp r5, #0x0A 0809C940: D848 bhi 0x0809C9D4 0809C942: 00A8 lsl r0, r5, #0x2 ; LOAD ADDRESS FROM JUMP TABLE AND JUMP THERE 0809C944: 490A ldr r1, =#0x0809C974 ; Address Table at $0809C974 onwards 0809C946: 1840 add r0, r0, r1 0809C948: 6800 ldr r0, [r0] 0809C94A: 4687 mov pc, r0 ;DATA ;============== ;0809C94C: 00D4 lsl r4, r2, #0x3 ;0809C94E: 0400 lsl r0, r0, #0x10 ;0809C950: 2700 mov r7, #0x00 ;0809C952: 0203 lsl r3, r0, #0x8 ;0809C954: 4A2E ldr r2, =#0x00009449 ;0809C956: 8100 strh r0, [r0, #0x08] ;0809C958: BBA0 pop {r5, r7, pc} ;0809C95A: 0203 lsl r3, r0, #0x8 ;0809C95C: CAD0 ldmia r2!, {r4, r6, r7} ;0809C95E: 0203 lsl r3, r0, #0x8 ;0809C960: CAC0 ldmia r2!, {r6, r7} ;0809C962: 0203 lsl r3, r0, #0x8 ;0809C964: BBF0 pop {r4, r5, r6, r7, pc} ;0809C966: 0203 lsl r3, r0, #0x8 ;0809C968: BC10 pop {r4} ;0809C96A: 0203 lsl r3, r0, #0x8 ;0809C96C: 9448 str r4, [sp, #0x120] ;0809C96E: 0000 lsl r0, r0, #0x0 ;0809C970: C974 ldmia r1!, {r2, r4, r5, r6} ;0809C972: 0809 lsr r1, r1, #0x0 ; JUMP TABLE ;============== ; entry 0-3: $0809C9A0 ; entry 4: $0809C9A6 ; entry 5: $0809C9AC ; entry 6: $0809C9B2 ; entry 7: $0809C9C4 ; entry 8: $0809C9CA ; entry 9: $0809C9D4 ; entry A: $0809C9D0 ;0809C974: C9A0 ldmia r1!, {r5, r7} ;0809C976: 0809 lsr r1, r1, #0x0 ;0809C978: C9A0 ldmia r1!, {r5, r7} ;0809C97A: 0809 lsr r1, r1, #0x0 ;0809C97C: C9A0 ldmia r1!, {r5, r7} ;0809C97E: 0809 lsr r1, r1, #0x0 ;0809C980: C9A0 ldmia r1!, {r5, r7} ;0809C982: 0809 lsr r1, r1, #0x0 ;0809C984: C9A6 ldmia r1!, {r1, r2, r5, r7} ;0809C986: 0809 lsr r1, r1, #0x0 ;0809C988: C9AC ldmia r1!, {r2, r3, r5, r7} ;0809C98A: 0809 lsr r1, r1, #0x0 ;0809C98C: C9B2 ldmia r1!, {r1, r4, r5, r7} ;0809C98E: 0809 lsr r1, r1, #0x0 ;0809C990: C9C4 ldmia r1!, {r2, r6, r7} ;0809C992: 0809 lsr r1, r1, #0x0 ;0809C994: C9CA ldmia r1!, {r1, r3, r6, r7} ;0809C996: 0809 lsr r1, r1, #0x0 ;0809C998: C9D4 ldmia r1!, {r2, r4, r6, r7} ;0809C99A: 0809 lsr r1, r1, #0x0 ;0809C99C: C9D0 ldmia r1!, {r4, r6, r7} ;0809C99E: 0809 lsr r1, r1, #0x0 0809C9A0: F000 bl 0809C9A2: F838 bl 0x0809CA14 0809C9A4: E016 b 0x0809C9D4 0809C9A6: F000 bl 0809C9A8: F8ED bl 0x0809CB84 0809C9AA: E013 b 0x0809C9D4 0809C9AC: F000 bl 0809C9AE: F938 bl 0x0809CC20 0809C9B0: E010 b 0x0809C9D4 0809C9B2: 4803 ldr r0, =#0x020326F0 0809C9B4: 8800 ldrh r0, [r0] 0809C9B6: 280D cmp r0, #0x0D 0809C9B8: D80C bhi 0x0809C9D4 0809C9BA: F000 bl 0809C9BC: F967 bl 0x0809CC8C 0809C9BE: E009 b 0x0809C9D4 0809C9C0: 26F0 mov r6, #0xF0 0809C9C2: 0203 lsl r3, r0, #0x8 0809C9C4: F000 bl 0809C9C6: F974 bl 0x0809CCB0 0809C9C8: E004 b 0x0809C9D4 0809C9CA: F000 bl 0809C9CC: F983 bl 0x0809CCD4 0809C9CE: E001 b 0x0809C9D4 0809C9D0: F000 bl 0809C9D2: F9A6 bl 0x0809CD20 0809C9D4: F000 bl 0809C9D6: FB6A bl 0x0809D0AC 0809C9D8: 4A0B ldr r2, =#0x020326F0 0809C9DA: 2000 mov r0, #0x00 0809C9DC: 8010 strh r0, [r2] 0809C9DE: 7891 ldrb r1, [r2, #0x02] 0809C9E0: 3802 sub r0, #0x02 0809C9E2: 4008 and r0, r1 0809C9E4: 2103 mov r1, #0x03 0809C9E6: 4249 neg r1, r1 0809C9E8: 4008 and r0, r1 0809C9EA: 3902 sub r1, #0x02 0809C9EC: 4008 and r0, r1 0809C9EE: 7090 strb r0, [r2, #0x02] 0809C9F0: 4806 ldr r0, =#0x02032700 0809C9F2: 4A07 ldr r2, =#0x00009449 0809C9F4: 1880 add r0, r0, r2 0809C9F6: 7800 ldrb r0, [r0] 0809C9F8: B001 add sp, #0x004 0809C9FA: BC18 pop {r3, r4} 0809C9FC: 4698 mov r8, r3 0809C9FE: 46A1 mov r9, r4 0809CA00: BCF0 pop {r4, r5, r6, r7} 0809CA02: BC02 pop {r1} 0809CA04: 4708 bx r1 ;DATA ;============== ;0809CA06: 0000 lsl r0, r0, #0x0 ;0809CA08: 26F0 mov r6, #0xF0 ;0809CA0A: 0203 lsl r3, r0, #0x8 ;0809CA0C: 2700 mov r7, #0x00 ;0809CA0E: 0203 lsl r3, r0, #0x8 ;0809CA10: 9449 str r4, [sp, #0x124] ;0809CA12: 0000 lsl r0, r0, #0x0
$0809CA14 - ?
0809CA14: B570 push {r4, r5, r6, lr} 0809CA16: 4C16 ldr r4, =#0x02032714 0809CA18: 1C20 add r0, r4, #0x0 ; r0 = #$02032714 0809CA1A: F00B bl 0809CA1C: F85D bl 0x080A7AD8 0809CA1E: 1C20 add r0, r4, #0x0 ; r0 = #$02032714 0809CA20: F016 bl 0809CA22: FA12 bl 0x080B2E48 0809CA24: 1C25 add r5, r4, #0x0 ; r5 = #$02032714 0809CA26: 3D14 sub r5, #0x14 ; r5 = #$02032700 0809CA28: 4812 ldr r0, =#0x00009432 0809CA2A: 1821 add r1, r4, r0 ; r1 = #$0203BB46 0809CA2C: 2600 mov r6, #0x00 0809CA2E: 200F mov r0, #0x0F 0809CA30: 8008 strh r0, [r1] ; $0203BB46 = #$000F 0809CA32: 4811 ldr r0, =#0x00009430 0809CA34: 1821 add r1, r4, r0 0809CA36: 8808 ldrh r0, [r1] 0809CA38: 203F mov r0, #0x3F 0809CA3A: 8008 strh r0, [r1] ; $0203BB44 = #$003F 0809CA3C: 6828 ldr r0, [r5] ; r0 = $02032700 0809CA3E: 880B ldrh r3, [r1] ; r3 = #$003F 0809CA40: 210F mov r1, #0x0F 0809CA42: 220F mov r2, #0x0F 0809CA44: F021 bl 0809CA46: FCB8 bl 0x080BE3B8 0809CA48: 4A0C ldr r2, =#0x04000050 0809CA4A: 6829 ldr r1, [r5] 0809CA4C: 8808 ldrh r0, [r1] 0809CA4E: 8010 strh r0, [r2] 0809CA50: 3202 add r2, #0x02 0809CA52: 8848 ldrh r0, [r1, #0x02] 0809CA54: 8010 strh r0, [r2] 0809CA56: 3202 add r2, #0x02 0809CA58: 8888 ldrh r0, [r1, #0x04] 0809CA5A: 8010 strh r0, [r2] 0809CA5C: 4908 ldr r1, =#0x00009434 0809CA5E: 1860 add r0, r4, r1 0809CA60: 7800 ldrb r0, [r0] 0809CA62: 2801 cmp r0, #0x01 0809CA64: D02E beq 0x0809CAC4 0809CA66: 2801 cmp r0, #0x01 0809CA68: DC0C bgt 0x0809CA84 0809CA6A: 2800 cmp r0, #0x00 0809CA6C: D00F beq 0x0809CA8E 0809CA6E: E064 b 0x0809CB3A ;0809CA70: 2714 mov r7, #0x14 ;0809CA72: 0203 lsl r3, r0, #0x8 ;0809CA74: 9432 str r4, [sp, #0x0C8] ;0809CA76: 0000 lsl r0, r0, #0x0 ;0809CA78: 9430 str r4, [sp, #0x0C0] ;0809CA7A: 0000 lsl r0, r0, #0x0 ;0809CA7C: 0050 lsl r0, r2, #0x1 ;0809CA7E: 0400 lsl r0, r0, #0x10 ;0809CA80: 9434 str r4, [sp, #0x0D0] ;0809CA82: 0000 lsl r0, r0, #0x0 0809CA84: 2802 cmp r0, #0x02 0809CA86: D043 beq 0x0809CB10 0809CA88: 2803 cmp r0, #0x03 0809CA8A: D04D beq 0x0809CB28 0809CA8C: E055 b 0x0809CB3A 0809CA8E: 480B ldr r0, =#0x0000943A 0809CA90: 1823 add r3, r4, r0 0809CA92: 781A ldrb r2, [r3] 0809CA94: 0711 lsl r1, r2, #0x1C 0809CA96: 0FC9 lsr r1, r1, #0x1F 0809CA98: 06D0 lsl r0, r2, #0x1B 0809CA9A: 0FC0 lsr r0, r0, #0x1F 0809CA9C: 4301 orr r1, r0 0809CA9E: 2900 cmp r1, #0x00 0809CAA0: D04B beq 0x0809CB3A 0809CAA2: 2040 mov r0, #0x40 0809CAA4: 4310 orr r0, r2 0809CAA6: 7018 strb r0, [r3] 0809CAA8: 4805 ldr r0, =#0x000037CC 0809CAAA: 1821 add r1, r4, r0 0809CAAC: 2076 mov r0, #0x76 0809CAAE: 8008 strh r0, [r1] 0809CAB0: 1C20 add r0, r4, #0x0 0809CAB2: 2100 mov r1, #0x00 0809CAB4: 2212 mov r2, #0x12 0809CAB6: F00C bl 0809CAB8: F9F9 bl 0x080A8EAC 0809CABA: E03E b 0x0809CB3A ;0809CABC: 943A str r4, [sp, #0x0E8] ;0809CABE: 0000 lsl r0, r0, #0x0 ;0809CAC0: 37CC add r7, #0xCC ;0809CAC2: 0000 lsl r0, r0, #0x0 0809CAC4: 490E ldr r1, =#0x0000943A 0809CAC6: 1863 add r3, r4, r1 0809CAC8: 781A ldrb r2, [r3] 0809CACA: 0711 lsl r1, r2, #0x1C 0809CACC: 0FC9 lsr r1, r1, #0x1F 0809CACE: 06D0 lsl r0, r2, #0x1B 0809CAD0: 0FC0 lsr r0, r0, #0x1F 0809CAD2: 4301 orr r1, r0 0809CAD4: 2900 cmp r1, #0x00 0809CAD6: D030 beq 0x0809CB3A 0809CAD8: 2080 mov r0, #0x80 0809CADA: 4310 orr r0, r2 0809CADC: 7018 strb r0, [r3] 0809CADE: 6868 ldr r0, [r5, #0x04] 0809CAE0: 4908 ldr r1, =#0x00001F08 0809CAE2: 1840 add r0, r0, r1 0809CAE4: 7801 ldrb r1, [r0] 0809CAE6: 7006 strb r6, [r0] 0809CAE8: 6868 ldr r0, [r5, #0x04] 0809CAEA: 4907 ldr r1, =#0x00001F09 0809CAEC: 1840 add r0, r0, r1 0809CAEE: 7801 ldrb r1, [r0] 0809CAF0: 7006 strb r6, [r0] 0809CAF2: 6868 ldr r0, [r5, #0x04] 0809CAF4: 4905 ldr r1, =#0x00001F0A 0809CAF6: 1840 add r0, r0, r1 0809CAF8: 7801 ldrb r1, [r0] 0809CAFA: 7006 strb r6, [r0] 0809CAFC: E01D b 0x0809CB3A ;0809CAFE: 0000 lsl r0, r0, #0x0 ;0809CB00: 943A str r4, [sp, #0x0E8] ;0809CB02: 0000 lsl r0, r0, #0x0 ;0809CB04: 1F08 sub r0, r1, #0x4 ;0809CB06: 0000 lsl r0, r0, #0x0 ;0809CB08: 1F09 sub r1, r1, #0x4 ;0809CB0A: 0000 lsl r0, r0, #0x0 ;0809CB0C: 1F0A sub r2, r1, #0x4 ;0809CB0E: 0000 lsl r0, r0, #0x0 0809CB10: 4804 ldr r0, =#0x000037CC 0809CB12: 1821 add r1, r4, r0 0809CB14: 2061 mov r0, #0x61 0809CB16: 8008 strh r0, [r1] 0809CB18: 1C20 add r0, r4, #0x0 0809CB1A: 2100 mov r1, #0x00 0809CB1C: 2213 mov r2, #0x13 0809CB1E: F00C bl 0809CB20: F9C5 bl 0x080A8EAC 0809CB22: E00A b 0x0809CB3A ;0809CB24: 37CC add r7, #0xCC ;0809CB26: 0000 lsl r0, r0, #0x0 0809CB28: 4809 ldr r0, =#0x000037CC 0809CB2A: 1821 add r1, r4, r0 0809CB2C: 207B mov r0, #0x7B 0809CB2E: 8008 strh r0, [r1] 0809CB30: 1C20 add r0, r4, #0x0 0809CB32: 2100 mov r1, #0x00 0809CB34: 2212 mov r2, #0x12 0809CB36: F00C bl 0809CB38: F9B9 bl 0x080A8EAC 0809CB3A: 4C06 ldr r4, =#0x02032700 0809CB3C: 4906 ldr r1, =#0x00009448 0809CB3E: 1860 add r0, r4, r1 0809CB40: 7800 ldrb r0, [r0] 0809CB42: 2803 cmp r0, #0x03 0809CB44: D10A bne 0x0809CB5C 0809CB46: 2030 mov r0, #0x30 0809CB48: F7BE bl 0809CB4A: FD0C bl 0x0805B564 0809CB4C: E013 b 0x0809CB76 ;0809CB4E: 0000 lsl r0, r0, #0x0 ;0809CB50: 37CC add r7, #0xCC ;0809CB52: 0000 lsl r0, r0, #0x0 ;0809CB54: 2700 mov r7, #0x00 ;0809CB56: 0203 lsl r3, r0, #0x8 ;0809CB58: 9448 str r4, [sp, #0x120] ;0809CB5A: 0000 lsl r0, r0, #0x0 0809CB5C: 4908 ldr r1, =#0x0000944E 0809CB5E: 1860 add r0, r4, r1 0809CB60: 7800 ldrb r0, [r0] 0809CB62: 09C0 lsr r0, r0, #0x7 0809CB64: 2800 cmp r0, #0x00 0809CB66: D106 bne 0x0809CB76 0809CB68: 2046 mov r0, #0x46 0809CB6A: F7BE bl 0809CB6C: FCFB bl 0x0805B564 0809CB6E: 1C20 add r0, r4, #0x0 0809CB70: 3014 add r0, #0x14 0809CB72: F017 bl 0809CB74: FFBD bl 0x080B4AF0 0809CB76: F000 bl 0809CB78: F8ED bl 0x0809CD54 0809CB7A: BC70 pop {r4, r5, r6} 0809CB7C: BC01 pop {r0} 0809CB7E: 4700 bx r0 ;0809CB80: 944E str r4, [sp, #0x138] ;0809CB82: 0000 lsl r0, r0, #0x0
$0809CC20 - ?
0809CC20: B510 push {r4, lr} 0809CC22: 4C16 ldr r4, =#0x02032714 0809CC24: 1C20 add r0, r4, #0x0 ; r0 = $02032714 0809CC26: F00A bl 0809CC28: FE7B bl 0x080A7920 ; ? 0809CC2A: 1C20 add r0, r4, #0x0 ; r0 = $02032714 0809CC2C: F017 bl 0809CC2E: FF60 bl 0x080B4AF0 ; ? 0809CC30: 1C20 add r0, r4, #0x0 ; r0 = $02032714 0809CC32: F016 bl 0809CC34: F909 bl 0x080B2E48 ; ? 0809CC36: 1C20 add r0, r4, #0x0 0809CC38: 3814 sub r0, #0x14 0809CC3A: 6840 ldr r0, [r0, #0x04] ; r0 = [$02032704] 0809CC3C: F000 bl 0809CC3E: FCFC bl 0x0809D638 ; ? 0809CC40: 490F ldr r1, =#0x0000943A 0809CC42: 1860 add r0, r4, r1 ; r0 = $0203BB4E 0809CC44: 7800 ldrb r0, [r0] 0809CC46: 0700 lsl r0, r0, #0x1C 0809CC48: 2800 cmp r0, #0x00 0809CC4A: DA0E bge 0x0809CC6A ; Branch if Bit 3 of $0203BB4E is clear 0809CC4C: 480D ldr r0, =#0x000037CC 0809CC4E: 1821 add r1, r4, r0 0809CC50: 2063 mov r0, #0x63 0809CC52: 8008 strh r0, [r1] ; Stor #$63 in $02035EE0 0809CC54: 1C20 add r0, r4, #0x0 ; r0 = #$02032714 0809CC56: 2100 mov r1, #0x00 ; r1 = #$00 0809CC58: 2212 mov r2, #0x12 ; r2 = #$12 0809CC5A: F00C bl 0809CC5C: F927 bl 0x080A8EAC ; ? 0809CC5E: 490A ldr r1, =#0x000037D5 0809CC60: 1862 add r2, r4, r1 0809CC62: 7810 ldrb r0, [r2] ; r0 = [$02035EE9] 0809CC64: 2101 mov r1, #0x01 0809CC66: 4308 orr r0, r1 0809CC68: 7010 strb r0, [r2] ; Set Bit 0 in $02035EE9 0809CC6A: 2046 mov r0, #0x46 ; r0 = #$46 0809CC6C: F7BE bl 0809CC6E: FC7A bl 0x0805B564 ; ? 0809CC70: F000 bl 0809CC72: F870 bl 0x0809CD54 ; ? 0809CC74: BC10 pop {r4} 0809CC76: BC01 pop {r0} 0809CC78: 4700 bx r0 ;0809CC7A: 0000 lsl r0, r0, #0x0 ;0809CC7C: 2714 mov r7, #0x14 ;0809CC7E: 0203 lsl r3, r0, #0x8 ;0809CC80: 943A str r4, [sp, #0x0E8] ;0809CC82: 0000 lsl r0, r0, #0x0 ;0809CC84: 37CC add r7, #0xCC ;0809CC86: 0000 lsl r0, r0, #0x0 ;0809CC88: 37D5 add r7, #0xD5 ;0809CC8A: 0000 lsl r0, r0, #0x0
$0809CC8C - ?
0809CC8C: B510 push {r4, lr} 0809CC8E: 4C07 ldr r4, =#0x02032714 0809CC90: 1C20 add r0, r4, #0x0 ; r0 = #$02032714 0809CC92: F00A bl 0809CC94: FF33 bl 0x080A7AFC ; ? 0809CC96: 1C20 add r0, r4, #0x0 ; r0 = #$02032714 0809CC98: F017 bl 0809CC9A: FF2A bl 0x080B4AF0 ; ? 0809CC9C: 1C20 add r0, r4, #0x0 ; r0 = #$02032714 0809CC9E: F016 bl 0809CCA0: F8D3 bl 0x080B2E48 ; ? 0809CCA2: F000 bl 0809CCA4: F857 bl 0x0809CD54 ; ? 0809CCA6: BC10 pop {r4} 0809CCA8: BC01 pop {r0} 0809CCAA: 4700 bx r0 ;0809CCAC: 2714 mov r7, #0x14 ;0809CCAE: 0203 lsl r3, r0, #0x8
$0809CDE0 - ?
0809CDE0: B510 push {r4, lr} 0809CDE2: 4809 ldr r0, =#0x02032700 0809CDE4: 4A09 ldr r2, =#0x0000944D 0809CDE6: 1881 add r1, r0, r2 0809CDE8: 7808 ldrb r0, [r1] ; r0 = $0203BB4D 0809CDEA: 07C0 lsl r0, r0, #0x1F 0809CDEC: 2800 cmp r0, #0x00 0809CDEE: D107 bne 0x0809CE00 ; Exit if Bit 0 of $0203BB4D is set 0809CDF0: 1C0C add r4, r1, #0x0 ; r4 = #$0203BB4D 0809CDF2: 2001 mov r0, #0x01 0809CDF4: F000 bl 0809CDF6: F8D4 bl 0x0809CFA0 ; ? 0809CDF8: 7820 ldrb r0, [r4] 0809CDFA: 07C0 lsl r0, r0, #0x1F 0809CDFC: 2800 cmp r0, #0x00 0809CDFE: D0F8 beq 0x0809CDF2 ; Loop if Bit 0 of $0203BB4D is clear 0809CE00: BC10 pop {r4} 0809CE02: BC01 pop {r0} 0809CE04: 4700 bx r0 ;0809CE06: 0000 lsl r0, r0, #0x0 ;0809CE08: 2700 mov r7, #0x00 ;0809CE0A: 0203 lsl r3, r0, #0x8 ;0809CE0C: 944D str r4, [sp, #0x134] ;0809CE0E: 0000 lsl r0, r0, #0x0
$0809CFF4 - (Remove Bit 3 of $020361EA and call a subroutine)
0809CFF4: B500 push {lr} 0809CFF6: 4B06 ldr r3, =#0x02032700 0809CFF8: 4806 ldr r0, =#0x00003AEA 0809CFFA: 181A add r2, r3, r0 0809CFFC: 7811 ldrb r1, [r2] ; r1 = $020361EA 0809CFFE: 2009 mov r0, #0x09 0809D000: 4240 neg r0, r0 ; r0 = #$FFFFFFF7 0809D002: 4008 and r0, r1 ; Remove Bit 3 0809D004: 7010 strb r0, [r2] ; Store back 0809D006: 6858 ldr r0, [r3, #0x04] ; r0 = $02032704 0809D008: F021 bl 0809D00A: FCC6 bl 0x080BE998 ; ? 0809D00C: BC01 pop {r0}
$0809D0AC - Turn Screen off
0809D0AC: 4803 ldr r0, =#0x04000050 0809D0AE: 2100 mov r1, #0x00 0809D0B0: 8001 strh r1, [r0] ; store #$0000 into $04000050/1 : Turn off special effects 0809D0B2: 3002 add r0, #0x02 0809D0B4: 8001 strh r1, [r0] ; store #$0000 into $04000052/3 : Turn off Alpha blending coefficients 0809D0B6: 3002 add r0, #0x02 0809D0B8: 8001 strh r1, [r0] ; store #$0000 into $04000054/5 = Clear Screen Brightness 0809D0BA: 4770 bx lr ;0809D0BC: 0050 lsl r0, r2, #0x1 ;0809D0BE: 0400 lsl r0, r0, #0x10
$0809D0C0 - ?
This Subroutine
- sets up the Random Number Table (I guess...?)
- turns $0203BB4D to #%????.?010
- sets r2 to $0203BB4E's value (and clears Bits: #%????.000?)
- turns $0203BB51 to #%??00.????
- sets r2's Bit 3 according to $020326F0's Bit 16 (aka. $020326F2's Bit 0)
0809D0C0: B5F0 push {r4, r5, r6, r7, lr} 0809D0C2: 4657 mov r7, r10 0809D0C4: 464E mov r6, r9 0809D0C6: 4645 mov r5, r8 0809D0C8: B4E0 push {r5, r6, r7} 0809D0CA: B081 add sp, #-0x004 ; Add new Stack entry 0809D0CC: 4829 ldr r0, =#0x00001105 0809D0CE: F022 bl 0809D0D0: F8D3 bl 0x080BF278 ; (Set up Randum number Table?) 0809D0D2: 4B29 ldr r3, =#0x02032700 0809D0D4: 4829 ldr r0, =#0x0000944D 0809D0D6: 181A add r2, r3, r0 0809D0D8: 7811 ldrb r1, [r2] ; r1 = $0203BB4D 0809D0DA: 2002 mov r0, #0x02 0809D0DC: 4240 neg r0, r0 0809D0DE: 4008 and r0, r1 ; Remove Bit 0 from $0203BB4D 0809D0E0: 2102 mov r1, #0x02 0809D0E2: 4308 orr r0, r1 ; Set Bit 1 in $0203BB4D 0809D0E4: 2105 mov r1, #0x05 0809D0E6: 4249 neg r1, r1 0809D0E8: 4008 and r0, r1 ; Remove Bit 2 from $0203BB4D 0809D0EA: 7010 strb r0, [r2] ; Store value back in $0203BB4D 0809D0EC: 4A24 ldr r2, =#0x0000944E 0809D0EE: 18D2 add r2, r2, r3 0809D0F0: 4691 mov r9, r2 ; r9 = #$0203BB4E 0809D0F2: 7810 ldrb r0, [r2] ; r0 = $0203BB4E 0809D0F4: 2203 mov r2, #0x03 0809D0F6: 4252 neg r2, r2 0809D0F8: 4002 and r2, r0 ; Remove Bit 1 from $0203BB4E 0809D0FA: 400A and r2, r1 ; Remove Bit 2 from $0203BB4E 0809D0FC: 4D21 ldr r5, =#0x00009451 0809D0FE: 195F add r7, r3, r5 0809D100: 7838 ldrb r0, [r7] ; r0 = $0203BB51 0809D102: 2311 mov r3, #0x11 0809D104: 425B neg r3, r3 0809D106: 1C1E add r6, r3, #0x0 0809D108: 4006 and r6, r0 ; Remove Bit 4 from $0203BB51 0809D10A: 2421 mov r4, #0x21 0809D10C: 4264 neg r4, r4 0809D10E: 4026 and r6, r4 ; Remove Bit 5 from $0203BB51 0809D110: 703E strb r6, [r7] ; Store value back in $0203BB51 0809D112: 481D ldr r0, =#0x020326F0 0809D114: 6801 ldr r1, [r0] ; r1 = $020326F0 0809D116: 03C8 lsl r0, r1, #0xF 0809D118: 0FC0 lsr r0, r0, #0x1F ; r1's Bit 0 = $020326F0's Bit 16 0809D11A: 00C0 lsl r0, r0, #0x3 ; r1's Bit 3 = $020326F0's Bit 16 0809D11C: 2509 mov r5, #0x09 0809D11E: 426D neg r5, r5 0809D120: 46A8 mov r8, r5 0809D122: 402A and r2, r5 ; Remove Bit 3 from $0203BB4E 0809D124: 4302 orr r2, r0 ; Add $020326F0's Bit 16 as Bit 3 0809D126: 0388 lsl r0, r1, #0xE 0809D128: 0FC0 lsr r0, r0, #0x1F 0809D12A: 0100 lsl r0, r0, #0x4 0809D12C: 401A and r2, r3 0809D12E: 4302 orr r2, r0 0809D130: 0349 lsl r1, r1, #0xD 0809D132: 2301 mov r3, #0x01 0809D134: 0FC9 lsr r1, r1, #0x1F 0809D136: 0149 lsl r1, r1, #0x5 0809D138: 4022 and r2, r4 0809D13A: 430A orr r2, r1 0809D13C: 2041 mov r0, #0x41 0809D13E: 4240 neg r0, r0 0809D140: 4002 and r2, r0 0809D142: 207F mov r0, #0x7F 0809D144: 4002 and r2, r0 0809D146: 4648 mov r0, r9 0809D148: 7002 strb r2, [r0] 0809D14A: 0711 lsl r1, r2, #0x1C 0809D14C: 0FC9 lsr r1, r1, #0x1F 0809D14E: 06D0 lsl r0, r2, #0x1B 0809D150: 0FC0 lsr r0, r0, #0x1F 0809D152: 4301 orr r1, r0 0809D154: 0952 lsr r2, r2, #0x5 0809D156: 4311 orr r1, r2 0809D158: 2900 cmp r1, #0x00 0809D15A: D106 bne 0x0809D16A 0809D15C: 480B ldr r0, =#0x02029CB0 0809D15E: 307C add r0, #0x7C 0809D160: 7800 ldrb r0, [r0] 0809D162: 0980 lsr r0, r0, #0x6 0809D164: 4018 and r0, r3 0809D166: 2800 cmp r0, #0x00 0809D168: D012 beq 0x0809D190 0809D16A: 2108 mov r1, #0x08 0809D16C: 1C30 add r0, r6, #0x0 0809D16E: 4308 orr r0, r1 0809D170: E011 b 0x0809D196 ;0809D172: 0000 lsl r0, r0, #0x0 ;0809D174: 1105 asr r5, r0, #0x4 ;0809D176: 0000 lsl r0, r0, #0x0 ;0809D178: 2700 mov r7, #0x00 ;0809D17A: 0203 lsl r3, r0, #0x8 ;0809D17C: 944D str r4, [sp, #0x134] ;0809D17E: 0000 lsl r0, r0, #0x0 ;0809D180: 944E str r4, [sp, #0x138] ;0809D182: 0000 lsl r0, r0, #0x0 ;0809D184: 9451 str r4, [sp, #0x144] ;0809D186: 0000 lsl r0, r0, #0x0 ;0809D188: 26F0 mov r6, #0xF0 ;0809D18A: 0203 lsl r3, r0, #0x8 ;0809D18C: 9CB0 ldr r4, [sp, #0x2C0] ;0809D18E: 0202 lsl r2, r0, #0x8 0809D190: 1C30 add r0, r6, #0x0 0809D192: 4641 mov r1, r8 0809D194: 4008 and r0, r1 0809D196: 7038 strb r0, [r7] 0809D198: 4D53 ldr r5, =#0x02032700 0809D19A: 4A54 ldr r2, =#0x0203BB44 0809D19C: 8810 ldrh r0, [r2] 0809D19E: 2000 mov r0, #0x00 0809D1A0: 8010 strh r0, [r2] 0809D1A2: 4B53 ldr r3, =#0x00009446 0809D1A4: 18E9 add r1, r5, r3 0809D1A6: 4853 ldr r0, =#0x0000FFFF 0809D1A8: 8008 strh r0, [r1] 0809D1AA: 4853 ldr r0, =#0x0000944F 0809D1AC: 1829 add r1, r5, r0 0809D1AE: 2303 mov r3, #0x03 0809D1B0: 425B neg r3, r3 0809D1B2: 2405 mov r4, #0x05 0809D1B4: 4264 neg r4, r4 0809D1B6: 2609 mov r6, #0x09 0809D1B8: 4276 neg r6, r6 0809D1BA: 2211 mov r2, #0x11 0809D1BC: 4252 neg r2, r2 0809D1BE: 4691 mov r9, r2 0809D1C0: 2721 mov r7, #0x21 0809D1C2: 427F neg r7, r7 0809D1C4: 2041 mov r0, #0x41 0809D1C6: 4240 neg r0, r0 0809D1C8: 4680 mov r8, r0 0809D1CA: 2000 mov r0, #0x00 0809D1CC: 7008 strb r0, [r1] 0809D1CE: 4A4B ldr r2, =#0x00009450 0809D1D0: 18A9 add r1, r5, r2 0809D1D2: 7008 strb r0, [r1] 0809D1D4: 484A ldr r0, =#0x00009451 0809D1D6: 182A add r2, r5, r0 0809D1D8: 7811 ldrb r1, [r2] 0809D1DA: 2002 mov r0, #0x02 0809D1DC: 4240 neg r0, r0 0809D1DE: 4008 and r0, r1 0809D1E0: 4018 and r0, r3 0809D1E2: 4020 and r0, r4 0809D1E4: 7010 strb r0, [r2] 0809D1E6: 6828 ldr r0, [r5] 0809D1E8: F000 bl 0809D1EA: F8E4 bl 0x0809D3B4 0809D1EC: 6868 ldr r0, [r5, #0x04] 0809D1EE: F000 bl 0809D1F0: F96D bl 0x0809D4CC 0809D1F2: 4944 ldr r1, =#0x00008FD0 0809D1F4: 1868 add r0, r5, r1 0809D1F6: F000 bl 0809D1F8: FAAF bl 0x0809D758 0809D1FA: 1C28 add r0, r5, #0x0 0809D1FC: 3014 add r0, #0x14 0809D1FE: F001 bl 0809D200: F97F bl 0x0809E500 0809D202: 4A41 ldr r2, =#0x00003AEC 0809D204: 18A8 add r0, r5, r2 ; r0 = #$020361EC 0809D206: F001 bl 0809D208: FC17 bl 0x0809EA38 0809D20A: 4B40 ldr r3, =#0x00003F04 0809D20C: 18E8 add r0, r5, r3 0809D20E: 2101 mov r1, #0x01 0809D210: F001 bl 0809D212: FCF8 bl 0x0809EC04 0809D214: F01D bl 0809D216: FA0C bl 0x080BA630 0809D218: 0600 lsl r0, r0, #0x18 0809D21A: 0E00 lsr r0, r0, #0x18 0809D21C: 493C ldr r1, =#0x0000944D 0809D21E: 186C add r4, r5, r1 0809D220: 2201 mov r2, #0x01 0809D222: 4692 mov r10, r2 0809D224: 4653 mov r3, r10 0809D226: 4018 and r0, r3 0809D228: 00C0 lsl r0, r0, #0x3 0809D22A: 7821 ldrb r1, [r4] 0809D22C: 400E and r6, r1 0809D22E: 4306 orr r6, r0 0809D230: 7026 strb r6, [r4] 0809D232: F01D bl 0809D234: FA13 bl 0x080BA65C 0809D236: 0600 lsl r0, r0, #0x18 0809D238: 0E00 lsr r0, r0, #0x18 0809D23A: 4651 mov r1, r10 0809D23C: 4008 and r0, r1 0809D23E: 0100 lsl r0, r0, #0x4 0809D240: 7821 ldrb r1, [r4] 0809D242: 464A mov r2, r9 0809D244: 400A and r2, r1 0809D246: 4302 orr r2, r0 0809D248: 7022 strb r2, [r4] 0809D24A: F01D bl 0809D24C: FA15 bl 0x080BA678 0809D24E: 0600 lsl r0, r0, #0x18 0809D250: 0E00 lsr r0, r0, #0x18 0809D252: 4653 mov r3, r10 0809D254: 4018 and r0, r3 0809D256: 0140 lsl r0, r0, #0x5 0809D258: 7821 ldrb r1, [r4] 0809D25A: 400F and r7, r1 0809D25C: 4307 orr r7, r0 0809D25E: 7027 strb r7, [r4] 0809D260: F01D bl 0809D262: FA18 bl 0x080BA694 0809D264: 0600 lsl r0, r0, #0x18 0809D266: 0E00 lsr r0, r0, #0x18 0809D268: 4651 mov r1, r10 0809D26A: 4008 and r0, r1 0809D26C: 0180 lsl r0, r0, #0x6 0809D26E: 7821 ldrb r1, [r4] 0809D270: 4642 mov r2, r8 0809D272: 400A and r2, r1 0809D274: 4302 orr r2, r0 0809D276: 7022 strb r2, [r4] 0809D278: F01D bl 0809D27A: FA1A bl 0x080BA6B0 0809D27C: 0600 lsl r0, r0, #0x18 0809D27E: 0C40 lsr r0, r0, #0x11 0809D280: 7821 ldrb r1, [r4] 0809D282: 237F mov r3, #0x7F 0809D284: 4019 and r1, r3 0809D286: 4301 orr r1, r0 0809D288: 7021 strb r1, [r4] 0809D28A: 06CA lsl r2, r1, #0x1B 0809D28C: 0FD2 lsr r2, r2, #0x1F 0809D28E: 0688 lsl r0, r1, #0x1A 0809D290: 0FC0 lsr r0, r0, #0x1F 0809D292: 4302 orr r2, r0 0809D294: 0648 lsl r0, r1, #0x19 0809D296: 0FC0 lsr r0, r0, #0x1F 0809D298: 4302 orr r2, r0 0809D29A: 0609 lsl r1, r1, #0x18 0809D29C: 0FC9 lsr r1, r1, #0x1F 0809D29E: 430A orr r2, r1 0809D2A0: 481C ldr r0, =#0x0000944E 0809D2A2: 1829 add r1, r5, r0 0809D2A4: 4653 mov r3, r10 0809D2A6: 401A and r2, r3 0809D2A8: 7808 ldrb r0, [r1] 0809D2AA: 2302 mov r3, #0x02 0809D2AC: 425B neg r3, r3 0809D2AE: 4003 and r3, r0 0809D2B0: 4313 orr r3, r2 0809D2B2: 700B strb r3, [r1] 0809D2B4: 4918 ldr r1, =#0x00003E4C 0809D2B6: 1868 add r0, r5, r1 0809D2B8: F01A bl 0809D2BA: F9C2 bl 0x080B7640 ; ? 0809D2BC: 4A17 ldr r2, =#0x00003E94 0809D2BE: 18A8 add r0, r5, r2 0809D2C0: F020 bl 0809D2C2: FD56 bl 0x080BDD70 ; ? 0809D2C4: 4809 ldr r0, =#0x0203BB44 0809D2C6: F000 bl 0809D2C8: F82B bl 0x0809D320 ; ? 0809D2CA: 68A8 ldr r0, [r5, #0x08] 0809D2CC: F021 bl 0809D2CE: FA2E bl 0x080BE72C ; ? 0809D2D0: 68E8 ldr r0, [r5, #0x0C] 0809D2D2: F021 bl 0809D2D4: FA93 bl 0x080BE7FC ; ? 0809D2D6: B001 add sp, #0x004 0809D2D8: BC38 pop {r3, r4, r5} 0809D2DA: 4698 mov r8, r3 0809D2DC: 46A1 mov r9, r4 0809D2DE: 46AA mov r10, r5 0809D2E0: BCF0 pop {r4, r5, r6, r7} 0809D2E2: BC01 pop {r0} 0809D2E4: 4700 bx r0 ;0809D2E6: 0000 lsl r0, r0, #0x0 ;0809D2E8: 2700 mov r7, #0x00 ;0809D2EA: 0203 lsl r3, r0, #0x8 ;0809D2EC: BB44 pop {r2, r6, pc} ;0809D2EE: 0203 lsl r3, r0, #0x8 ;0809D2F0: 9446 str r4, [sp, #0x118] ;0809D2F2: 0000 lsl r0, r0, #0x0 ;0809D2F4: FFFF bl 0x0809E2F4 ;0809D2F6: 0000 lsl r0, r0, #0x0 ;0809D2F8: 944F str r4, [sp, #0x13C] ;0809D2FA: 0000 lsl r0, r0, #0x0 ;0809D2FC: 9450 str r4, [sp, #0x140] ;0809D2FE: 0000 lsl r0, r0, #0x0 ;0809D300: 9451 str r4, [sp, #0x144] ;0809D302: 0000 lsl r0, r0, #0x0 ;0809D304: 8FD0 ldrh r0, [r2, #0x3E] ;0809D306: 0000 lsl r0, r0, #0x0 ;0809D308: 3AEC sub r2, #0xEC ;0809D30A: 0000 lsl r0, r0, #0x0 ;0809D30C: 3F04 sub r7, #0x04 ;0809D30E: 0000 lsl r0, r0, #0x0 ;0809D310: 944D str r4, [sp, #0x134] ;0809D312: 0000 lsl r0, r0, #0x0 ;0809D314: 944E str r4, [sp, #0x138] ;0809D316: 0000 lsl r0, r0, #0x0 ;0809D318: 3E4C sub r6, #0x4C ;0809D31A: 0000 lsl r0, r0, #0x0 ;0809D31C: 3E94 sub r6, #0x94 ;0809D31E: 0000 lsl r0, r0, #0x0
$0809D4CC - ?
This Subroutine
- clears Orig. r0 + #$1F00 to #$1F03.
- does four Clear DMAs to clear Orig. r0 + #$0000 to #$04AF, #$04B0 to #$095F, #$0960 to #$E0F and #$0E10 to #12BF.
- does a fifth Clear DMA to clear Orig. r0 + #$19C0 to #$1BBF.
0809D4CC: B500 push {lr} 0809D4CE: B081 add sp, #-0x004 0809D4D0: 1C03 add r3, r0, #0x0 ; r3 = Orig. r0 0809D4D2: 21F8 mov r1, #0xF8 0809D4D4: 0149 lsl r1, r1, #0x5 0809D4D6: 1858 add r0, r3, r1 ; r0 = Orig. r0 + #$1F00 0809D4D8: 7801 ldrb r1, [r0] 0809D4DA: 2100 mov r1, #0x00 0809D4DC: 7001 strb r1, [r0] ; Clear Orig. r0 + #$1F00 0809D4DE: 4A3E ldr r2, =#0x00001F01 0809D4E0: 1898 add r0, r3, r2 0809D4E2: 7802 ldrb r2, [r0] 0809D4E4: 7001 strb r1, [r0] ; Clear Orig. r0 + #$1F01 0809D4E6: 4A3D ldr r2, =#0x00001F02 0809D4E8: 1898 add r0, r3, r2 0809D4EA: 7802 ldrb r2, [r0] 0809D4EC: 7001 strb r1, [r0] ; Clear Orig. r0 + #$1F02 0809D4EE: 4A3C ldr r2, =#0x00001F03 0809D4F0: 1898 add r0, r3, r2 0809D4F2: 7802 ldrb r2, [r0] 0809D4F4: 7001 strb r1, [r0] ; Clear Orig. r0 + #$1F03 0809D4F6: 4668 mov r0, sp 0809D4F8: 8001 strh r1, [r0] ; Clear newly added Stack Entry 0809D4FA: 483A ldr r0, =#0x040000D4 0809D4FC: 4669 mov r1, sp 0809D4FE: 6001 str r1, [r0] ; Newly added and cleared Stack Entry is DMA-Source 0809D500: 6043 str r3, [r0, #0x04] ; Original r0 is Destination 0809D502: 4939 ldr r1, =#0x81000258 0809D504: 6081 str r1, [r0, #0x08] ; Start a fixed DMA to clear #$258 Double bytes 0809D506: 6881 ldr r1, [r0, #0x08] 0809D508: 1C02 add r2, r0, #0x0 0809D50A: 6890 ldr r0, [r2, #0x08] 0809D50C: 2180 mov r1, #0x80 0809D50E: 0609 lsl r1, r1, #0x18 0809D510: 2800 cmp r0, #0x00 0809D512: DA03 bge 0x0809D51C 0809D514: 6890 ldr r0, [r2, #0x08] 0809D516: 4008 and r0, r1 0809D518: 2800 cmp r0, #0x00 0809D51A: D1FB bne 0x0809D514 0809D51C: 4669 mov r1, sp 0809D51E: 2000 mov r0, #0x00 0809D520: 8008 strh r0, [r1] ; Clear Stack Entry. Again. 0809D522: 4930 ldr r1, =#0x040000D4 0809D524: 466A mov r2, sp 0809D526: 600A str r2, [r1] 0809D528: 2296 mov r2, #0x96 0809D52A: 00D2 lsl r2, r2, #0x3 ; #$4B0 0809D52C: 1898 add r0, r3, r2 ; r0 = Orig. r0 + #$04B0 (right after the bytes that were cleared with the first DMA) 0809D52E: 6048 str r0, [r1, #0x04] ; Set as clear DMA destination 0809D530: 482D ldr r0, =#0x81000258 0809D532: 6088 str r0, [r1, #0x08] ; Clear another #$258 Double bytes 0809D534: 6888 ldr r0, [r1, #0x08] 0809D536: 6888 ldr r0, [r1, #0x08] 0809D538: 2280 mov r2, #0x80 0809D53A: 0612 lsl r2, r2, #0x18 0809D53C: 2800 cmp r0, #0x00 0809D53E: DA03 bge 0x0809D548 0809D540: 6888 ldr r0, [r1, #0x08] 0809D542: 4010 and r0, r2 0809D544: 2800 cmp r0, #0x00 0809D546: D1FB bne 0x0809D540 0809D548: 4669 mov r1, sp ; Begin 3rd Clear DMA 0809D54A: 2000 mov r0, #0x00 0809D54C: 8008 strh r0, [r1] 0809D54E: 4925 ldr r1, =#0x040000D4 0809D550: 4668 mov r0, sp 0809D552: 6008 str r0, [r1] 0809D554: 2296 mov r2, #0x96 0809D556: 0112 lsl r2, r2, #0x4 0809D558: 1898 add r0, r3, r2 0809D55A: 6048 str r0, [r1, #0x04] 0809D55C: 4822 ldr r0, =#0x81000258 0809D55E: 6088 str r0, [r1, #0x08] 0809D560: 6888 ldr r0, [r1, #0x08] 0809D562: 6888 ldr r0, [r1, #0x08] 0809D564: 2280 mov r2, #0x80 0809D566: 0612 lsl r2, r2, #0x18 0809D568: 2800 cmp r0, #0x00 0809D56A: DA03 bge 0x0809D574 0809D56C: 6888 ldr r0, [r1, #0x08] 0809D56E: 4010 and r0, r2 0809D570: 2800 cmp r0, #0x00 0809D572: D1FB bne 0x0809D56C ; End 3rd Clear DMA 0809D574: 4669 mov r1, sp ; Begin 4th Clear DMA 0809D576: 2000 mov r0, #0x00 0809D578: 8008 strh r0, [r1] 0809D57A: 491A ldr r1, =#0x040000D4 0809D57C: 4668 mov r0, sp 0809D57E: 6008 str r0, [r1] 0809D580: 22E1 mov r2, #0xE1 0809D582: 0112 lsl r2, r2, #0x4 0809D584: 1898 add r0, r3, r2 0809D586: 6048 str r0, [r1, #0x04] 0809D588: 4817 ldr r0, =#0x81000258 0809D58A: 6088 str r0, [r1, #0x08] 0809D58C: 6888 ldr r0, [r1, #0x08] 0809D58E: 6888 ldr r0, [r1, #0x08] 0809D590: 2280 mov r2, #0x80 0809D592: 0612 lsl r2, r2, #0x18 0809D594: 2800 cmp r0, #0x00 0809D596: DA03 bge 0x0809D5A0 0809D598: 6888 ldr r0, [r1, #0x08] 0809D59A: 4010 and r0, r2 0809D59C: 2800 cmp r0, #0x00 0809D59E: D1FB bne 0x0809D598 ; End 4th Clear DMA 0809D5A0: 4669 mov r1, sp ; Begin 5th Clear DMA 0809D5A2: 2000 mov r0, #0x00 0809D5A4: 8008 strh r0, [r1] 0809D5A6: 490F ldr r1, =#0x040000D4 0809D5A8: 4668 mov r0, sp 0809D5AA: 6008 str r0, [r1] 0809D5AC: 22CE mov r2, #0xCE 0809D5AE: 0152 lsl r2, r2, #0x5 0809D5B0: 1898 add r0, r3, r2 0809D5B2: 6048 str r0, [r1, #0x04] 0809D5B4: 480D ldr r0, =#0x81000200 0809D5B6: 6088 str r0, [r1, #0x08] 0809D5B8: 6888 ldr r0, [r1, #0x08] 0809D5BA: 6888 ldr r0, [r1, #0x08] 0809D5BC: 2280 mov r2, #0x80 0809D5BE: 0612 lsl r2, r2, #0x18 0809D5C0: 2800 cmp r0, #0x00 0809D5C2: DA03 bge 0x0809D5CC 0809D5C4: 6888 ldr r0, [r1, #0x08] 0809D5C6: 4010 and r0, r2 0809D5C8: 2800 cmp r0, #0x00 0809D5CA: D1FB bne 0x0809D5C4 ; End 5th Clear DMA 0809D5CC: 1C18 add r0, r3, #0x0 ; Restore Original r0 in r0 0809D5CE: F000 bl 0809D5D0: F80F bl 0x0809D5F0 ; ? 0809D5D2: B001 add sp, #0x004 ; Restore, exit 0809D5D4: BC01 pop {r0} 0809D5D6: 4700 bx r0 ;0809D5D8: 1F01 sub r1, r0, #0x4 ;0809D5DA: 0000 lsl r0, r0, #0x0 ;0809D5DC: 1F02 sub r2, r0, #0x4 ;0809D5DE: 0000 lsl r0, r0, #0x0 ;0809D5E0: 1F03 sub r3, r0, #0x4 ;0809D5E2: 0000 lsl r0, r0, #0x0 ;0809D5E4: 00D4 lsl r4, r2, #0x3 ;0809D5E6: 0400 lsl r0, r0, #0x10 ;0809D5E8: 0258 lsl r0, r3, #0x9 ;0809D5EA: 8100 strh r0, [r0, #0x08] ;0809D5EC: 0200 lsl r0, r0, #0x8 ;0809D5EE: 8100 strh r0, [r0, #0x08]
$0809D5F0 - ?
r0 contains an address
0809D5F0: B510 push {r4, lr} 0809D5F2: 490E ldr r1, =#0x00001F08 0809D5F4: 1844 add r4, r0, r1 0809D5F6: 7821 ldrb r1, [r4] 0809D5F8: 2104 mov r1, #0x04 0809D5FA: 7021 strb r1, [r4] ; Store #$04 in Orig. r0 + #1F08 0809D5FC: 4B0C ldr r3, =#0x00001F09 0809D5FE: 18C2 add r2, r0, r3 0809D600: 7813 ldrb r3, [r2] 0809D602: 7011 strb r1, [r2] ; Store #$04 in Orig. r0 + #1F09 0809D604: 490B ldr r1, =#0x00001F0A 0809D606: 1843 add r3, r0, r1 0809D608: 7819 ldrb r1, [r3] 0809D60A: 2118 mov r1, #0x18 0809D60C: 7019 strb r1, [r3] ; Store #$18 in Orig. r0 + #1F0A 0809D60E: 7821 ldrb r1, [r4] 0809D610: 7812 ldrb r2, [r2] 0809D612: 0152 lsl r2, r2, #0x5 0809D614: 430A orr r2, r1 ; r2 = #$84 0809D616: 7819 ldrb r1, [r3] 0809D618: 0289 lsl r1, r1, #0xA ; r1 = #$6000 0809D61A: 430A orr r2, r1 ; r2 = #$6084 0809D61C: 23CE mov r3, #0xCE 0809D61E: 015B lsl r3, r3, #0x5 ; r3 = #$19C0 0809D620: 18C0 add r0, r0, r3 ; r0 = Orig. r0 + #$19C0 0809D622: 8801 ldrh r1, [r0] 0809D624: 8002 strh r2, [r0] ; Store #$6084 in Orig. r0 + #$19C0 0809D626: BC10 pop {r4} 0809D628: BC01 pop {r0} 0809D62A: 4700 bx r0 ;0809D62C: 1F08 sub r0, r1, #0x4 ;0809D62E: 0000 lsl r0, r0, #0x0 ;0809D630: 1F09 sub r1, r1, #0x4 ;0809D632: 0000 lsl r0, r0, #0x0 ;0809D634: 1F0A sub r2, r1, #0x4 ;0809D636: 0000 lsl r0, r0, #0x0
$0809D694 - ?
0809D694: B5F0 push {r4, r5, r6, r7, lr} 0809D696: 464F mov r7, r9 0809D698: 4646 mov r6, r8 0809D69A: B4C0 push {r6, r7} 0809D69C: B082 add sp, #-0x008 0809D69E: 2418 mov r4, #0x18 0809D6A0: 4B2A ldr r3, =#0xFFFFFF00 0809D6A2: 9900 ldr r1, [sp] ; Load newly added Stack entry 0809D6A4: 4019 and r1, r3 ; Remove lowest byte 0809D6A6: 4321 orr r1, r4 ; Set lowest byte to #$18 0809D6A8: 9100 str r1, [sp] ; Store back 0809D6AA: 466A mov r2, sp 0809D6AC: 2116 mov r1, #0x16 0809D6AE: 7051 strb r1, [r2, #0x01] 0809D6B0: 211F mov r1, #0x1F 0809D6B2: 7091 strb r1, [r2, #0x02] ; So the three last Stack bytes are $18 $16 $1F now. 0809D6B4: 2204 mov r2, #0x04 0809D6B6: 9901 ldr r1, [sp, #0x004] ; Load second newly added Stack entry 0809D6B8: 4019 and r1, r3 ; Remove lowest byte 0809D6BA: 4311 orr r1, r2 ; Set lowest byte to #$04 0809D6BC: 9101 str r1, [sp, #0x004] ; Store back 0809D6BE: A901 add r1, sp, #0x004 0809D6C0: 704A strb r2, [r1, #0x01] 0809D6C2: 708C strb r4, [r1, #0x02] ; So Stack bytes 4 to 6 are $04 $04 $18 now 0809D6C4: 22EE mov r2, #0xEE 0809D6C6: 0152 lsl r2, r2, #0x5 ; r2 = #$01DC 0809D6C8: 1887 add r7, r0, r2 0809D6CA: 2400 mov r4, #0x00 0809D6CC: 4689 mov r9, r1 0809D6CE: 466E mov r6, sp 0809D6D0: 46C8 mov r8, r9 0809D6D2: 7830 ldrb r0, [r6] ; (Start of a loop) 0809D6D4: 464A mov r2, r9 0809D6D6: 7811 ldrb r1, [r2] 0809D6D8: 1C22 add r2, r4, #0x0 0809D6DA: 23A0 mov r3, #0xA0 0809D6DC: F020 bl 0809D6DE: FFF2 bl 0x080BE6C4 0809D6E0: 0600 lsl r0, r0, #0x18 0809D6E2: 0E00 lsr r0, r0, #0x18 0809D6E4: 4919 ldr r1, =#0xFFFFFF00 0809D6E6: 400D and r5, r1 0809D6E8: 4305 orr r5, r0 0809D6EA: 7870 ldrb r0, [r6, #0x01] 0809D6EC: 4642 mov r2, r8 0809D6EE: 7851 ldrb r1, [r2, #0x01] 0809D6F0: 1C22 add r2, r4, #0x0 0809D6F2: 23A0 mov r3, #0xA0 0809D6F4: F020 bl 0809D6F6: FFE6 bl 0x080BE6C4 0809D6F8: 0600 lsl r0, r0, #0x18 0809D6FA: 0C00 lsr r0, r0, #0x10 0809D6FC: 4914 ldr r1, =#0xFFFF00FF 0809D6FE: 400D and r5, r1 0809D700: 4305 orr r5, r0 0809D702: 78B0 ldrb r0, [r6, #0x02] 0809D704: 4642 mov r2, r8 0809D706: 7891 ldrb r1, [r2, #0x02] 0809D708: 1C22 add r2, r4, #0x0 0809D70A: 23A0 mov r3, #0xA0 0809D70C: F020 bl 0809D70E: FFDA bl 0x080BE6C4 0809D710: 0600 lsl r0, r0, #0x18 0809D712: 0A00 lsr r0, r0, #0x8 0809D714: 490F ldr r1, =#0xFF00FFFF 0809D716: 400D and r5, r1 0809D718: 4305 orr r5, r0 0809D71A: 0629 lsl r1, r5, #0x18 0809D71C: 0E09 lsr r1, r1, #0x18 0809D71E: 0A28 lsr r0, r5, #0x8 0809D720: 0600 lsl r0, r0, #0x18 0809D722: 0CC0 lsr r0, r0, #0x13 0809D724: 4301 orr r1, r0 0809D726: 0C28 lsr r0, r5, #0x10 0809D728: 0600 lsl r0, r0, #0x18 0809D72A: 0B80 lsr r0, r0, #0xE 0809D72C: 4301 orr r1, r0 0809D72E: 8039 strh r1, [r7] 0809D730: 1C60 add r0, r4, #0x1 ; Increment Loop Counter 0809D732: 0400 lsl r0, r0, #0x10 0809D734: 0C04 lsr r4, r0, #0x10 0809D736: 3702 add r7, #0x02 0809D738: 2C9F cmp r4, #0x9F ; Loop until r4 = #$A0 0809D73A: D9CA bls 0x0809D6D2 0809D73C: B002 add sp, #0x008 0809D73E: BC18 pop {r3, r4} 0809D740: 4698 mov r8, r3 0809D742: 46A1 mov r9, r4 0809D744: BCF0 pop {r4, r5, r6, r7} 0809D746: BC01 pop {r0} 0809D748: 4700 bx r0 ;0809D74A: 0000 lsl r0, r0, #0x0 ;0809D74C: FF00 bl 0x0809E54E ;0809D74E: FFFF bl 0x07F9E74E ;0809D750: 00FF lsl r7, r7, #0x3 ;0809D752: FFFF bl 0x0819D752 ;0809D754: FFFF bl 0x0809D754 ;0809D756: FF00 bl 0x0809D558
$0809D880 - ?
r0 contains an address, some sort of base address for various store commands
r1 Byte-sized value
0809D880: B5F0 push {r4, r5, r6, r7, lr} 0809D882: 4647 mov r7, r8 0809D884: B480 push {r7} 0809D886: B083 add sp, #-0x00C ; Add twelve (3x4) bytes to stack 0809D888: 1C03 add r3, r0, #0x0 ; r3 = r0 0809D88A: 4668 mov r0, sp 0809D88C: 7001 strb r1, [r0] ; Store r1 on stack 0809D88E: 482B ldr r0, =#0x0000046E 0809D890: 1819 add r1, r3, r0 0809D892: 2000 mov r0, #0x00 0809D894: 8008 strh r0, [r1] ; Orig. r0 + #$046E = #$0000 0809D896: 2600 mov r6, #0x00 0809D898: 4929 ldr r1, =#0x00000466 0809D89A: 185A add r2, r3, r1 ; r2 = Orig. r0 + #$0466 0809D89C: 4D29 ldr r5, =#0x0202D7A0 0809D89E: 2400 mov r4, #0x00 0809D8A0: 1991 add r1, r2, r6 ; r1 = Orig. r0 + #$0466 + Loop Counter 0809D8A2: 0070 lsl r0, r6, #0x1 0809D8A4: 1940 add r0, r0, r5 ; r0 = #$0202D7A0 + Loop Counter * 2 0809D8A6: 8800 ldrh r0, [r0] 0809D8A8: 7008 strb r0, [r1] ; NOTE: Load Double-Byte, store Single Byte(!?!) 0809D8AA: 00B0 lsl r0, r6, #0x2 0809D8AC: 1818 add r0, r3, r0 ; r0 = Orig. r0 + Loop Counter * 4 0809D8AE: 6004 str r4, [r0] ; Clear (Orig. r0 + Loop Counter * 4) 0809D8B0: 1C70 add r0, r6, #0x1 ; Inc r6 0809D8B2: 0400 lsl r0, r0, #0x10 0809D8B4: 0C06 lsr r6, r0, #0x10 ; r6 AND #$0000FFFF 0809D8B6: 2E05 cmp r6, #0x05 0809D8B8: D9F2 bls 0x0809D8A0 ; Loop until r6 = #$06 0809D8BA: 1C1F add r7, r3, #0x0 ; r7 = Orig. r0 0809D8BC: 4668 mov r0, sp 0809D8BE: 7800 ldrb r0, [r0] ; r0 = Orig. r1 0809D8C0: 2800 cmp r0, #0x00 0809D8C2: D100 bne 0x0809D8C6 ; Branch if Orig. r1 <> r0 0809D8C4: E08A b 0x0809D9DC 0809D8C6: 2600 mov r6, #0x00 ; Set up Loop counter 0809D8C8: 491D ldr r1, =#0x00000466 0809D8CA: 1858 add r0, r3, r1 ; r0 = Orig. r0 + #$0466 0809D8CC: 1980 add r0, r0, r6 ; r0 = Orig. r0 + #$0466 + #$00 (?!?!) 0809D8CE: 7804 ldrb r4, [r0] 0809D8D0: 1C20 add r0, r4, #0x0 ; Value for upcoming subroutine 0809D8D2: 9302 str r3, [sp, #0x008] ; Buffer r3 on stack (The subroutine doesn't use r3, no need?!?) 0809D8D4: F01F bl 0809D8D6: FD54 bl 0x080BD380 ; (Transforms the value in r0 into an address around #$02029F50) 0809D8D8: 6038 str r0, [r7] ; Store the result address from the subroutine in Orig. r0 0809D8DA: 9B02 ldr r3, [sp, #0x008] ; Restore r3 ; From here the code is the same whether of the content of Orig. r1 0809D8DC: 2C00 cmp r4, #0x00 0809D8DE: D004 beq 0x0809D8EA 0809D8E0: 7800 ldrb r0, [r0] ; Load from r0 (Subroutine result) 0809D8E2: 0680 lsl r0, r0, #0x1A 0809D8E4: 0E80 lsr r0, r0, #0x1A ; Remove everything but the six MSBs 0809D8E6: 2801 cmp r0, #0x01 0809D8E8: D970 bls 0x0809D9CC ; Loop (without the incrementing part) back if they are > #$02 0809D8EA: 1C70 add r0, r6, #0x1 ; Inc Loop Counter 0809D8EC: 0400 lsl r0, r0, #0x10 ; r6 AND #$0000FFFF 0809D8EE: 0C06 lsr r6, r0, #0x10 0809D8F0: 2E05 cmp r6, #0x05 0809D8F2: D9E9 bls 0x0809D8C8 ; Loop until r6 > #$05 0809D8F4: 2603 mov r6, #0x03 0809D8F6: 4911 ldr r1, =#0x0000046E 0809D8F8: 1858 add r0, r3, r1 0809D8FA: 8800 ldrh r0, [r0] 0809D8FC: 2805 cmp r0, #0x05 0809D8FE: D830 bhi 0x0809D962 0809D900: 185A add r2, r3, r1 0809D902: 2500 mov r5, #0x00 0809D904: 1C70 add r0, r6, #0x1 0809D906: 4680 mov r8, r0 0809D908: 490D ldr r1, =#0x00000466 0809D90A: 1858 add r0, r3, r1 0809D90C: 1940 add r0, r0, r5 0809D90E: 7804 ldrb r4, [r0] 0809D910: 1C20 add r0, r4, #0x0 0809D912: 9201 str r2, [sp, #0x004] 0809D914: 9302 str r3, [sp, #0x008] 0809D916: F01F bl 0809D918: FD33 bl 0x080BD380 0809D91A: 6038 str r0, [r7] 0809D91C: 9A01 ldr r2, [sp, #0x004] 0809D91E: 9B02 ldr r3, [sp, #0x008] 0809D920: 2C00 cmp r4, #0x00 0809D922: D011 beq 0x0809D948 0809D924: 7800 ldrb r0, [r0] 0809D926: 0680 lsl r0, r0, #0x1A 0809D928: 0E80 lsr r0, r0, #0x1A 0809D92A: 1E71 sub r1, r6, #0x1 0809D92C: 4288 cmp r0, r1 0809D92E: D10B bne 0x0809D948 0809D930: 8810 ldrh r0, [r2] 0809D932: 3001 add r0, #0x01 0809D934: 8010 strh r0, [r2] 0809D936: 3704 add r7, #0x04 0809D938: E00B b 0x0809D952 ;0809D93A: 0000 lsl r0, r0, #0x0 ;0809D93C: 046E lsl r6, r5, #0x11 ;0809D93E: 0000 lsl r0, r0, #0x0 ;0809D940: 0466 lsl r6, r4, #0x11 ;0809D942: 0000 lsl r0, r0, #0x0 ;0809D944: D7A0 bvc 0x0809D888 ;0809D946: 0202 lsl r2, r0, #0x8 0809D948: 1C68 add r0, r5, #0x1 0809D94A: 0400 lsl r0, r0, #0x10 0809D94C: 0C05 lsr r5, r0, #0x10 0809D94E: 2D05 cmp r5, #0x05 0809D950: D9DA bls 0x0809D908 0809D952: 4641 mov r1, r8 0809D954: 0408 lsl r0, r1, #0x10 0809D956: 0C06 lsr r6, r0, #0x10 0809D958: 2E11 cmp r6, #0x11 0809D95A: D802 bhi 0x0809D962 0809D95C: 8810 ldrh r0, [r2] 0809D95E: 2805 cmp r0, #0x05 0809D960: D9CF bls 0x0809D902 0809D962: 2612 mov r6, #0x12 0809D964: 4910 ldr r1, =#0x0000046E 0809D966: 1858 add r0, r3, r1 0809D968: 8800 ldrh r0, [r0] 0809D96A: 2805 cmp r0, #0x05 0809D96C: D84E bhi 0x0809DA0C 0809D96E: 185A add r2, r3, r1 0809D970: 2500 mov r5, #0x00 0809D972: 1C70 add r0, r6, #0x1 0809D974: 4680 mov r8, r0 0809D976: 490D ldr r1, =#0x00000466 0809D978: 1858 add r0, r3, r1 0809D97A: 1940 add r0, r0, r5 0809D97C: 7804 ldrb r4, [r0] 0809D97E: 1C20 add r0, r4, #0x0 0809D980: 9201 str r2, [sp, #0x004] 0809D982: 9302 str r3, [sp, #0x008] 0809D984: F01F bl 0809D986: FCFC bl 0x080BD380 0809D988: 6038 str r0, [r7] 0809D98A: 9A01 ldr r2, [sp, #0x004] 0809D98C: 9B02 ldr r3, [sp, #0x008] 0809D98E: 2C00 cmp r4, #0x00 0809D990: D00E beq 0x0809D9B0 0809D992: 7800 ldrb r0, [r0] 0809D994: 0680 lsl r0, r0, #0x1A 0809D996: 0E80 lsr r0, r0, #0x1A 0809D998: 1E71 sub r1, r6, #0x1 0809D99A: 4288 cmp r0, r1 0809D99C: D108 bne 0x0809D9B0 0809D99E: 8810 ldrh r0, [r2] 0809D9A0: 3001 add r0, #0x01 0809D9A2: 8010 strh r0, [r2] 0809D9A4: 3704 add r7, #0x04 0809D9A6: E008 b 0x0809D9BA ;0809D9A8: 046E lsl r6, r5, #0x11 ;0809D9AA: 0000 lsl r0, r0, #0x0 ;0809D9AC: 0466 lsl r6, r4, #0x11 ;0809D9AE: 0000 lsl r0, r0, #0x0 0809D9B0: 1C68 add r0, r5, #0x1 0809D9B2: 0400 lsl r0, r0, #0x10 0809D9B4: 0C05 lsr r5, r0, #0x10 0809D9B6: 2D05 cmp r5, #0x05 0809D9B8: D9DD bls 0x0809D976 0809D9BA: 4641 mov r1, r8 0809D9BC: 0408 lsl r0, r1, #0x10 0809D9BE: 0C06 lsr r6, r0, #0x10 0809D9C0: 2E25 cmp r6, #0x25 0809D9C2: D823 bhi 0x0809DA0C 0809D9C4: 8810 ldrh r0, [r2] 0809D9C6: 2805 cmp r0, #0x05 0809D9C8: D9D2 bls 0x0809D970 0809D9CA: E01F b 0x0809DA0C 0809D9CC: 4802 ldr r0, =#0x0000046E 0809D9CE: 1819 add r1, r3, r0 0809D9D0: 2001 mov r0, #0x01 0809D9D2: 8008 strh r0, [r1] 0809D9D4: 3704 add r7, #0x04 0809D9D6: E78D b 0x0809D8F4 ;0809D9D8: 046E lsl r6, r5, #0x11 ;0809D9DA: 0000 lsl r0, r0, #0x0 0809D9DC: 2600 mov r6, #0x00 0809D9DE: 490E ldr r1, =#0x0000046E 0809D9E0: 187D add r5, r7, r1 0809D9E2: 490E ldr r1, =#0x00000466 0809D9E4: 1858 add r0, r3, r1 0809D9E6: 1980 add r0, r0, r6 0809D9E8: 7804 ldrb r4, [r0] 0809D9EA: 1C20 add r0, r4, #0x0 0809D9EC: 9302 str r3, [sp, #0x008] 0809D9EE: F01F bl 0809D9F0: FCC7 bl 0x080BD380 0809D9F2: 6038 str r0, [r7] 0809D9F4: 9B02 ldr r3, [sp, #0x008] 0809D9F6: 2C00 cmp r4, #0x00 0809D9F8: D003 beq 0x0809DA02 0809D9FA: 8828 ldrh r0, [r5] 0809D9FC: 3001 add r0, #0x01 0809D9FE: 8028 strh r0, [r5] 0809DA00: 3704 add r7, #0x04 0809DA02: 1C70 add r0, r6, #0x1 0809DA04: 0400 lsl r0, r0, #0x10 0809DA06: 0C06 lsr r6, r0, #0x10 0809DA08: 2E05 cmp r6, #0x05 0809DA0A: D9EA bls 0x0809D9E2 0809DA0C: B003 add sp, #0x00C 0809DA0E: BC08 pop {r3} 0809DA10: 4698 mov r8, r3 0809DA12: BCF0 pop {r4, r5, r6, r7} 0809DA14: BC01 pop {r0} 0809DA16: 4700 bx r0 ;0809DA18: 046E lsl r6, r5, #0x11 ;0809DA1A: 0000 lsl r0, r0, #0x0 ;0809DA1C: 0466 lsl r6, r4, #0x11 ;0809DA1E: 0000 lsl r0, r0, #0x0
$0809DA20 - ?
This is called from $0809D758
0809DA20: B530 push {r4, r5, lr} 0809DA22: 1C04 add r4, r0, #0x0 ; r4 = Orig. r0 0809DA24: 1C15 add r5, r2, #0x0 ; r5 = Orig. r2 0809DA26: F000 bl 0809DA28: F80B bl 0x0809DA40 ; ? 0809DA2A: 1C20 add r0, r4, #0x0 ; r0 = Orig. r0 0809DA2C: F000 bl 0809DA2E: F96E bl 0x0809DD0C ; ? 0809DA30: 1C20 add r0, r4, #0x0 ; r0 = Orig. r0 0809DA32: 1C29 add r1, r5, #0x0 ; r1 = Orig. r2 0809DA34: F000 bl 0809DA36: F9D2 bl 0x0809DDDC ; ? 0809DA38: BC30 pop {r4, r5} 0809DA3A: BC01 pop {r0} 0809DA3C: 4700 bx r0 ;0809DA3E: 0000 lsl r0, r0, #0x0
$0809DA40 - ?
0809DA40: B5F0 push {r4, r5, r6, r7, lr} 0809DA42: 4657 mov r7, r10 0809DA44: 464E mov r6, r9 0809DA46: 4645 mov r5, r8 0809DA48: B4E0 push {r5, r6, r7} 0809DA4A: B082 add sp, #-0x008 0809DA4C: 1C05 add r5, r0, #0x0 0809DA4E: 8AA9 ldrh r1, [r5, #0x14] 0809DA50: 4A34 ldr r2, =#0xFFFFE01F 0809DA52: 1C10 add r0, r2, #0x0 0809DA54: 4008 and r0, r1 0809DA56: 82A8 strh r0, [r5, #0x14] 0809DA58: 8AE9 ldrh r1, [r5, #0x16] 0809DA5A: 1C10 add r0, r2, #0x0 0809DA5C: 4008 and r0, r1 0809DA5E: 82E8 strh r0, [r5, #0x16] 0809DA60: 7DE9 ldrb r1, [r5, #0x17] 0809DA62: 231F mov r3, #0x1F 0809DA64: 1C18 add r0, r3, #0x0 0809DA66: 4008 and r0, r1 0809DA68: 75E8 strb r0, [r5, #0x17] 0809DA6A: 7E29 ldrb r1, [r5, #0x18] 0809DA6C: 2420 mov r4, #0x20 0809DA6E: 4264 neg r4, r4 0809DA70: 1C20 add r0, r4, #0x0 0809DA72: 4008 and r0, r1 0809DA74: 7628 strb r0, [r5, #0x18] 0809DA76: 6968 ldr r0, [r5, #0x14] 0809DA78: 492B ldr r1, =#0xFFE01FFF 0809DA7A: 4008 and r0, r1 0809DA7C: 6168 str r0, [r5, #0x14] 0809DA7E: 89E9 ldrh r1, [r5, #0x0E] 0809DA80: 482A ldr r0, =#0xFFFFE03F 0809DA82: 4008 and r0, r1 0809DA84: 81E8 strh r0, [r5, #0x0E] 0809DA86: 7868 ldrb r0, [r5, #0x01] 0809DA88: 09C0 lsr r0, r0, #0x7 0809DA8A: 2800 cmp r0, #0x00 0809DA8C: D05A beq 0x0809DB44 0809DA8E: 78E8 ldrb r0, [r5, #0x03] 0809DA90: 0640 lsl r0, r0, #0x19 0809DA92: 2800 cmp r0, #0x00 0809DA94: D000 beq 0x0809DA98 0809DA96: E125 b 0x0809DCE4 0809DA98: 7BE9 ldrb r1, [r5, #0x0F] 0809DA9A: 1C18 add r0, r3, #0x0 0809DA9C: 4008 and r0, r1 0809DA9E: 2120 mov r1, #0x20 0809DAA0: 4308 orr r0, r1 0809DAA2: 73E8 strb r0, [r5, #0x0F] 0809DAA4: 7C29 ldrb r1, [r5, #0x10] 0809DAA6: 2080 mov r0, #0x80 0809DAA8: 4240 neg r0, r0 0809DAAA: 4008 and r0, r1 0809DAAC: 7428 strb r0, [r5, #0x10] 0809DAAE: 8A69 ldrh r1, [r5, #0x12] 0809DAB0: 481F ldr r0, =#0xFFFFF801 0809DAB2: 4008 and r0, r1 0809DAB4: 2302 mov r3, #0x02 0809DAB6: 4318 orr r0, r3 0809DAB8: 8268 strh r0, [r5, #0x12] 0809DABA: 7CE9 ldrb r1, [r5, #0x13] 0809DABC: 2207 mov r2, #0x07 0809DABE: 1C10 add r0, r2, #0x0 0809DAC0: 4008 and r0, r1 0809DAC2: 2108 mov r1, #0x08 0809DAC4: 4308 orr r0, r1 0809DAC6: 74E8 strb r0, [r5, #0x13] 0809DAC8: 7D29 ldrb r1, [r5, #0x14] 0809DACA: 1C20 add r0, r4, #0x0 0809DACC: 4008 and r0, r1 0809DACE: 7528 strb r0, [r5, #0x14] 0809DAD0: 6928 ldr r0, [r5, #0x10] 0809DAD2: 4918 ldr r1, =#0xFFFE007F 0809DAD4: 4008 and r0, r1 0809DAD6: 2180 mov r1, #0x80 0809DAD8: 4308 orr r0, r1 0809DADA: 6128 str r0, [r5, #0x10] 0809DADC: 68A8 ldr r0, [r5, #0x08] 0809DADE: 4916 ldr r1, =#0xFFF8001F 0809DAE0: 4008 and r0, r1 0809DAE2: 2120 mov r1, #0x20 0809DAE4: 4308 orr r0, r1 0809DAE6: 60A8 str r0, [r5, #0x08] 0809DAE8: 88E9 ldrh r1, [r5, #0x06] 0809DAEA: 207F mov r0, #0x7F 0809DAEC: 4008 and r0, r1 0809DAEE: 2180 mov r1, #0x80 0809DAF0: 4308 orr r0, r1 0809DAF2: 80E8 strh r0, [r5, #0x06] 0809DAF4: 7A29 ldrb r1, [r5, #0x08] 0809DAF6: 1C20 add r0, r4, #0x0 0809DAF8: 4008 and r0, r1 0809DAFA: 7228 strb r0, [r5, #0x08] 0809DAFC: 89A9 ldrh r1, [r5, #0x0C] 0809DAFE: 480F ldr r0, =#0xFFFF8001 0809DB00: 4008 and r0, r1 0809DB02: 4318 orr r0, r3 0809DB04: 81A8 strh r0, [r5, #0x0C] 0809DB06: 8968 ldrh r0, [r5, #0x0A] 0809DB08: 4002 and r2, r0 0809DB0A: 2008 mov r0, #0x08 0809DB0C: 4302 orr r2, r0 0809DB0E: 816A strh r2, [r5, #0x0A] 0809DB10: 7B29 ldrb r1, [r5, #0x0C] 0809DB12: 2002 mov r0, #0x02 0809DB14: 4240 neg r0, r0 0809DB16: 4008 and r0, r1 0809DB18: 7328 strb r0, [r5, #0x0C] 0809DB1A: 68E8 ldr r0, [r5, #0x0C] 0809DB1C: 4908 ldr r1, =#0xFFC07FFF 0809DB1E: 4008 and r0, r1 0809DB20: 60E8 str r0, [r5, #0x0C] 0809DB22: E0DF b 0x0809DCE4 ;0809DB24: E01F b 0x0809DB66 ;0809DB26: FFFF bl 0x080BDB26 ;0809DB28: 1FFF sub r7, r7, #0x7 ;0809DB2A: FFE0 bl 0x0809DAEC ;0809DB2C: E03F b 0x0809DBAE ;0809DB2E: FFFF bl 0x080DDB2E ;0809DB30: F801 bl 0x0809CB34 ;0809DB32: FFFF bl 0x0809FB32 ;0809DB34: 007F lsl r7, r7, #0x1 ;0809DB36: FFFE bl 0x0811DB34 ;0809DB38: 001F lsl r7, r3, #0x0 ;0809DB3A: FFF8 bl 0x080BDB2C ;0809DB3C: 8001 strh r1, [r0] ;0809DB3E: FFFF bl 0x0809FB3E ;0809DB40: 7FFF ldrb r7, [r7, #0x1F] ;0809DB42: FFC0 bl 0x0809DAC4 0809DB44: 2000 mov r0, #0x00 0809DB46: 4681 mov r9, r0 0809DB48: 1C29 add r1, r5, #0x0 0809DB4A: 3120 add r1, #0x20 0809DB4C: 9100 str r1, [sp] 0809DB4E: 6A2C ldr r4, [r5, #0x20] 0809DB50: 9401 str r4, [sp, #0x004] 0809DB52: 4E68 ldr r6, =#0x080FF4A8 0809DB54: 46B4 mov r12, r6 0809DB56: 201F mov r0, #0x1F 0809DB58: 4680 mov r8, r0 0809DB5A: 8AAA ldrh r2, [r5, #0x14] 0809DB5C: 04D1 lsl r1, r2, #0x13 0809DB5E: 0E09 lsr r1, r1, #0x18 0809DB60: 464C mov r4, r9 0809DB62: 0063 lsl r3, r4, #0x1 0809DB64: 9E00 ldr r6, [sp] 0809DB66: 18F3 add r3, r6, r3 0809DB68: 2400 mov r4, #0x00 0809DB6A: 5F18 ldsh r0, [r3, r4] 0809DB6C: 00C0 lsl r0, r0, #0x3 0809DB6E: 4460 add r0, r12 0809DB70: 8800 ldrh r0, [r0] 0809DB72: 04C0 lsl r0, r0, #0x13 0809DB74: 0E00 lsr r0, r0, #0x18 0809DB76: 1809 add r1, r1, r0 0809DB78: 26FF mov r6, #0xFF 0809DB7A: 4031 and r1, r6 0809DB7C: 0149 lsl r1, r1, #0x5 0809DB7E: 485E ldr r0, =#0xFFFFE01F 0809DB80: 4010 and r0, r2 0809DB82: 4308 orr r0, r1 0809DB84: 82A8 strh r0, [r5, #0x14] 0809DB86: 8AEA ldrh r2, [r5, #0x16] 0809DB88: 04D1 lsl r1, r2, #0x13 0809DB8A: 0E09 lsr r1, r1, #0x18 0809DB8C: 2400 mov r4, #0x00 0809DB8E: 5F18 ldsh r0, [r3, r4] 0809DB90: 00C0 lsl r0, r0, #0x3 0809DB92: 4460 add r0, r12 0809DB94: 6800 ldr r0, [r0] 0809DB96: 02C0 lsl r0, r0, #0xB 0809DB98: 0E00 lsr r0, r0, #0x18 0809DB9A: 1809 add r1, r1, r0 0809DB9C: 4031 and r1, r6 0809DB9E: 0149 lsl r1, r1, #0x5 0809DBA0: 4855 ldr r0, =#0xFFFFE01F 0809DBA2: 4010 and r0, r2 0809DBA4: 4308 orr r0, r1 0809DBA6: 82E8 strh r0, [r5, #0x16] 0809DBA8: 7DEC ldrb r4, [r5, #0x17] 0809DBAA: 0960 lsr r0, r4, #0x5 0809DBAC: 7E2A ldrb r2, [r5, #0x18] 0809DBAE: 4646 mov r6, r8 0809DBB0: 4032 and r2, r6 0809DBB2: 00D2 lsl r2, r2, #0x3 0809DBB4: 4302 orr r2, r0 0809DBB6: 2100 mov r1, #0x00 0809DBB8: 5E58 ldsh r0, [r3, r1] 0809DBBA: 00C0 lsl r0, r0, #0x3 0809DBBC: 4460 add r0, r12 0809DBBE: 8840 ldrh r0, [r0, #0x02] 0809DBC0: 04C0 lsl r0, r0, #0x13 0809DBC2: 0E00 lsr r0, r0, #0x18 0809DBC4: 1812 add r2, r2, r0 0809DBC6: 1C11 add r1, r2, #0x0 0809DBC8: 2607 mov r6, #0x07 0809DBCA: 4031 and r1, r6 0809DBCC: 0149 lsl r1, r1, #0x5 0809DBCE: 4640 mov r0, r8 0809DBD0: 4020 and r0, r4 0809DBD2: 4308 orr r0, r1 0809DBD4: 75E8 strb r0, [r5, #0x17] 0809DBD6: 08D2 lsr r2, r2, #0x3 0809DBD8: 4640 mov r0, r8 0809DBDA: 4002 and r2, r0 0809DBDC: 7E28 ldrb r0, [r5, #0x18] 0809DBDE: 2720 mov r7, #0x20 0809DBE0: 427F neg r7, r7 0809DBE2: 4007 and r7, r0 0809DBE4: 4317 orr r7, r2 0809DBE6: 762F strb r7, [r5, #0x18] 0809DBE8: 696C ldr r4, [r5, #0x14] 0809DBEA: 02E2 lsl r2, r4, #0xB 0809DBEC: 0E12 lsr r2, r2, #0x18 0809DBEE: 2100 mov r1, #0x00 0809DBF0: 5E58 ldsh r0, [r3, r1] 0809DBF2: 00C0 lsl r0, r0, #0x3 0809DBF4: 4460 add r0, r12 0809DBF6: 78C1 ldrb r1, [r0, #0x03] 0809DBF8: 0949 lsr r1, r1, #0x5 0809DBFA: 7900 ldrb r0, [r0, #0x04] 0809DBFC: 4646 mov r6, r8 0809DBFE: 4030 and r0, r6 0809DC00: 00C0 lsl r0, r0, #0x3 0809DC02: 4308 orr r0, r1 0809DC04: 1812 add r2, r2, r0 0809DC06: 20FF mov r0, #0xFF 0809DC08: 4002 and r2, r0 0809DC0A: 0352 lsl r2, r2, #0xD 0809DC0C: 483B ldr r0, =#0xFFE01FFF 0809DC0E: 4020 and r0, r4 0809DC10: 4310 orr r0, r2 0809DC12: 6168 str r0, [r5, #0x14] 0809DC14: 89EA ldrh r2, [r5, #0x0E] 0809DC16: 04D1 lsl r1, r2, #0x13 0809DC18: 0E49 lsr r1, r1, #0x19 0809DC1A: 2400 mov r4, #0x00 0809DC1C: 5F18 ldsh r0, [r3, r4] 0809DC1E: 00C0 lsl r0, r0, #0x3 0809DC20: 4460 add r0, r12 0809DC22: 8880 ldrh r0, [r0, #0x04] 0809DC24: 04C0 lsl r0, r0, #0x13 0809DC26: 0E00 lsr r0, r0, #0x18 0809DC28: 1809 add r1, r1, r0 0809DC2A: 267F mov r6, #0x7F 0809DC2C: 4031 and r1, r6 0809DC2E: 0189 lsl r1, r1, #0x6 0809DC30: 4833 ldr r0, =#0xFFFFE03F 0809DC32: 4682 mov r10, r0 0809DC34: 4656 mov r6, r10 0809DC36: 4016 and r6, r2 0809DC38: 430E orr r6, r1 0809DC3A: 81EE strh r6, [r5, #0x0E] 0809DC3C: 4648 mov r0, r9 0809DC3E: 3001 add r0, #0x01 0809DC40: 0400 lsl r0, r0, #0x10 0809DC42: 0C00 lsr r0, r0, #0x10 0809DC44: 4681 mov r9, r0 0809DC46: 2804 cmp r0, #0x04 0809DC48: D987 bls 0x0809DB5A 0809DC4A: 482E ldr r0, =#0x00CF00CE 0809DC4C: 9901 ldr r1, [sp, #0x004] 0809DC4E: 4281 cmp r1, r0 0809DC50: D148 bne 0x0809DCE4 0809DC52: 6A69 ldr r1, [r5, #0x24] 0809DC54: 482C ldr r0, =#0x00D100D0 0809DC56: 4281 cmp r1, r0 0809DC58: D144 bne 0x0809DCE4 0809DC5A: 2428 mov r4, #0x28 0809DC5C: 5F28 ldsh r0, [r5, r4] 0809DC5E: 28D2 cmp r0, #0xD2 0809DC60: D140 bne 0x0809DCE4 0809DC62: 8AAB ldrh r3, [r5, #0x14] 0809DC64: 04D9 lsl r1, r3, #0x13 0809DC66: 0E09 lsr r1, r1, #0x18 0809DC68: 3132 add r1, #0x32 0809DC6A: 24FF mov r4, #0xFF 0809DC6C: 4021 and r1, r4 0809DC6E: 0149 lsl r1, r1, #0x5 0809DC70: 4A21 ldr r2, =#0xFFFFE01F 0809DC72: 1C10 add r0, r2, #0x0 0809DC74: 4018 and r0, r3 0809DC76: 4308 orr r0, r1 0809DC78: 82A8 strh r0, [r5, #0x14] 0809DC7A: 8AE9 ldrh r1, [r5, #0x16] 0809DC7C: 04C8 lsl r0, r1, #0x13 0809DC7E: 0E00 lsr r0, r0, #0x18 0809DC80: 3032 add r0, #0x32 0809DC82: 4020 and r0, r4 0809DC84: 0140 lsl r0, r0, #0x5 0809DC86: 400A and r2, r1 0809DC88: 4302 orr r2, r0 0809DC8A: 82EA strh r2, [r5, #0x16] 0809DC8C: 7DEC ldrb r4, [r5, #0x17] 0809DC8E: 0960 lsr r0, r4, #0x5 0809DC90: 7E29 ldrb r1, [r5, #0x18] 0809DC92: 231F mov r3, #0x1F 0809DC94: 4019 and r1, r3 0809DC96: 00C9 lsl r1, r1, #0x3 0809DC98: 4301 orr r1, r0 0809DC9A: 3132 add r1, #0x32 0809DC9C: 1C0A add r2, r1, #0x0 0809DC9E: 2007 mov r0, #0x07 0809DCA0: 4002 and r2, r0 0809DCA2: 0152 lsl r2, r2, #0x5 0809DCA4: 1C18 add r0, r3, #0x0 0809DCA6: 4020 and r0, r4 0809DCA8: 4310 orr r0, r2 0809DCAA: 75E8 strb r0, [r5, #0x17] 0809DCAC: 08C9 lsr r1, r1, #0x3 0809DCAE: 4019 and r1, r3 0809DCB0: 2420 mov r4, #0x20 0809DCB2: 4264 neg r4, r4 0809DCB4: 4027 and r7, r4 0809DCB6: 430F orr r7, r1 0809DCB8: 762F strb r7, [r5, #0x18] 0809DCBA: 696A ldr r2, [r5, #0x14] 0809DCBC: 02D0 lsl r0, r2, #0xB 0809DCBE: 0E00 lsr r0, r0, #0x18 0809DCC0: 3032 add r0, #0x32 0809DCC2: 21FF mov r1, #0xFF 0809DCC4: 4008 and r0, r1 0809DCC6: 0340 lsl r0, r0, #0xD 0809DCC8: 490C ldr r1, =#0xFFE01FFF 0809DCCA: 4011 and r1, r2 0809DCCC: 4301 orr r1, r0 0809DCCE: 6169 str r1, [r5, #0x14] 0809DCD0: 04F0 lsl r0, r6, #0x13 0809DCD2: 0E40 lsr r0, r0, #0x19 0809DCD4: 3032 add r0, #0x32 0809DCD6: 247F mov r4, #0x7F 0809DCD8: 4020 and r0, r4 0809DCDA: 0180 lsl r0, r0, #0x6 0809DCDC: 4651 mov r1, r10 0809DCDE: 400E and r6, r1 0809DCE0: 4306 orr r6, r0 0809DCE2: 81EE strh r6, [r5, #0x0E] 0809DCE4: B002 add sp, #0x008 0809DCE6: BC38 pop {r3, r4, r5} 0809DCE8: 4698 mov r8, r3 0809DCEA: 46A1 mov r9, r4 0809DCEC: 46AA mov r10, r5 0809DCEE: BCF0 pop {r4, r5, r6, r7} 0809DCF0: BC01 pop {r0} 0809DCF2: 4700 bx r0 ;0809DCF4: F4A8 bl ;0809DCF6: 080F lsr r7, r1, #0x0 ;0809DCF8: E01F b 0x0809DD3A ;0809DCFA: FFFF bl 0x080BDCFA ;0809DCFC: 1FFF sub r7, r7, #0x7 ;0809DCFE: FFE0 bl 0x0809DCC0 ;0809DD00: E03F b 0x0809DD82 ;0809DD02: FFFF bl 0x080DDD02 ;0809DD04: 00CE lsl r6, r1, #0x3 ;0809DD06: 00CF lsl r7, r1, #0x3 ;0809DD08: 00D0 lsl r0, r2, #0x3 ;0809DD0A: 00D1 lsl r1, r2, #0x3
$0809E448 - ?
r0 and r1 contain an address.
0809E448: B570 push {r4, r5, r6, lr} 0809E44A: 1C05 add r5, r0, #0x0 ; r5 = Orig. r0 0809E44C: 1C0E add r6, r1, #0x0 ; r6 = Orig. r1 0809E44E: 7BEA ldrb r2, [r5, #0x0F] ; r2 = Orig. r0 + #$0F 0809E450: 0952 lsr r2, r2, #0x5 ; r2 now only contains Bits 7 to 5 in Bits 2 to 0. 0809E452: 7C29 ldrb r1, [r5, #0x10] ; r1 = Orig. r0 + #$10 0809E454: 207F mov r0, #0x7F 0809E456: 4001 and r1, r0 ; r1 now only contains Bits 6 to 0 0809E458: 00C9 lsl r1, r1, #0x3 ; << 3 0809E45A: 4311 orr r1, r2 ; Put both back together 0809E45C: 8AA8 ldrh r0, [r5, #0x14] ; r0 = Orig. r0 + #$14 0809E45E: 04C0 lsl r0, r0, #0x13 ; Remove the three MSBs Bits 15 - 13 0809E460: 0E00 lsr r0, r0, #0x18 ; r0 now only contains Bits 12 - 5 in Bits 7 - 0 0809E462: 1809 add r1, r1, r0 ; Added to the other stuff 0809E464: 4C25 ldr r4, =#0x000003E7 0809E466: 42A1 cmp r1, r4 0809E468: DD00 ble 0x0809E46C ; If the stuff exceeds #$03E7, set r1 = #$03E7 0809E46A: 1C21 add r1, r4, #0x0 0809E46C: 8031 strh r1, [r6] ; Store the value in Orig. r1 0809E46E: 8A69 ldrh r1, [r5, #0x12] 0809E470: 0549 lsl r1, r1, #0x15 0809E472: 0D89 lsr r1, r1, #0x16 0809E474: 8AE8 ldrh r0, [r5, #0x16] 0809E476: 04C0 lsl r0, r0, #0x13 0809E478: 0E00 lsr r0, r0, #0x18 0809E47A: 1809 add r1, r1, r0 0809E47C: 42A1 cmp r1, r4 0809E47E: DD00 ble 0x0809E482 0809E480: 1C21 add r1, r4, #0x0 0809E482: 80F1 strh r1, [r6, #0x06] 0809E484: 7CE8 ldrb r0, [r5, #0x13] 0809E486: 08C0 lsr r0, r0, #0x3 0809E488: 7D29 ldrb r1, [r5, #0x14] 0809E48A: 231F mov r3, #0x1F 0809E48C: 4019 and r1, r3 0809E48E: 0149 lsl r1, r1, #0x5 0809E490: 4301 orr r1, r0 0809E492: 7DEA ldrb r2, [r5, #0x17] 0809E494: 0952 lsr r2, r2, #0x5 0809E496: 7E28 ldrb r0, [r5, #0x18] 0809E498: 4018 and r0, r3 0809E49A: 00C0 lsl r0, r0, #0x3 0809E49C: 4310 orr r0, r2 0809E49E: 1809 add r1, r1, r0 0809E4A0: 42A1 cmp r1, r4 0809E4A2: DD00 ble 0x0809E4A6 0809E4A4: 1C21 add r1, r4, #0x0 0809E4A6: 80B1 strh r1, [r6, #0x04] 0809E4A8: 6929 ldr r1, [r5, #0x10] 0809E4AA: 03C9 lsl r1, r1, #0xF 0809E4AC: 0D89 lsr r1, r1, #0x16 0809E4AE: 6968 ldr r0, [r5, #0x14] 0809E4B0: 02C0 lsl r0, r0, #0xB 0809E4B2: 0E00 lsr r0, r0, #0x18 0809E4B4: 1809 add r1, r1, r0 0809E4B6: 42A1 cmp r1, r4 0809E4B8: DD00 ble 0x0809E4BC 0809E4BA: 1C21 add r1, r4, #0x0 0809E4BC: 8071 strh r1, [r6, #0x02] 0809E4BE: 68E9 ldr r1, [r5, #0x0C] 0809E4C0: 0289 lsl r1, r1, #0xA 0809E4C2: 0E49 lsr r1, r1, #0x19 0809E4C4: 89E8 ldrh r0, [r5, #0x0E] 0809E4C6: 04C0 lsl r0, r0, #0x13 0809E4C8: 0E40 lsr r0, r0, #0x19 0809E4CA: 1809 add r1, r1, r0 0809E4CC: 2964 cmp r1, #0x64 0809E4CE: DD00 ble 0x0809E4D2 0809E4D0: 2164 mov r1, #0x64 0809E4D2: 8131 strh r1, [r6, #0x08] 0809E4D4: 1C28 add r0, r5, #0x0 0809E4D6: F01D bl 0809E4D8: FB71 bl 0x080BBBBC 0809E4DA: 72B0 strb r0, [r6, #0x0A] 0809E4DC: 2400 mov r4, #0x00 0809E4DE: 360B add r6, #0x0B 0809E4E0: 1C28 add r0, r5, #0x0 0809E4E2: 1C21 add r1, r4, #0x0 0809E4E4: F01D bl 0809E4E6: FB88 bl 0x080BBBF8 0809E4E8: 1931 add r1, r6, r4 0809E4EA: 7008 strb r0, [r1] 0809E4EC: 1C60 add r0, r4, #0x1 0809E4EE: 0400 lsl r0, r0, #0x10 0809E4F0: 0C04 lsr r4, r0, #0x10 0809E4F2: 2C0F cmp r4, #0x0F 0809E4F4: D9F4 bls 0x0809E4E0 0809E4F6: BC70 pop {r4, r5, r6} 0809E4F8: BC01 pop {r0} 0809E4FA: 4700 bx r0 ;0809E4FC: 03E7 lsl r7, r4, #0xF ;0809E4FE: 0000 lsl r0, r0, #0x0
$0809E788 - ?
0809E788: B5F0 push {r4, r5, r6, r7, lr} 0809E78A: 4647 mov r7, r8 0809E78C: B480 push {r7} 0809E78E: 1C06 add r6, r0, #0x0 ; r6 = Orig. r0 0809E790: 2000 mov r0, #0x00 ; Address Table Entry Number to load 0809E792: F01E bl 0809E794: FDC5 bl 0x080BD320 ; Load Address from Table in WRAM 0809E796: 4680 mov r8, r0 ; Store loaded address in r8 0809E798: F01D bl 0809E79A: FC4A bl 0x080BC030 0809E79C: 4B3F ldr r3, =#0x0202D7A0 0809E79E: 219B mov r1, #0x9B 0809E7A0: 0089 lsl r1, r1, #0x2 0809E7A2: 1858 add r0, r3, r1 0809E7A4: 6800 ldr r0, [r0] 0809E7A6: 4A3E ldr r2, =#0x0001869F 0809E7A8: 4290 cmp r0, r2 0809E7AA: D900 bls 0x0809E7AE 0809E7AC: 1C10 add r0, r2, #0x0 0809E7AE: 4C3D ldr r4, =#0x00002F58 0809E7B0: 19A4 add r4, r4, r6 0809E7B2: 46A4 mov r12, r4 0809E7B4: 8020 strh r0, [r4] 0809E7B6: 279D mov r7, #0x9D 0809E7B8: 00BF lsl r7, r7, #0x2 0809E7BA: 19D8 add r0, r3, r7 0809E7BC: 6800 ldr r0, [r0] 0809E7BE: 4290 cmp r0, r2 0809E7C0: D900 bls 0x0809E7C4 0809E7C2: 1C10 add r0, r2, #0x0 0809E7C4: 4938 ldr r1, =#0x00002F5A 0809E7C6: 1874 add r4, r6, r1 0809E7C8: 8020 strh r0, [r4] 0809E7CA: 279E mov r7, #0x9E 0809E7CC: 00BF lsl r7, r7, #0x2 0809E7CE: 19D8 add r0, r3, r7 0809E7D0: 6801 ldr r1, [r0] 0809E7D2: 4291 cmp r1, r2 0809E7D4: D900 bls 0x0809E7D8 0809E7D6: 1C11 add r1, r2, #0x0 0809E7D8: 4A34 ldr r2, =#0x00002F5C 0809E7DA: 18B0 add r0, r6, r2 0809E7DC: 8001 strh r1, [r0] 0809E7DE: 279F mov r7, #0x9F 0809E7E0: 00BF lsl r7, r7, #0x2 0809E7E2: 19D8 add r0, r3, r7 0809E7E4: 8801 ldrh r1, [r0] 0809E7E6: 3202 add r2, #0x02 0809E7E8: 18B0 add r0, r6, r2 0809E7EA: 8001 strh r1, [r0] 0809E7EC: 3F11 sub r7, #0x11 0809E7EE: 19D8 add r0, r3, r7 0809E7F0: 7800 ldrb r0, [r0] 0809E7F2: 06C0 lsl r0, r0, #0x1B 0809E7F4: 0F00 lsr r0, r0, #0x1C 0809E7F6: 3202 add r2, #0x02 0809E7F8: 18B1 add r1, r6, r2 0809E7FA: 8008 strh r0, [r1] 0809E7FC: 3719 add r7, #0x19 0809E7FE: 19D9 add r1, r3, r7 0809E800: 680A ldr r2, [r1] 0809E802: 4D2B ldr r5, =#0x0000270F 0809E804: 42AA cmp r2, r5 0809E806: D900 bls 0x0809E80A 0809E808: 1C2A add r2, r5, #0x0 0809E80A: 4F2A ldr r7, =#0x00002F64 0809E80C: 19F0 add r0, r6, r7 0809E80E: 8002 strh r2, [r0] 0809E810: 22A0 mov r2, #0xA0 0809E812: 0092 lsl r2, r2, #0x2 0809E814: 1898 add r0, r3, r2 0809E816: 6800 ldr r0, [r0] 0809E818: 6809 ldr r1, [r1] 0809E81A: 1A40 sub r0, r0, r1 0809E81C: 4B26 ldr r3, =#0x00002F66 0809E81E: 18F2 add r2, r6, r3 0809E820: 8010 strh r0, [r2] 0809E822: 1C01 add r1, r0, #0x0 0809E824: 0400 lsl r0, r0, #0x10 0809E826: 0C00 lsr r0, r0, #0x10 0809E828: 42A8 cmp r0, r5 0809E82A: D900 bls 0x0809E82E 0809E82C: 1C29 add r1, r5, #0x0 0809E82E: 8011 strh r1, [r2] 0809E830: 4A22 ldr r2, =#0x02029CB0 0809E832: 27C9 mov r7, #0xC9 0809E834: 007F lsl r7, r7, #0x1 0809E836: 19D0 add r0, r2, r7 0809E838: 7801 ldrb r1, [r0] 0809E83A: 4B21 ldr r3, =#0x00000193 0809E83C: 18D0 add r0, r2, r3 0809E83E: 7800 ldrb r0, [r0] 0809E840: 0200 lsl r0, r0, #0x8 0809E842: 1809 add r1, r1, r0 0809E844: 42A9 cmp r1, r5 0809E846: DD00 ble 0x0809E84A 0809E848: 1C29 add r1, r5, #0x0 0809E84A: 4F1E ldr r7, =#0x00002F6A 0809E84C: 19F0 add r0, r6, r7 0809E84E: 8001 strh r1, [r0] 0809E850: 21CE mov r1, #0xCE 0809E852: 0049 lsl r1, r1, #0x1 0809E854: 1850 add r0, r2, r1 0809E856: 7801 ldrb r1, [r0] 0809E858: 4B1B ldr r3, =#0x0000019D 0809E85A: 18D0 add r0, r2, r3 0809E85C: 7800 ldrb r0, [r0] 0809E85E: 0200 lsl r0, r0, #0x8 0809E860: 1809 add r1, r1, r0 0809E862: 42A9 cmp r1, r5 0809E864: DD00 ble 0x0809E868 0809E866: 1C29 add r1, r5, #0x0 0809E868: 4F18 ldr r7, =#0x00002F6C 0809E86A: 19F0 add r0, r6, r7 0809E86C: 8001 strh r1, [r0] 0809E86E: 21CD mov r1, #0xCD 0809E870: 0049 lsl r1, r1, #0x1 0809E872: 1850 add r0, r2, r1 0809E874: 7801 ldrb r1, [r0] 0809E876: 4B16 ldr r3, =#0x0000019B 0809E878: 18D0 add r0, r2, r3 0809E87A: 7800 ldrb r0, [r0] 0809E87C: 0200 lsl r0, r0, #0x8 0809E87E: 1809 add r1, r1, r0 0809E880: 42A9 cmp r1, r5 0809E882: DD00 ble 0x0809E886 0809E884: 1C29 add r1, r5, #0x0 0809E886: 4F13 ldr r7, =#0x00002F6E 0809E888: 19F0 add r0, r6, r7 0809E88A: 8001 strh r1, [r0] 0809E88C: 4661 mov r1, r12 0809E88E: 8808 ldrh r0, [r1] 0809E890: 2800 cmp r0, #0x00 0809E892: D123 bne 0x0809E8DC 0809E894: 4A10 ldr r2, =#0x00002F70 0809E896: 18B1 add r1, r6, r2 0809E898: 2000 mov r0, #0x00 0809E89A: E032 b 0x0809E902 ;0809E89C: D7A0 bvc 0x0809E7E0 ;0809E89E: 0202 lsl r2, r0, #0x8 ;0809E8A0: 869F strh r7, [r3, #0x34] ;0809E8A2: 0001 lsl r1, r0, #0x0 ;0809E8A4: 2F58 cmp r7, #0x58 ;0809E8A6: 0000 lsl r0, r0, #0x0 ;0809E8A8: 2F5A cmp r7, #0x5A ;0809E8AA: 0000 lsl r0, r0, #0x0 ;0809E8AC: 2F5C cmp r7, #0x5C ;0809E8AE: 0000 lsl r0, r0, #0x0 ;0809E8B0: 270F mov r7, #0x0F ;0809E8B2: 0000 lsl r0, r0, #0x0 ;0809E8B4: 2F64 cmp r7, #0x64 ;0809E8B6: 0000 lsl r0, r0, #0x0 ;0809E8B8: 2F66 cmp r7, #0x66 ;0809E8BA: 0000 lsl r0, r0, #0x0 ;0809E8BC: 9CB0 ldr r4, [sp, #0x2C0] ;0809E8BE: 0202 lsl r2, r0, #0x8 ;0809E8C0: 0193 lsl r3, r2, #0x6 ;0809E8C2: 0000 lsl r0, r0, #0x0 ;0809E8C4: 2F6A cmp r7, #0x6A ;0809E8C6: 0000 lsl r0, r0, #0x0 ;0809E8C8: 019D lsl r5, r3, #0x6 ;0809E8CA: 0000 lsl r0, r0, #0x0 ;0809E8CC: 2F6C cmp r7, #0x6C ;0809E8CE: 0000 lsl r0, r0, #0x0 ;0809E8D0: 019B lsl r3, r3, #0x6 ;0809E8D2: 0000 lsl r0, r0, #0x0 ;0809E8D4: 2F6E cmp r7, #0x6E ;0809E8D6: 0000 lsl r0, r0, #0x0 ;0809E8D8: 2F70 cmp r7, #0x70 ;0809E8DA: 0000 lsl r0, r0, #0x0 0809E8DC: 8824 ldrh r4, [r4] 0809E8DE: 1B04 sub r4, r0, r4 0809E8E0: 0424 lsl r4, r4, #0x10 0809E8E2: 0C24 lsr r4, r4, #0x10 0809E8E4: 2064 mov r0, #0x64 0809E8E6: 4360 mul r0, r4 0809E8E8: 4663 mov r3, r12 0809E8EA: 8819 ldrh r1, [r3] 0809E8EC: F021 bl 0809E8EE: FE58 bl 0x080C05A0 0809E8F0: 4F45 ldr r7, =#0x00002F70 0809E8F2: 19F1 add r1, r6, r7 0809E8F4: 7008 strb r0, [r1] 0809E8F6: 2C00 cmp r4, #0x00 0809E8F8: D004 beq 0x0809E904 0809E8FA: 0600 lsl r0, r0, #0x18 0809E8FC: 2800 cmp r0, #0x00 0809E8FE: D101 bne 0x0809E904 0809E900: 2001 mov r0, #0x01 0809E902: 7008 strb r0, [r1] 0809E904: 4C41 ldr r4, =#0x02032700 0809E906: 4842 ldr r0, =#0x00009434 0809E908: 1824 add r4, r4, r0 0809E90A: 8821 ldrh r1, [r4] 0809E90C: 2064 mov r0, #0x64 0809E90E: 4348 mul r0, r1 0809E910: 2170 mov r1, #0x70 0809E912: F021 bl 0809E914: FE45 bl 0x080C05A0 0809E916: 1C01 add r1, r0, #0x0 0809E918: 4B3E ldr r3, =#0x00002F72 0809E91A: 18F2 add r2, r6, r3 0809E91C: 7011 strb r1, [r2] 0809E91E: 8820 ldrh r0, [r4] 0809E920: 2800 cmp r0, #0x00 0809E922: D004 beq 0x0809E92E 0809E924: 0608 lsl r0, r1, #0x18 0809E926: 2800 cmp r0, #0x00 0809E928: D101 bne 0x0809E92E 0809E92A: 2001 mov r0, #0x01 0809E92C: 7010 strb r0, [r2] 0809E92E: 2500 mov r5, #0x00 0809E930: 2400 mov r4, #0x00 0809E932: 4640 mov r0, r8 0809E934: 1C21 add r1, r4, #0x0 0809E936: F01C bl 0809E938: FDF1 bl 0x080BB51C 0809E93A: 1828 add r0, r5, r0 0809E93C: 0400 lsl r0, r0, #0x10 0809E93E: 0C05 lsr r5, r0, #0x10 0809E940: 1C60 add r0, r4, #0x1 0809E942: 0400 lsl r0, r0, #0x10 0809E944: 0C04 lsr r4, r0, #0x10 0809E946: 2C0F cmp r4, #0x0F 0809E948: D9F3 bls 0x0809E932 0809E94A: 2064 mov r0, #0x64 0809E94C: 4368 mul r0, r5 0809E94E: 2170 mov r1, #0x70 0809E950: F021 bl 0809E952: FE26 bl 0x080C05A0 0809E954: 4C30 ldr r4, =#0x00002F73 0809E956: 1931 add r1, r6, r4 0809E958: 7008 strb r0, [r1] 0809E95A: 2D00 cmp r5, #0x00 0809E95C: D004 beq 0x0809E968 0809E95E: 0600 lsl r0, r0, #0x18 0809E960: 2800 cmp r0, #0x00 0809E962: D101 bne 0x0809E968 0809E964: 2001 mov r0, #0x01 0809E966: 7008 strb r0, [r1] 0809E968: 4F2C ldr r7, =#0x00002F68 0809E96A: 19F1 add r1, r6, r7 0809E96C: 2000 mov r0, #0x00 0809E96E: 8008 strh r0, [r1] 0809E970: 2400 mov r4, #0x00 0809E972: 4D2B ldr r5, =#0x02029CB0 0809E974: 1C2F add r7, r5, #0x0 0809E976: 482B ldr r0, =#0x0000012B 0809E978: 4680 mov r8, r0 0809E97A: 2201 mov r2, #0x01 0809E97C: 4694 mov r12, r2 0809E97E: 1C23 add r3, r4, #0x0 0809E980: 339C add r3, #0x9C 0809E982: 10D8 asr r0, r3, #0x3 0809E984: 19C0 add r0, r0, r7 0809E986: 7802 ldrb r2, [r0] 0809E988: 1C18 add r0, r3, #0x0 0809E98A: 10C0 asr r0, r0, #0x3 0809E98C: 00C0 lsl r0, r0, #0x3 0809E98E: 1A18 sub r0, r3, r0 0809E990: 4102 asr r2, r0 0809E992: 4663 mov r3, r12 0809E994: 401A and r2, r3 0809E996: 2A00 cmp r2, #0x00 0809E998: D002 beq 0x0809E9A0 0809E99A: 8808 ldrh r0, [r1] 0809E99C: 3001 add r0, #0x01 0809E99E: 8008 strh r0, [r1] 0809E9A0: 1C60 add r0, r4, #0x1 0809E9A2: 0400 lsl r0, r0, #0x10 0809E9A4: 0C04 lsr r4, r0, #0x10 0809E9A6: 4544 cmp r4, r8 0809E9A8: D9E9 bls 0x0809E97E 0809E9AA: 4C1C ldr r4, =#0x00002F68 0809E9AC: 1933 add r3, r6, r4 0809E9AE: 4F1E ldr r7, =#0x00000179 0809E9B0: 19E8 add r0, r5, r7 0809E9B2: 7800 ldrb r0, [r0] 0809E9B4: 881A ldrh r2, [r3] 0809E9B6: 1812 add r2, r2, r0 0809E9B8: 21FA mov r1, #0xFA 0809E9BA: 0049 lsl r1, r1, #0x1 0809E9BC: 1868 add r0, r5, r1 0809E9BE: 7801 ldrb r1, [r0] 0809E9C0: 4C1A ldr r4, =#0x000001F5 0809E9C2: 1928 add r0, r5, r4 0809E9C4: 7800 ldrb r0, [r0] 0809E9C6: 0200 lsl r0, r0, #0x8 0809E9C8: 1809 add r1, r1, r0 0809E9CA: 1A52 sub r2, r2, r1 0809E9CC: 801A strh r2, [r3] 0809E9CE: 1C30 add r0, r6, #0x0 0809E9D0: F01A bl 0809E9D2: FF0A bl 0x080B97E8 0809E9D4: 4F16 ldr r7, =#0x00003ACE 0809E9D6: 19F4 add r4, r6, r7 0809E9D8: 8821 ldrh r1, [r4] 0809E9DA: 2064 mov r0, #0x64 0809E9DC: 4348 mul r0, r1 0809E9DE: 2190 mov r1, #0x90 0809E9E0: 0049 lsl r1, r1, #0x1 0809E9E2: F021 bl 0809E9E4: FDDD bl 0x080C05A0 0809E9E6: 1C02 add r2, r0, #0x0 0809E9E8: 4812 ldr r0, =#0x00002F74 0809E9EA: 1831 add r1, r6, r0 0809E9EC: 700A strb r2, [r1] 0809E9EE: 8820 ldrh r0, [r4] 0809E9F0: 2800 cmp r0, #0x00 0809E9F2: D004 beq 0x0809E9FE 0809E9F4: 0610 lsl r0, r2, #0x18 0809E9F6: 2800 cmp r0, #0x00 0809E9F8: D101 bne 0x0809E9FE 0809E9FA: 2001 mov r0, #0x01 0809E9FC: 7008 strb r0, [r1] 0809E9FE: BC08 pop {r3} 0809EA00: 4698 mov r8, r3 0809EA02: BCF0 pop {r4, r5, r6, r7} 0809EA04: BC01 pop {r0} 0809EA06: 4700 bx r0 ;0809EA08: 2F70 cmp r7, #0x70 ;0809EA0A: 0000 lsl r0, r0, #0x0 ;0809EA0C: 2700 mov r7, #0x00 ;0809EA0E: 0203 lsl r3, r0, #0x8 ;0809EA10: 9434 str r4, [sp, #0x0D0] ;0809EA12: 0000 lsl r0, r0, #0x0 ;0809EA14: 2F72 cmp r7, #0x72 ;0809EA16: 0000 lsl r0, r0, #0x0 ;0809EA18: 2F73 cmp r7, #0x73 ;0809EA1A: 0000 lsl r0, r0, #0x0 ;0809EA1C: 2F68 cmp r7, #0x68 ;0809EA1E: 0000 lsl r0, r0, #0x0 ;0809EA20: 9CB0 ldr r4, [sp, #0x2C0] ;0809EA22: 0202 lsl r2, r0, #0x8 ;0809EA24: 012B lsl r3, r5, #0x4 ;0809EA26: 0000 lsl r0, r0, #0x0 ;0809EA28: 0179 lsl r1, r7, #0x5 ;0809EA2A: 0000 lsl r0, r0, #0x0 ;0809EA2C: 01F5 lsl r5, r6, #0x7 ;0809EA2E: 0000 lsl r0, r0, #0x0 ;0809EA30: 3ACE sub r2, #0xCE ;0809EA32: 0000 lsl r0, r0, #0x0 ;0809EA34: 2F74 cmp r7, #0x74 ;0809EA36: 0000 lsl r0, r0, #0x0
$0809EAA0 - ?
0809EAA0: B5F0 push {r4, r5, r6, r7, lr} 0809EAA2: 4657 mov r7, r10 0809EAA4: 464E mov r6, r9 0809EAA6: 4645 mov r5, r8 0809EAA8: B4E0 push {r5, r6, r7} 0809EAAA: 1C02 add r2, r0, #0x0 ; r2 = r0 0809EAAC: 2600 mov r6, #0x00 0809EAAE: 4809 ldr r0, =#0x08103C18 0809EAB0: 4682 mov r10, r0 ; r10 = #$08103C18 0809EAB2: 2110 mov r1, #0x10 0809EAB4: 4689 mov r9, r1 0809EAB6: 2000 mov r0, #0x00 0809EAB8: 7010 strb r0, [r2] 0809EABA: 7050 strb r0, [r2, #0x01] 0809EABC: 00B1 lsl r1, r6, #0x2 0809EABE: 4653 mov r3, r10 0809EAC0: 18C8 add r0, r1, r3 0809EAC2: 7840 ldrb r0, [r0, #0x01] 0809EAC4: 0640 lsl r0, r0, #0x19 0809EAC6: 0EC0 lsr r0, r0, #0x1B 0809EAC8: 280F cmp r0, #0x0F 0809EACA: DC05 bgt 0x0809EAD8 0809EACC: 7490 strb r0, [r2, #0x12] 0809EACE: 2001 mov r0, #0x01 0809EAD0: 7050 strb r0, [r2, #0x01] 0809EAD2: E003 b 0x0809EADC ;0809EAD4: 3C18 sub r4, #0x18 ;0809EAD6: 0810 lsr r0, r2, #0x0 0809EAD8: 4648 mov r0, r9 0809EADA: 7490 strb r0, [r2, #0x12] 0809EADC: 4653 mov r3, r10 0809EADE: 18C8 add r0, r1, r3 0809EAE0: 6800 ldr r0, [r0] 0809EAE2: 0300 lsl r0, r0, #0xC 0809EAE4: 0EC0 lsr r0, r0, #0x1B 0809EAE6: 280F cmp r0, #0x0F 0809EAE8: DC04 bgt 0x0809EAF4 0809EAEA: 74D0 strb r0, [r2, #0x13] 0809EAEC: 7850 ldrb r0, [r2, #0x01] 0809EAEE: 3001 add r0, #0x01 0809EAF0: 7050 strb r0, [r2, #0x01] 0809EAF2: E001 b 0x0809EAF8 0809EAF4: 4648 mov r0, r9 0809EAF6: 74D0 strb r0, [r2, #0x13] 0809EAF8: 2500 mov r5, #0x00 0809EAFA: 1C77 add r7, r6, #0x1 0809EAFC: 2114 mov r1, #0x14 0809EAFE: 1889 add r1, r1, r2 0809EB00: 468C mov r12, r1 0809EB02: 4B19 ldr r3, =#0x08103C18 0809EB04: 4698 mov r8, r3 0809EB06: 1C94 add r4, r2, #0x2 0809EB08: 00A8 lsl r0, r5, #0x2 0809EB0A: 4641 mov r1, r8 0809EB0C: 1843 add r3, r0, r1 0809EB0E: 7858 ldrb r0, [r3, #0x01] 0809EB10: 0640 lsl r0, r0, #0x19 0809EB12: 0EC0 lsr r0, r0, #0x1B 0809EB14: 42B0 cmp r0, r6 0809EB16: D108 bne 0x0809EB2A 0809EB18: 7810 ldrb r0, [r2] 0809EB1A: 1820 add r0, r4, r0 0809EB1C: 8819 ldrh r1, [r3] 0809EB1E: 0589 lsl r1, r1, #0x16 0809EB20: 0EC9 lsr r1, r1, #0x1B 0809EB22: 7001 strb r1, [r0] 0809EB24: 7810 ldrb r0, [r2] 0809EB26: 3001 add r0, #0x01 0809EB28: 7010 strb r0, [r2] 0809EB2A: 6818 ldr r0, [r3] 0809EB2C: 0300 lsl r0, r0, #0xC 0809EB2E: 0EC0 lsr r0, r0, #0x1B 0809EB30: 42B0 cmp r0, r6 0809EB32: D108 bne 0x0809EB46 0809EB34: 7810 ldrb r0, [r2] 0809EB36: 1820 add r0, r4, r0 0809EB38: 8819 ldrh r1, [r3] 0809EB3A: 0589 lsl r1, r1, #0x16 0809EB3C: 0EC9 lsr r1, r1, #0x1B 0809EB3E: 7001 strb r1, [r0] 0809EB40: 7810 ldrb r0, [r2] 0809EB42: 3001 add r0, #0x01 0809EB44: 7010 strb r0, [r2] 0809EB46: 1C68 add r0, r5, #0x1 0809EB48: 0400 lsl r0, r0, #0x10 0809EB4A: 0C05 lsr r5, r0, #0x10 0809EB4C: 2D0F cmp r5, #0x0F 0809EB4E: D9DB bls 0x0809EB08 0809EB50: 0438 lsl r0, r7, #0x10 0809EB52: 0C06 lsr r6, r0, #0x10 0809EB54: 4662 mov r2, r12 0809EB56: 2E0F cmp r6, #0x0F 0809EB58: D9AD bls 0x0809EAB6 0809EB5A: BC38 pop {r3, r4, r5} 0809EB5C: 4698 mov r8, r3 0809EB5E: 46A1 mov r9, r4 0809EB60: 46AA mov r10, r5 0809EB62: BCF0 pop {r4, r5, r6, r7} 0809EB64: BC01 pop {r0} 0809EB66: 4700 bx r0 ;0809EB68: 3C18 sub r4, #0x18 ;0809EB6A: 0810 lsr r0, r2, #0x0
$0809EB6C - ?
This is called from $080A7BE8 and $0809EA38 (maybe from others, later, too). In both cases, r0 contains the address $0203642C.
With #$0203642C in r0, this subroutine does:
- Set bit 0 in $02036546
- Store #$00000000 in $02036538-B.
- Store #$003C in $02036534/5.
- Store #$00000000 in $0203653C-F.
- Store #$00000000 in $02036540-3.
- Store #$FFFF in $02036544/5.
- Clear bits 1 to 4 from $02036546.
- Store #$0068 in $02036530/1.
- Store #$0038 in $02036532/3.
- From $0203642C to $0203652F(?), this fills the register in the following pattern: $???????? $0080 $0080 $00000000 ($00013B13 * Loop Counter) ($0001 * Loop Counter). First byte is not changed.
0809EB6C: B530 push {r4, r5, lr} 0809EB6E: 1C03 add r3, r0, #0x0 ; r3 = Orig. r0 (#$0203642C) 0809EB70: 208D mov r0, #0x8D 0809EB72: 0040 lsl r0, r0, #0x1 ; r0 = #$011A 0809EB74: 18C0 add r0, r0, r3 ; r0 = Orig. r0 + #$011A (#$02036546) 0809EB76: 4684 mov r12, r0 ; r12 = Orig. r0 + #$011A (#$02036546) 0809EB78: 7800 ldrb r0, [r0] ; r0 = [Orig. r0 + #$011A] ([$02036546]) 0809EB7A: 2101 mov r1, #0x01 0809EB7C: 4308 orr r0, r1 ; Set bit 0 0809EB7E: 4661 mov r1, r12 0809EB80: 7008 strb r0, [r1] ; Store value back 0809EB82: 2086 mov r0, #0x86 0809EB84: 0040 lsl r0, r0, #0x1 ; r0 = #$010C 0809EB86: 181A add r2, r3, r0 ; r2 = Orig. r0 + #$010C (#$02036538) 0809EB88: 2000 mov r0, #0x00 0809EB8A: 6010 str r0, [r2] ; Clear Orig. r0 + #$010C ($02036538) 0809EB8C: 2084 mov r0, #0x84 0809EB8E: 0040 lsl r0, r0, #0x1 ; r0 = #$0108 0809EB90: 1819 add r1, r3, r0 ; r1 = Orig. r0 + #$0108 (#$02036534) 0809EB92: 203C mov r0, #0x3C 0809EB94: 8008 strh r0, [r1] ; Store #$003C in Orig. r0 + #$010C ($02036538) 0809EB96: 30D4 add r0, #0xD4 ; r0 = #$0110 0809EB98: 1819 add r1, r3, r0 ; r1 = Orig. r0 + #$0110 (#$0203653C) 0809EB9A: 6810 ldr r0, [r2] ; r0 = Orig. r0 + #$010C (#$02036538) = #$0000000 0809EB9C: 6008 str r0, [r1] ; Clear Orig. r0 + #$0110 (#$0203653C) 0809EB9E: 208A mov r0, #0x8A 0809EBA0: 0040 lsl r0, r0, #0x1 ; r0 = #$0114 0809EBA2: 1819 add r1, r3, r0 ; r1 = Orig. r0 + #$0114 (#$02036540) 0809EBA4: 6810 ldr r0, [r2] ; r0 = Orig. r0 + #$010C (#$02036538) = #$0000000 0809EBA6: 6008 str r0, [r1] ; Clear Orig. r0 + #$0114 (#$02036540) 0809EBA8: 208C mov r0, #0x8C 0809EBAA: 0040 lsl r0, r0, #0x1 ; r0 = #$0118 0809EBAC: 1819 add r1, r3, r0 ; r1 = Orig. r0 + #$0118 (#$02036544) 0809EBAE: 4813 ldr r0, =#0x0000FFFF 0809EBB0: 8008 strh r0, [r1] ; Store #$FFFF in Orig. r0 + #$0118 (#$02036544/5) 0809EBB2: 4660 mov r0, r12 ; r0 = Orig. r0 + #$011A (#$02036546) 0809EBB4: 7801 ldrb r1, [r0] ; r1 = [Orig. r0 + #$011A] ([$02036546]) 0809EBB6: 201F mov r0, #0x1F 0809EBB8: 4240 neg r0, r0 ; r0 = #$FFFFFFE1 0809EBBA: 4008 and r0, r1 ; Remove Bits 1 to 4 from loaded byte 0809EBBC: 4661 mov r1, r12 0809EBBE: 7008 strb r0, [r1] ; Store Byte back 0809EBC0: 2082 mov r0, #0x82 0809EBC2: 0040 lsl r0, r0, #0x1 ; r0 = #$0104 0809EBC4: 1819 add r1, r3, r0 ; r1 = Orig. r0 + #$0104 (#$02036530) 0809EBC6: 2068 mov r0, #0x68 0809EBC8: 8008 strh r0, [r1] ; Store #$0068 in Orig. r0 + #$0104 ($02036530) 0809EBCA: 2038 mov r0, #0x38 0809EBCC: 8048 strh r0, [r1, #0x02] ; Store #$0038 in Orig. r0 + #$0106 ($02036532) 0809EBCE: 1C19 add r1, r3, #0x0 ; r1 = Orig. r0 0809EBD0: 2200 mov r2, #0x00 0809EBD2: 2000 mov r0, #0x00 ; Setup loop counter 0809EBD4: 2500 mov r5, #0x00 0809EBD6: 2380 mov r3, #0x80 0809EBD8: 005B lsl r3, r3, #0x1 ; r3 = #$0100 0809EBDA: 4C09 ldr r4, =#0x00013B13 0809EBDC: 808B strh r3, [r1, #0x04] ; Store #$0080 0809EBDE: 80CB strh r3, [r1, #0x06] ; Store #$0080 0809EBE0: 810D strh r5, [r1, #0x08] ; Store #$00000000 0809EBE2: 60CA str r2, [r1, #0x0C] ; Store #$13B13 * Loop Counter 0809EBE4: 7408 strb r0, [r1, #0x10] ; Store Loop Counter 0809EBE6: 1912 add r2, r2, r4 ; r2 = #$13B13 * Loop Counter 0809EBE8: 3001 add r0, #0x01 ; INC Loop Counter 0809EBEA: 0400 lsl r0, r0, #0x10 ; Loop Counter AND #$0000FFFF 0809EBEC: 0C00 lsr r0, r0, #0x10 0809EBEE: 3114 add r1, #0x14 ; Increment Store Address 0809EBF0: 280C cmp r0, #0x0C 0809EBF2: D9F3 bls 0x0809EBDC ; Loop until Loop Counter > #$0C 0809EBF4: BC30 pop {r4, r5} 0809EBF6: BC01 pop {r0} 0809EBF8: 4700 bx r0 ;0809EBFA: 0000 lsl r0, r0, #0x0 ;0809EBFC: FFFF bl 0x0809FBFC ;0809EBFE: 0000 lsl r0, r0, #0x0 ;0809EC00: 3B13 sub r3, #0x13 ;0809EC02: 0001 lsl r1, r0, #0x0
$0809F124 - Transfer Equipment Items to VRAM
This does one specific DMA to VRAM. Both source and destination address are hardwired.
0809F124: 4908 ldr r1, =#0x040000D4 0809F126: 4809 ldr r0, =#0x0862922C 0809F128: 6008 str r0, [r1] ; DMA Source: $0862922C 0809F12A: 4809 ldr r0, =#0x06010800 0809F12C: 6048 str r0, [r1, #0x04] ; DMA Destination: VRAM $06010800 0809F12E: 4809 ldr r0, =#0x80000400 0809F130: 6088 str r0, [r1, #0x08] ; Start DMA, Transfer 400 Double Bytes 0809F132: 6888 ldr r0, [r1, #0x08] 0809F134: 6888 ldr r0, [r1, #0x08] 0809F136: 2280 mov r2, #0x80 0809F138: 0612 lsl r2, r2, #0x18 0809F13A: 2800 cmp r0, #0x00 0809F13C: DA03 bge 0x0809F146 0809F13E: 6888 ldr r0, [r1, #0x08] 0809F140: 4010 and r0, r2 0809F142: 2800 cmp r0, #0x00 0809F144: D1FB bne 0x0809F13E 0809F146: 4770 bx lr ;0809F148: 00D4 lsl r4, r2, #0x3 ;0809F14A: 0400 lsl r0, r0, #0x10 ;0809F14C: 922C str r2, [sp, #0x0B0] ;0809F14E: 0862 lsr r2, r4, #0x1 ;0809F150: 0800 lsr r0, r0, #0x0 ;0809F152: 0601 lsl r1, r0, #0x18 ;0809F154: 0400 lsl r0, r0, #0x10 ;0809F156: 8000 strh r0, [r0]
$0809F450 - ?
0809F450: B510 push {r4, lr} 0809F452: 4817 ldr r0, =#0x087924C0 0809F454: 2109 mov r1, #0x09 0809F456: F01E bl 0809F458: FF6B bl 0x080BE330 0809F45A: 1C03 add r3, r0, #0x0 0809F45C: 4C15 ldr r4, =#0x06011800 0809F45E: 20C0 mov r0, #0xC0 0809F460: 0140 lsl r0, r0, #0x5 0809F462: 181B add r3, r3, r0 0809F464: 4814 ldr r0, =#0x040000D4 0809F466: 6003 str r3, [r0] 0809F468: 6044 str r4, [r0, #0x04] 0809F46A: 4914 ldr r1, =#0x80000180 0809F46C: 6081 str r1, [r0, #0x08] ; Activate DMA 0809F46E: 6881 ldr r1, [r0, #0x08] 0809F470: 1C02 add r2, r0, #0x0 0809F472: 6890 ldr r0, [r2, #0x08] 0809F474: 2180 mov r1, #0x80 0809F476: 0609 lsl r1, r1, #0x18 0809F478: 2800 cmp r0, #0x00 0809F47A: DA03 bge 0x0809F484 0809F47C: 6890 ldr r0, [r2, #0x08] 0809F47E: 4008 and r0, r1 0809F480: 2800 cmp r0, #0x00 0809F482: D1FB bne 0x0809F47C 0809F484: 4A0C ldr r2, =#0x040000D4 0809F486: 2080 mov r0, #0x80 0809F488: 00C0 lsl r0, r0, #0x3 0809F48A: 1819 add r1, r3, r0 0809F48C: 6011 str r1, [r2] 0809F48E: 1820 add r0, r4, r0 0809F490: 6050 str r0, [r2, #0x04] 0809F492: 480A ldr r0, =#0x80000180 0809F494: 6090 str r0, [r2, #0x08] 0809F496: 6890 ldr r0, [r2, #0x08] 0809F498: 6890 ldr r0, [r2, #0x08] 0809F49A: 2180 mov r1, #0x80 0809F49C: 0609 lsl r1, r1, #0x18 0809F49E: 2800 cmp r0, #0x00 0809F4A0: DA03 bge 0x0809F4AA 0809F4A2: 6890 ldr r0, [r2, #0x08] 0809F4A4: 4008 and r0, r1 0809F4A6: 2800 cmp r0, #0x00 0809F4A8: D1FB bne 0x0809F4A2 0809F4AA: BC10 pop {r4} 0809F4AC: BC01 pop {r0} 0809F4AE: 4700 bx r0 ;0809F4B0: 24C0 mov r4, #0xC0 ;0809F4B2: 0879 lsr r1, r7, #0x1 ;0809F4B4: 1800 add r0, r0, r0 ;0809F4B6: 0601 lsl r1, r0, #0x18 ;0809F4B8: 00D4 lsl r4, r2, #0x3 ;0809F4BA: 0400 lsl r0, r0, #0x10 ;0809F4BC: 0180 lsl r0, r0, #0x6 ;0809F4BE: 8000 strh r0, [r0]
$0809F91C - ?
0809F91C: B5F0 push {r4, r5, r6, r7, lr} 0809F91E: 4647 mov r7, r8 0809F920: B480 push {r7} 0809F922: 4E10 ldr r6, =#0x06011000 0809F924: 2700 mov r7, #0x00 0809F926: 2500 mov r5, #0x00 0809F928: 480F ldr r0, =#0x0203BB3E 0809F92A: 4680 mov r8, r0 0809F92C: 4641 mov r1, r8 0809F92E: 8809 ldrh r1, [r1] 0809F930: 428D cmp r5, r1 ; $0203BB3E/F = #$0000 ? 0809F932: D22B bcs 0x0809F98C 0809F934: 1C28 add r0, r5, #0x0 ; r0 = #$00 0809F936: F01D bl 0809F938: FCF3 bl 0x080BD320 ; ? 0809F93A: 1C04 add r4, r0, #0x0 0809F93C: 1C28 add r0, r5, #0x0 0809F93E: F01D bl 0809F940: FD0F bl 0x080BD360 0809F942: 1C01 add r1, r0, #0x0 0809F944: 7860 ldrb r0, [r4, #0x01] 0809F946: 09C0 lsr r0, r0, #0x7 0809F948: 2800 cmp r0, #0x00 0809F94A: D00F beq 0x0809F96C 0809F94C: 2211 mov r2, #0x11 0809F94E: 7A89 ldrb r1, [r1, #0x0A] 0809F950: 2001 mov r0, #0x01 0809F952: 4008 and r0, r1 0809F954: 2800 cmp r0, #0x00 0809F956: D013 beq 0x0809F980 0809F958: 0688 lsl r0, r1, #0x1A 0809F95A: 0EC0 lsr r0, r0, #0x1B 0809F95C: 1C02 add r2, r0, #0x0 0809F95E: 3211 add r2, #0x11 0809F960: E00E b 0x0809F980 ;0809F962: 0000 lsl r0, r0, #0x0 ;0809F964: 1000 asr r0, r0, #0x0 ;0809F966: 0601 lsl r1, r0, #0x18 ;0809F968: BB3E pop {r1, r2, r3, r4, r5, pc} ;0809F96A: 0203 lsl r3, r0, #0x8 0809F96C: 78A0 ldrb r0, [r4, #0x02] 0809F96E: 07C0 lsl r0, r0, #0x1F 0809F970: 2800 cmp r0, #0x00 0809F972: D002 beq 0x0809F97A 0809F974: 7820 ldrb r0, [r4] 0809F976: 0680 lsl r0, r0, #0x1A 0809F978: E001 b 0x0809F97E 0809F97A: 8820 ldrh r0, [r4] 0809F97C: 04C0 lsl r0, r0, #0x13 0809F97E: 0E82 lsr r2, r0, #0x1A 0809F980: 1C10 add r0, r2, #0x0 0809F982: 1C31 add r1, r6, #0x0 0809F984: 1C3A add r2, r7, #0x0 0809F986: F000 bl 0809F988: F879 bl 0x0809FA7C 0809F98A: E002 b 0x0809F992 0809F98C: 1C30 add r0, r6, #0x0 0809F98E: F000 bl 0809F990: F8D5 bl 0x0809FB3C 0809F992: 2080 mov r0, #0x80 0809F994: 0040 lsl r0, r0, #0x1 0809F996: 1836 add r6, r6, r0 0809F998: 2D03 cmp r5, #0x03 0809F99A: D102 bne 0x0809F9A2 0809F99C: 2180 mov r1, #0x80 0809F99E: 00C9 lsl r1, r1, #0x3 0809F9A0: 1876 add r6, r6, r1 0809F9A2: 1C78 add r0, r7, #0x1 0809F9A4: 0400 lsl r0, r0, #0x10 0809F9A6: 0C07 lsr r7, r0, #0x10 0809F9A8: 1C68 add r0, r5, #0x1 0809F9AA: 0400 lsl r0, r0, #0x10 0809F9AC: 0C05 lsr r5, r0, #0x10 0809F9AE: 2D05 cmp r5, #0x05 0809F9B0: D9BC bls 0x0809F92C 0809F9B2: BC08 pop {r3} 0809F9B4: 4698 mov r8, r3 0809F9B6: BCF0 pop {r4, r5, r6, r7} 0809F9B8: BC01 pop {r0} 0809F9BA: 4700 bx r0
$0809FB3C - ?
r0 contains a destination address for some (Graphic?) Data that is DMAed there.
0809FB3C: B5F0 push {r4, r5, r6, r7, lr} 0809FB3E: 464F mov r7, r9 0809FB40: 4646 mov r6, r8 0809FB42: B4C0 push {r6, r7} 0809FB44: 1C04 add r4, r0, #0x0 0809FB46: 4823 ldr r0, =#0x087924C0 0809FB48: 2109 mov r1, #0x09 0809FB4A: F01E bl 0809FB4C: FBF1 bl 0x080BE330 ; Load Entry #$09 from the Data Address Table at $087924C0 0809FB4E: 1C02 add r2, r0, #0x0 ; Buffer address in r2 0809FB50: 2088 mov r0, #0x88 0809FB52: 0140 lsl r0, r0, #0x5 ; r0 = #$00001100 0809FB54: 1812 add r2, r2, r0 ; r2 = Loaded address + #$00001100 0809FB56: 2300 mov r3, #0x00 0809FB58: 491F ldr r1, =#0x040000D4 0809FB5A: 4D20 ldr r5, =#0x80000040 0809FB5C: 46A9 mov r9, r5 0809FB5E: 2080 mov r0, #0x80 0809FB60: 0600 lsl r0, r0, #0x18 0809FB62: 4680 mov r8, r0 ; Set up DMA Activation Bit AND mask in r8 = #$80000000 0809FB64: 2580 mov r5, #0x80 0809FB66: 00ED lsl r5, r5, #0x3 ; r5 = #$00000400 0809FB68: 46AC mov r12, r5 0809FB6A: 600A str r2, [r1] ; DMA Source Address = Loaded Data Address Table address + #$00001100 (at loop's first run) 0809FB6C: 604C str r4, [r1, #0x04] ; DMA Destination = Original r0 0809FB6E: 4648 mov r0, r9 0809FB70: 6088 str r0, [r1, #0x08] ; Activate DMA, #$40 Double Bytes 0809FB72: 6888 ldr r0, [r1, #0x08] 0809FB74: 6888 ldr r0, [r1, #0x08] 0809FB76: 4645 mov r5, r8 ; Load DMA Activation Bit AND mask 0809FB78: 4028 and r0, r5 0809FB7A: 1C17 add r7, r2, #0x0 0809FB7C: 3780 add r7, #0x80 ; Add #$40 Double Bytes to DMA Source Address 0809FB7E: 1C26 add r6, r4, #0x0 0809FB80: 3680 add r6, #0x80 ; ADd #$40 Double Bytes to DMA Destination 0809FB82: 1C5D add r5, r3, #0x1 ; INC and Buffer Loop coutner 0809FB84: 2800 cmp r0, #0x00 ; Check if DMA is finished 0809FB86: D005 beq 0x0809FB94 0809FB88: 2380 mov r3, #0x80 ; Loop until DMA is finished 0809FB8A: 061B lsl r3, r3, #0x18 0809FB8C: 6888 ldr r0, [r1, #0x08] 0809FB8E: 4018 and r0, r3 0809FB90: 2800 cmp r0, #0x00 0809FB92: D1FB bne 0x0809FB8C 0809FB94: 4663 mov r3, r12 ; r3 = r12 = #$00000400 0809FB96: 18D0 add r0, r2, r3 ; r0 = Source Address (+#$40) + #$400 0809FB98: 6008 str r0, [r1] ; Set as DMA Source address 0809FB9A: 18E0 add r0, r4, r3 ; r4 = Source Address (+#$40) + #$400 0809FB9C: 6048 str r0, [r1, #0x04] ; Set as DMA Destination 0809FB9E: 4648 mov r0, r9 0809FBA0: 6088 str r0, [r1, #0x08] ; Activate DMA, #$40 Double Bytes 0809FBA2: 6888 ldr r0, [r1, #0x08] 0809FBA4: 1C0B add r3, r1, #0x0 0809FBA6: 6898 ldr r0, [r3, #0x08] 0809FBA8: 4642 mov r2, r8 ; Load DMA Activation Bit AND mask 0809FBAA: 4010 and r0, r2 0809FBAC: 2800 cmp r0, #0x00 0809FBAE: D005 beq 0x0809FBBC ; Branch if DMA has finished 0809FBB0: 2280 mov r2, #0x80 0809FBB2: 0612 lsl r2, r2, #0x18 0809FBB4: 6898 ldr r0, [r3, #0x08] 0809FBB6: 4010 and r0, r2 0809FBB8: 2800 cmp r0, #0x00 0809FBBA: D1FB bne 0x0809FBB4 ; Loop if DMA has not finished 0809FBBC: 1C3A add r2, r7, #0x0 ; Restore DMA Source Address 0809FBBE: 1C34 add r4, r6, #0x0 ; Restore DMA Destination 0809FBC0: 0428 lsl r0, r5, #0x10 ; Load buffered Loop Counter, AND #$0000FFFF 0809FBC2: 0C03 lsr r3, r0, #0x10 0809FBC4: 2B01 cmp r3, #0x01 0809FBC6: D9D0 bls 0x0809FB6A ; Loop until it reached #$02 0809FBC8: BC18 pop {r3, r4} ; Exit 0809FBCA: 4698 mov r8, r3 0809FBCC: 46A1 mov r9, r4 0809FBCE: BCF0 pop {r4, r5, r6, r7} 0809FBD0: BC01 pop {r0} 0809FBD2: 4700 bx r0 ;0809FBD4: 24C0 mov r4, #0xC0 ;0809FBD6: 0879 lsr r1, r7, #0x1 ;0809FBD8: 00D4 lsl r4, r2, #0x3 ;0809FBDA: 0400 lsl r0, r0, #0x10 ;0809FBDC: 0040 lsl r0, r0, #0x1 ;0809FBDE: 8000 strh r0, [r0]
$0809FBE0 - (Graphic Transfer of Unknown Data)
0809FBE0: B530 push {r4, r5, lr} 0809FBE2: 1C01 add r1, r0, #0x0 0809FBE4: 0409 lsl r1, r1, #0x10 0809FBE6: 0C09 lsr r1, r1, #0x10 0809FBE8: 4D0B ldr r5, =#0x0879CDC4 ; Address Table address 0809FBEA: 004C lsl r4, r1, #0x1 0809FBEC: 0449 lsl r1, r1, #0x11 0809FBEE: 0C09 lsr r1, r1, #0x10 0809FBF0: 1C28 add r0, r5, #0x0 0809FBF2: F01E bl 0809FBF4: FB9D bl 0x080BE330 ; Load Address Table entry 0809FBF6: 4909 ldr r1, =#0x06000800 0809FBF8: F01F bl 0809FBFA: FEDC bl 0x080BF9B4 0809FBFC: 3401 add r4, #0x01 0809FBFE: 0424 lsl r4, r4, #0x10 0809FC00: 0C24 lsr r4, r4, #0x10 0809FC02: 1C28 add r0, r5, #0x0 0809FC04: 1C21 add r1, r4, #0x0 0809FC06: F01E bl 0809FC08: FB93 bl 0x080BE330 ; Load Address Table entry 0809FC0A: 2103 mov r1, #0x03 0809FC0C: 2220 mov r2, #0x20 0809FC0E: F01E bl 0809FC10: F88B bl 0x080BDD28 0809FC12: BC30 pop {r4, r5} 0809FC14: BC01 pop {r0} 0809FC16: 4700 bx r0 ;0809FC18: CDC4 ldmia r5!, {r2, r6, r7} ;0809FC1A: 0879 lsr r1, r7, #0x1 ;0809FC1C: 0800 lsr r0, r0, #0x0 ;0809FC1E: 0600 lsl r0, r0, #0x18
$0809FC9C - (VRAM Transfer of unknown data)
This is one DMA with fixed data that get transfered to VRAM.
0809FC9C: 4908 ldr r1, =#0x040000D4 0809FC9E: 4809 ldr r0, =#0x08628E2C 0809FCA0: 6008 str r0, [r1] 0809FCA2: 4809 ldr r0, =#0x06011800 0809FCA4: 6048 str r0, [r1, #0x04] 0809FCA6: 4809 ldr r0, =#0x80000200 0809FCA8: 6088 str r0, [r1, #0x08] 0809FCAA: 6888 ldr r0, [r1, #0x08] 0809FCAC: 6888 ldr r0, [r1, #0x08] 0809FCAE: 2280 mov r2, #0x80 0809FCB0: 0612 lsl r2, r2, #0x18 0809FCB2: 2800 cmp r0, #0x00 0809FCB4: DA03 bge 0x0809FCBE 0809FCB6: 6888 ldr r0, [r1, #0x08] 0809FCB8: 4010 and r0, r2 0809FCBA: 2800 cmp r0, #0x00 0809FCBC: D1FB bne 0x0809FCB6 0809FCBE: 4770 bx lr ;0809FCC0: 00D4 lsl r4, r2, #0x3 ;0809FCC2: 0400 lsl r0, r0, #0x10 ;0809FCC4: 8E2C ldrh r4, [r5, #0x30] ;0809FCC6: 0862 lsr r2, r4, #0x1 ;0809FCC8: 1800 add r0, r0, r0 ;0809FCCA: 0601 lsl r1, r0, #0x18 ;0809FCCC: 0200 lsl r0, r0, #0x8 ;0809FCCE: 8000 strh r0, [r0]
$0809FCD0 - ?
r0 contains a byte-sized value
0809FCD0: B5F0 push {r4, r5, r6, r7, lr} 0809FCD2: 464F mov r7, r9 0809FCD4: 4646 mov r6, r8 0809FCD6: B4C0 push {r6, r7} 0809FCD8: B081 add sp, #-0x004 ; Add new Stack entry 0809FCDA: 4669 mov r1, sp 0809FCDC: 7008 strb r0, [r1] ; Store r0 on stack 0809FCDE: 4D38 ldr r5, =#0x087A322C 0809FCE0: 1C28 add r0, r5, #0x0 0809FCE2: 2106 mov r1, #0x06 0809FCE4: F01E bl 0809FCE6: FB24 bl 0x080BE330 ; Load Address Table entry 0809FCE8: 1C04 add r4, r0, #0x0 ; Store loaded Address in r4 0809FCEA: 2280 mov r2, #0x80 0809FCEC: 0092 lsl r2, r2, #0x2 0809FCEE: 2100 mov r1, #0x00 0809FCF0: F01E bl 0809FCF2: F81A bl 0x080BDD28 ; Transfer to Tilemap Buffer? 0809FCF4: 46A0 mov r8, r4 ; r8 = Loaded address 0809FCF6: 4B33 ldr r3, =#0x02032700 0809FCF8: 6859 ldr r1, [r3, #0x04] ; (Load address of the Tilemap Buffer?) 0809FCFA: 7822 ldrb r2, [r4] ; Load the first byte of the Address 0809FCFC: 241F mov r4, #0x1F 0809FCFE: 1C20 add r0, r4, #0x0 0809FD00: 4010 and r0, r2 0809FD02: 4A31 ldr r2, =#0x00001F08 0809FD04: 1889 add r1, r1, r2 0809FD06: 780A ldrb r2, [r1] 0809FD08: 7008 strb r0, [r1] 0809FD0A: 6859 ldr r1, [r3, #0x04] 0809FD0C: 4642 mov r2, r8 0809FD0E: 8810 ldrh r0, [r2] 0809FD10: 0940 lsr r0, r0, #0x5 0809FD12: 4020 and r0, r4 0809FD14: 4A2D ldr r2, =#0x00001F09 0809FD16: 1889 add r1, r1, r2 0809FD18: 780A ldrb r2, [r1] 0809FD1A: 7008 strb r0, [r1] 0809FD1C: 6859 ldr r1, [r3, #0x04] 0809FD1E: 4642 mov r2, r8 0809FD20: 8810 ldrh r0, [r2] 0809FD22: 0A80 lsr r0, r0, #0xA 0809FD24: 4020 and r0, r4 0809FD26: 4A2A ldr r2, =#0x00001F0A 0809FD28: 1889 add r1, r1, r2 0809FD2A: 780A ldrb r2, [r1] 0809FD2C: 7008 strb r0, [r1] 0809FD2E: 1C28 add r0, r5, #0x0 0809FD30: 2104 mov r1, #0x04 0809FD32: F01E bl 0809FD34: FAFD bl 0x080BE330 0809FD36: 1C01 add r1, r0, #0x0 0809FD38: 4F26 ldr r7, =#0x06010800 0809FD3A: 2600 mov r6, #0x00 0809FD3C: 4B26 ldr r3, =#0x040000D4 0809FD3E: 46A9 mov r9, r5 0809FD40: 4826 ldr r0, =#0x80000040 0809FD42: 4684 mov r12, r0 0809FD44: 6019 str r1, [r3] 0809FD46: 605F str r7, [r3, #0x04] 0809FD48: 4662 mov r2, r12 0809FD4A: 609A str r2, [r3, #0x08] 0809FD4C: 6898 ldr r0, [r3, #0x08] 0809FD4E: 6898 ldr r0, [r3, #0x08] 0809FD50: 2280 mov r2, #0x80 0809FD52: 0612 lsl r2, r2, #0x18 0809FD54: 1C0C add r4, r1, #0x0 0809FD56: 3480 add r4, #0x80 0809FD58: 1C75 add r5, r6, #0x1 0809FD5A: 2800 cmp r0, #0x00 0809FD5C: DA04 bge 0x0809FD68 0809FD5E: 1C11 add r1, r2, #0x0 0809FD60: 6898 ldr r0, [r3, #0x08] 0809FD62: 4008 and r0, r1 0809FD64: 2800 cmp r0, #0x00 0809FD66: D1FB bne 0x0809FD60 0809FD68: 1C21 add r1, r4, #0x0 0809FD6A: 2080 mov r0, #0x80 0809FD6C: 00C0 lsl r0, r0, #0x3 0809FD6E: 183F add r7, r7, r0 0809FD70: 0428 lsl r0, r5, #0x10 0809FD72: 0C06 lsr r6, r0, #0x10 0809FD74: 2E03 cmp r6, #0x03 0809FD76: D9E5 bls 0x0809FD44 0809FD78: 4648 mov r0, r9 0809FD7A: 2105 mov r1, #0x05 0809FD7C: F01E bl 0809FD7E: FAD8 bl 0x080BE330 0809FD80: 1C04 add r4, r0, #0x0 0809FD82: 211C mov r1, #0x1C 0809FD84: 2220 mov r2, #0x20 0809FD86: F01D bl 0809FD88: FFCF bl 0x080BDD28 0809FD8A: 4668 mov r0, sp 0809FD8C: 7800 ldrb r0, [r0] 0809FD8E: 2800 cmp r0, #0x00 0809FD90: D028 beq 0x0809FDE4 0809FD92: 4648 mov r0, r9 0809FD94: 2107 mov r1, #0x07 0809FD96: F01E bl 0809FD98: FACB bl 0x080BE330 0809FD9A: 1C01 add r1, r0, #0x0 0809FD9C: 4F10 ldr r7, =#0x06004000 0809FD9E: 1C39 add r1, r7, #0x0 0809FDA0: F01F bl 0809FDA2: FE08 bl 0x080BF9B4 0809FDA4: 4648 mov r0, r9 0809FDA6: 2108 mov r1, #0x08 0809FDA8: F01E bl 0809FDAA: FAC2 bl 0x080BE330 0809FDAC: 1C01 add r1, r0, #0x0 0809FDAE: 2083 mov r0, #0x83 0809FDB0: 0180 lsl r0, r0, #0x6 0809FDB2: 183F add r7, r7, r0 0809FDB4: 1C08 add r0, r1, #0x0 0809FDB6: 1C39 add r1, r7, #0x0 0809FDB8: F01F bl 0809FDBA: FDFC bl 0x080BF9B4 0809FDBC: E017 b 0x0809FDEE ;0809FDBE: 0000 lsl r0, r0, #0x0 ;0809FDC0: 322C add r2, #0x2C ;0809FDC2: 087A lsr r2, r7, #0x1 ;0809FDC4: 2700 mov r7, #0x00 ;0809FDC6: 0203 lsl r3, r0, #0x8 ;0809FDC8: 1F08 sub r0, r1, #0x4 ;0809FDCA: 0000 lsl r0, r0, #0x0 ;0809FDCC: 1F09 sub r1, r1, #0x4 ;0809FDCE: 0000 lsl r0, r0, #0x0 ;0809FDD0: 1F0A sub r2, r1, #0x4 ;0809FDD2: 0000 lsl r0, r0, #0x0 ;0809FDD4: 0800 lsr r0, r0, #0x0 ;0809FDD6: 0601 lsl r1, r0, #0x18 ;0809FDD8: 00D4 lsl r4, r2, #0x3 ;0809FDDA: 0400 lsl r0, r0, #0x10 ;0809FDDC: 0040 lsl r0, r0, #0x1 ;0809FDDE: 8000 strh r0, [r0] ;0809FDE0: 4000 and r0, r0 ;0809FDE2: 0600 lsl r0, r0, #0x18 0809FDE4: 21A0 mov r1, #0xA0 0809FDE6: 04C9 lsl r1, r1, #0x13 0809FDE8: 4642 mov r2, r8 0809FDEA: 8810 ldrh r0, [r2] 0809FDEC: 8008 strh r0, [r1] 0809FDEE: 4811 ldr r0, =#0x080C43F4 0809FDF0: 2280 mov r2, #0x80 0809FDF2: 0052 lsl r2, r2, #0x1 0809FDF4: 2102 mov r1, #0x02 0809FDF6: F000 bl 0809FDF8: FA29 bl 0x080A024C 0809FDFA: 480F ldr r0, =#0x080C464C 0809FDFC: 4A0F ldr r2, =#0x00000183 0809FDFE: 2103 mov r1, #0x03 0809FE00: F000 bl 0809FE02: FA24 bl 0x080A024C 0809FE04: 4A0E ldr r2, =#0x02032700 0809FE06: 6850 ldr r0, [r2, #0x04] 0809FE08: 490E ldr r1, =#0x00001F02 0809FE0A: 1840 add r0, r0, r1 0809FE0C: 7801 ldrb r1, [r0] 0809FE0E: 2101 mov r1, #0x01 0809FE10: 7001 strb r1, [r0] 0809FE12: 6850 ldr r0, [r2, #0x04] 0809FE14: 4A0C ldr r2, =#0x00001F03 0809FE16: 1880 add r0, r0, r2 0809FE18: 7802 ldrb r2, [r0] 0809FE1A: 7001 strb r1, [r0] 0809FE1C: 480B ldr r0, =#0x080C2A58 0809FE1E: 211F mov r1, #0x1F 0809FE20: 2220 mov r2, #0x20 0809FE22: F01D bl 0809FE24: FF81 bl 0x080BDD28 0809FE26: B001 add sp, #0x004 0809FE28: BC18 pop {r3, r4} 0809FE2A: 4698 mov r8, r3 0809FE2C: 46A1 mov r9, r4 0809FE2E: BCF0 pop {r4, r5, r6, r7} 0809FE30: BC01 pop {r0} 0809FE32: 4700 bx r0 ;0809FE34: 43F4 mvn r4, r6 ;0809FE36: 080C lsr r4, r1, #0x0 ;0809FE38: 464C mov r4, r9 ;0809FE3A: 080C lsr r4, r1, #0x0 ;0809FE3C: 0183 lsl r3, r0, #0x6 ;0809FE3E: 0000 lsl r0, r0, #0x0 ;0809FE40: 2700 mov r7, #0x00 ;0809FE42: 0203 lsl r3, r0, #0x8 ;0809FE44: 1F02 sub r2, r0, #0x4 ;0809FE46: 0000 lsl r0, r0, #0x0 ;0809FE48: 1F03 sub r3, r0, #0x4 ;0809FE4A: 0000 lsl r0, r0, #0x0 ;0809FE4C: 2A58 cmp r2, #0x58 ;0809FE4E: 080C lsr r4, r1, #0x0
$0809FE50 - Transfer of Alphabet Button Graphics (Name Screen)
This transfers the graphics for the Alphabet Buttons on the Name Screen. These are Buttons to switch between Latin Alphabet, Katakana and Hiragana.
0809FE50: B530 push {r4, r5, lr} 0809FE52: 4821 ldr r0, =#0x087A322C 0809FE54: 2100 mov r1, #0x00 0809FE56: F01E bl 0809FE58: FA6B bl 0x080BE330 ; Load Address Table entry 0809FE5A: 4920 ldr r1, =#0x040000D4 0809FE5C: 6008 str r0, [r1] ; $040000D4 = #$087A3258 0809FE5E: 4820 ldr r0, =#0x06011800 ; DMA to VRAM 0809FE60: 6048 str r0, [r1, #0x04] 0809FE62: 4820 ldr r0, =#0x80000400 0809FE64: 6088 str r0, [r1, #0x08] 0809FE66: 6888 ldr r0, [r1, #0x08] 0809FE68: 6888 ldr r0, [r1, #0x08] 0809FE6A: 2280 mov r2, #0x80 0809FE6C: 0612 lsl r2, r2, #0x18 0809FE6E: 2800 cmp r0, #0x00 0809FE70: DA03 bge 0x0809FE7A 0809FE72: 6888 ldr r0, [r1, #0x08] 0809FE74: 4010 and r0, r2 0809FE76: 2800 cmp r0, #0x00 0809FE78: D1FB bne 0x0809FE72 0809FE7A: 4C17 ldr r4, =#0x087A322C 0809FE7C: 1C20 add r0, r4, #0x0 0809FE7E: 2101 mov r1, #0x01 0809FE80: F01E bl 0809FE82: FA56 bl 0x080BE330 ; Load Address Table entry 0809FE84: 1C05 add r5, r0, #0x0 0809FE86: 211A mov r1, #0x1A 0809FE88: 2220 mov r2, #0x20 0809FE8A: F01D bl 0809FE8C: FF4D bl 0x080BDD28 ; DMA to Tilemap Buffer? 0809FE8E: 1C28 add r0, r5, #0x0 0809FE90: 211B mov r1, #0x1B 0809FE92: 2220 mov r2, #0x20 0809FE94: F01D bl 0809FE96: FF48 bl 0x080BDD28 ; DMA to Tilemap Buffer? 0809FE98: 1C20 add r0, r4, #0x0 0809FE9A: 2102 mov r1, #0x02 0809FE9C: F01E bl 0809FE9E: FA48 bl 0x080BE330 ; Load Address Table entry 0809FEA0: 490E ldr r1, =#0x040000D4 0809FEA2: 6008 str r0, [r1] 0809FEA4: 4810 ldr r0, =#0x06010380 0809FEA6: 6048 str r0, [r1, #0x04] 0809FEA8: 4810 ldr r0, =#0x80000040 0809FEAA: 6088 str r0, [r1, #0x08] 0809FEAC: 6888 ldr r0, [r1, #0x08] 0809FEAE: 6888 ldr r0, [r1, #0x08] 0809FEB0: 2280 mov r2, #0x80 0809FEB2: 0612 lsl r2, r2, #0x18 0809FEB4: 2800 cmp r0, #0x00 0809FEB6: DA03 bge 0x0809FEC0 0809FEB8: 6888 ldr r0, [r1, #0x08] 0809FEBA: 4010 and r0, r2 0809FEBC: 2800 cmp r0, #0x00 0809FEBE: D1FB bne 0x0809FEB8 0809FEC0: 4805 ldr r0, =#0x087A322C 0809FEC2: 2103 mov r1, #0x03 0809FEC4: F01E bl 0809FEC6: FA34 bl 0x080BE330 ; Load Address Table entry 0809FEC8: 1C05 add r5, r0, #0x0 0809FECA: 211D mov r1, #0x1D 0809FECC: 2220 mov r2, #0x20 0809FECE: F01D bl 0809FED0: FF2B bl 0x080BDD28 ; DMA to Tilemap Buffer? 0809FED2: BC30 pop {r4, r5} 0809FED4: BC01 pop {r0} 0809FED6: 4700 bx r0 ;0809FED8: 322C add r2, #0x2C ;0809FEDA: 087A lsr r2, r7, #0x1 ;0809FEDC: 00D4 lsl r4, r2, #0x3 ;0809FEDE: 0400 lsl r0, r0, #0x10 ;0809FEE0: 1800 add r0, r0, r0 ;0809FEE2: 0601 lsl r1, r0, #0x18 ;0809FEE4: 0400 lsl r0, r0, #0x10 ;0809FEE6: 8000 strh r0, [r0] ;0809FEE8: 0380 lsl r0, r0, #0xE ;0809FEEA: 0601 lsl r1, r0, #0x18 ;0809FEEC: 0040 lsl r0, r0, #0x1 ;0809FEEE: 8000 strh r0, [r0]
$0809FEF0 - (Optional VRAM DMA?)
r0 contains an address
0809FEF0: B500 push {lr} 0809FEF2: 1C03 add r3, r0, #0x0 ; Buffer Original r0 0809FEF4: 3036 add r0, #0x36 ; r0 = r0 + #$36 0809FEF6: 7800 ldrb r0, [r0] ; Load Byte there 0809FEF8: 2800 cmp r0, #0x00 ; If it is empty, leave this DMA out 0809FEFA: D00F beq 0x0809FF1C 0809FEFC: 490B ldr r1, =#0x040000D4 0809FEFE: 6818 ldr r0, [r3] ; DMA Source address = Original r0 0809FF00: 6008 str r0, [r1] 0809FF02: 480B ldr r0, =#0x06011800 0809FF04: 6048 str r0, [r1, #0x04] ; Destination: VRAM 0809FF06: 8E98 ldrh r0, [r3, #0x34] ; Original r0 + #$34 contains the number of bytes to transfer (Double byte sized) 0809FF08: 0840 lsr r0, r0, #0x1 ; div 2 (Now: Number of double bytes to transfer) 0809FF0A: 2280 mov r2, #0x80 0809FF0C: 0612 lsl r2, r2, #0x18 ; DMA activation Bit 0809FF0E: 4310 orr r0, r2 ; Add Act. Bit to No. of Double Bytes to transfer 0809FF10: 6088 str r0, [r1, #0x08] 0809FF12: 6888 ldr r0, [r1, #0x08] 0809FF14: 6888 ldr r0, [r1, #0x08] 0809FF16: 4010 and r0, r2 0809FF18: 2800 cmp r0, #0x00 0809FF1A: D1FB bne 0x0809FF14 ; Loop until DMA is done 0809FF1C: 69D8 ldr r0, [r3, #0x1C] 0809FF1E: 2110 mov r1, #0x10 0809FF20: 2220 mov r2, #0x20 0809FF22: F01D bl 0809FF24: FF01 bl 0x080BDD28 0809FF26: BC01 pop {r0} 0809FF28: 4700 bx r0 ;0809FF2A: 0000 lsl r0, r0, #0x0 ;0809FF2C: 00D4 lsl r4, r2, #0x3 ;0809FF2E: 0400 lsl r0, r0, #0x10 ;0809FF30: 1800 add r0, r0, r0 ;0809FF32: 0601 lsl r1, r0, #0x18
$0809FF34 - ?
r0 contains the number of an Data Address Table *2
r1 contains an entry number for the Jump Table in this subroutine
0809FF34: B5F0 push {r4, r5, r6, r7, lr} 0809FF36: 4657 mov r7, r10 0809FF38: 464E mov r6, r9 0809FF3A: 4645 mov r5, r8 0809FF3C: B4E0 push {r5, r6, r7} 0809FF3E: B081 add sp, #-0x004 ; Add another 4 Bytes to Stack 0809FF40: 4699 mov r9, r3 0809FF42: 9B09 ldr r3, [sp, #0x024] ; ? 0809FF44: 0400 lsl r0, r0, #0x10 0809FF46: 0C06 lsr r6, r0, #0x10 ; r6 = r0 AND #$0000FFFF 0809FF48: 0409 lsl r1, r1, #0x10 0809FF4A: 0C09 lsr r1, r1, #0x10 ; r1 AND #$0000FFFF 0809FF4C: 4688 mov r8, r1 ; r8 = r1 0809FF4E: 0412 lsl r2, r2, #0x10 0809FF50: 0C15 lsr r5, r2, #0x10 ; r5 = r2 AND #$0000FFFF 0809FF52: 041B lsl r3, r3, #0x10 0809FF54: 0C1B lsr r3, r3, #0x10 ; r3 AND #$0000FFFF 0809FF56: 469A mov r10, r3 ; r10 = r3 0809FF58: 4806 ldr r0, =#0x087A715C ; Data Address Table address 0809FF5A: 0471 lsl r1, r6, #0x11 0809FF5C: 0C09 lsr r1, r1, #0x10 ; r1 = Original r0 * 2 - Entry Number for the Data Address Table 0809FF5E: F01E bl 0809FF60: F9E7 bl 0x080BE330 ; Load address from address table 0809FF62: 1C04 add r4, r0, #0x0 ; Store loaded address in r4 0809FF64: 4640 mov r0, r8 ; Load Jump Table Entry number 0809FF66: 2805 cmp r0, #0x05 0809FF68: D835 bhi 0x0809FFD6 ; Leave Jump Table stuff out if Jump Table entry number is invalid (too high) 0809FF6A: 0080 lsl r0, r0, #0x2 ; Jump to Jump Table Entry 0809FF6C: 4902 ldr r1, =#0x0809FF7C 0809FF6E: 1840 add r0, r0, r1 0809FF70: 6800 ldr r0, [r0] 0809FF72: 4687 mov pc, r0 ;0809FF74: 715C strb r4, [r3, #0x05] ;0809FF76: 087A lsr r2, r7, #0x1 ;0809FF78: FF7C bl 0x0811AE72 ;0809FF7A: 0809 lsr r1, r1, #0x0 ; JUMP TABLE ; entry 00: $0809FFB4 ; entry 01: $0809FF94 ; entry 02: $0809FFA0 ; entry 03: $0809FFAE ; entry 04: $0809FFBC ; entry 05: $0809FFC8 ;0809FF7C: FFB4 bl 0x080A9EE6 ;0809FF7E: 0809 lsr r1, r1, #0x0 ;0809FF80: FF94 bl 0x080A9EAA ;0809FF82: 0809 lsr r1, r1, #0x0 ;0809FF84: FFA0 bl 0x080A9EC6 ;0809FF86: 0809 lsr r1, r1, #0x0 ;0809FF88: FFAE bl 0x080A9EE6 ;0809FF8A: 0809 lsr r1, r1, #0x0 ;0809FF8C: FFBC bl 0x080A9F06 ;0809FF8E: 0809 lsr r1, r1, #0x0 ;0809FF90: FFC8 bl 0x080A9F22 ;0809FF92: 0809 lsr r1, r1, #0x0 ; entry 01: $0809FF94 0809FF94: 2280 mov r2, #0x80 0809FF96: 0052 lsl r2, r2, #0x1 0809FF98: 18A4 add r4, r4, r2 0809FF9A: 2703 mov r7, #0x03 0809FF9C: 2002 mov r0, #0x02 0809FF9E: E01C b 0x0809FFDA ; entry 02: $0809FFA0 0809FFA0: 21C0 mov r1, #0xC0 0809FFA2: 0109 lsl r1, r1, #0x4 0809FFA4: 1864 add r4, r4, r1 0809FFA6: 2704 mov r7, #0x04 0809FFA8: 2202 mov r2, #0x02 0809FFAA: 9200 str r2, [sp] 0809FFAC: E016 b 0x0809FFDC ; entry 03: $0809FFAE 0809FFAE: 2080 mov r0, #0x80 0809FFB0: 0080 lsl r0, r0, #0x2 0809FFB2: 1824 add r4, r4, r0 ; entry 00: $0809FFB4 0809FFB4: 2703 mov r7, #0x03 0809FFB6: 2102 mov r1, #0x02 0809FFB8: 9100 str r1, [sp] 0809FFBA: E00F b 0x0809FFDC ; entry 04: $0809FFBC 0809FFBC: 22E0 mov r2, #0xE0 0809FFBE: 0152 lsl r2, r2, #0x5 0809FFC0: 18A4 add r4, r4, r2 0809FFC2: 2704 mov r7, #0x04 0809FFC4: 2004 mov r0, #0x04 0809FFC6: E008 b 0x0809FFDA ; entry 05: $0809FFC8 0809FFC8: 21C0 mov r1, #0xC0 0809FFCA: 0089 lsl r1, r1, #0x2 0809FFCC: 1864 add r4, r4, r1 0809FFCE: 2704 mov r7, #0x04 0809FFD0: 2204 mov r2, #0x04 0809FFD2: 9200 str r2, [sp] 0809FFD4: E002 b 0x0809FFDC 0809FFD6: 2700 mov r7, #0x00 0809FFD8: 2000 mov r0, #0x00 0809FFDA: 9000 str r0, [sp] ; Jump Table Leave-Out gets back in here 0809FFDC: 0168 lsl r0, r5, #0x5 0809FFDE: 9900 ldr r1, [sp] 0809FFE0: 4348 mul r0, r1 0809FFE2: 1824 add r4, r4, r0 0809FFE4: 4642 mov r2, r8 0809FFE6: 2A04 cmp r2, #0x04 0809FFE8: D104 bne 0x0809FFF4 0809FFEA: 2D07 cmp r5, #0x07 0809FFEC: D902 bls 0x0809FFF4 0809FFEE: 20A0 mov r0, #0xA0 0809FFF0: 0140 lsl r0, r0, #0x5 0809FFF2: 1824 add r4, r4, r0 0809FFF4: 2200 mov r2, #0x00 0809FFF6: 0076 lsl r6, r6, #0x1 0809FFF8: 46B4 mov r12, r6 0809FFFA: 2110 mov r1, #0x10 0809FFFC: 448A add r10, r1 0809FFFE: 42BA cmp r2, r7 080A0000: D21B bcs 0x080A003A 080A0002: 4B23 ldr r3, =#0x040000D4 080A0004: 9800 ldr r0, [sp] 080A0006: 0105 lsl r5, r0, #0x4 080A0008: 2680 mov r6, #0x80 080A000A: 0636 lsl r6, r6, #0x18 080A000C: 4335 orr r5, r6 080A000E: 0291 lsl r1, r2, #0xA 080A0010: 1860 add r0, r4, r1 080A0012: 6018 str r0, [r3] 080A0014: 4449 add r1, r9 080A0016: 6059 str r1, [r3, #0x04] 080A0018: 609D str r5, [r3, #0x08] 080A001A: 6898 ldr r0, [r3, #0x08] 080A001C: 6898 ldr r0, [r3, #0x08] 080A001E: 4030 and r0, r6 080A0020: 1C51 add r1, r2, #0x1 080A0022: 2800 cmp r0, #0x00 080A0024: D005 beq 0x080A0032 080A0026: 2280 mov r2, #0x80 080A0028: 0612 lsl r2, r2, #0x18 080A002A: 6898 ldr r0, [r3, #0x08] 080A002C: 4010 and r0, r2 080A002E: 2800 cmp r0, #0x00 080A0030: D1FB bne 0x080A002A 080A0032: 0408 lsl r0, r1, #0x10 080A0034: 0C02 lsr r2, r0, #0x10 080A0036: 42BA cmp r2, r7 080A0038: D3E9 bcc 0x080A000E 080A003A: 4641 mov r1, r8 080A003C: 2904 cmp r1, #0x04 080A003E: D111 bne 0x080A0064 080A0040: 4913 ldr r1, =#0x040000D4 080A0042: 02B8 lsl r0, r7, #0xA 080A0044: 1820 add r0, r4, r0 080A0046: 6008 str r0, [r1] 080A0048: 9A00 ldr r2, [sp] 080A004A: 0150 lsl r0, r2, #0x5 080A004C: 4448 add r0, r9 080A004E: 6048 str r0, [r1, #0x04] 080A0050: 0110 lsl r0, r2, #0x4 080A0052: 2280 mov r2, #0x80 080A0054: 0612 lsl r2, r2, #0x18 080A0056: 4310 orr r0, r2 080A0058: 6088 str r0, [r1, #0x08] 080A005A: 6888 ldr r0, [r1, #0x08] 080A005C: 6888 ldr r0, [r1, #0x08] 080A005E: 4010 and r0, r2 080A0060: 2800 cmp r0, #0x00 080A0062: D1FB bne 0x080A005C 080A0064: 4661 mov r1, r12 080A0066: 3101 add r1, #0x01 080A0068: 0409 lsl r1, r1, #0x10 080A006A: 0C09 lsr r1, r1, #0x10 080A006C: 4809 ldr r0, =#0x087A715C 080A006E: F01E bl 080A0070: F95F bl 0x080BE330 080A0072: 4652 mov r2, r10 080A0074: 0411 lsl r1, r2, #0x10 080A0076: 0C09 lsr r1, r1, #0x10 080A0078: 2220 mov r2, #0x20 080A007A: F01D bl 080A007C: FE55 bl 0x080BDD28 080A007E: B001 add sp, #0x004 080A0080: BC38 pop {r3, r4, r5} 080A0082: 4698 mov r8, r3 080A0084: 46A1 mov r9, r4 080A0086: 46AA mov r10, r5 080A0088: BCF0 pop {r4, r5, r6, r7} 080A008A: BC01 pop {r0} 080A008C: 4700 bx r0 ;080A008E: 0000 lsl r0, r0, #0x0 ;080A0090: 00D4 lsl r4, r2, #0x3 ;080A0092: 0400 lsl r0, r0, #0x10 ;080A0094: 715C strb r4, [r3, #0x05] ;080A0096: 087A lsr r2, r7, #0x1
$080A0098 - ?
080A0098: B5F0 push {r4, r5, r6, r7, lr} 080A009A: 4E1C ldr r6, =#0x06013800 080A009C: 2500 mov r5, #0x00 080A009E: 481C ldr r0, =#0x02032700 080A00A0: 491C ldr r1, =#0x0000943E 080A00A2: 1840 add r0, r0, r1 080A00A4: 8801 ldrh r1, [r0] 080A00A6: 428D cmp r5, r1 080A00A8: D227 bcs 0x080A00FA 080A00AA: 1C07 add r7, r0, #0x0 080A00AC: 1C28 add r0, r5, #0x0 080A00AE: F01D bl 080A00B0: F937 bl 0x080BD320 080A00B2: 1C04 add r4, r0, #0x0 080A00B4: 88E2 ldrh r2, [r4, #0x06] 080A00B6: 09D2 lsr r2, r2, #0x7 080A00B8: 7A21 ldrb r1, [r4, #0x08] 080A00BA: 201F mov r0, #0x1F 080A00BC: 4001 and r1, r0 080A00BE: 0249 lsl r1, r1, #0x9 080A00C0: 4311 orr r1, r2 080A00C2: 68A2 ldr r2, [r4, #0x08] 080A00C4: 0352 lsl r2, r2, #0xD 080A00C6: 0C92 lsr r2, r2, #0x12 080A00C8: 1C30 add r0, r6, #0x0 080A00CA: F000 bl 080A00CC: F827 bl 0x080A011C 080A00CE: 2180 mov r1, #0x80 080A00D0: 00C9 lsl r1, r1, #0x3 080A00D2: 1870 add r0, r6, r1 080A00D4: 8963 ldrh r3, [r4, #0x0A] 080A00D6: 08DB lsr r3, r3, #0x3 080A00D8: 7B21 ldrb r1, [r4, #0x0C] 080A00DA: 2201 mov r2, #0x01 080A00DC: 4011 and r1, r2 080A00DE: 0349 lsl r1, r1, #0xD 080A00E0: 4319 orr r1, r3 080A00E2: 89A2 ldrh r2, [r4, #0x0C] 080A00E4: 0452 lsl r2, r2, #0x11 080A00E6: 0C92 lsr r2, r2, #0x12 080A00E8: F000 bl 080A00EA: F818 bl 0x080A011C 080A00EC: 3680 add r6, #0x80 080A00EE: 1C68 add r0, r5, #0x1 080A00F0: 0400 lsl r0, r0, #0x10 080A00F2: 0C05 lsr r5, r0, #0x10 080A00F4: 8838 ldrh r0, [r7] 080A00F6: 4285 cmp r5, r0 080A00F8: D3D8 bcc 0x080A00AC 080A00FA: 4807 ldr r0, =#0x0861440C 080A00FC: 2116 mov r1, #0x16 080A00FE: 2220 mov r2, #0x20 080A0100: F01D bl 080A0102: FE12 bl 0x080BDD28 080A0104: BCF0 pop {r4, r5, r6, r7} 080A0106: BC01 pop {r0} 080A0108: 4700 bx r0 ;080A010A: 0000 lsl r0, r0, #0x0 ;080A010C: 3800 sub r0, #0x00 ;080A010E: 0601 lsl r1, r0, #0x18 ;080A0110: 2700 mov r7, #0x00 ;080A0112: 0203 lsl r3, r0, #0x8 ;080A0114: 943E str r4, [sp, #0x0F8] ;080A0116: 0000 lsl r0, r0, #0x0 ;080A0118: 440C add r4, r1 ;080A011A: 0861 lsr r1, r4, #0x1
$080A05E4 - ?
This is executed when the game has broken save data
080A05E4: B500 push {lr} 080A05E6: 490E ldr r1, =#0x02032700 080A05E8: 480E ldr r0, =#0x00003ACC 080A05EA: 180A add r2, r1, r0 ; r2 = #$020361CC 080A05EC: 6810 ldr r0, [r2] 080A05EE: 3001 add r0, #0x01 ; Increment $020361CC 080A05F0: 6010 str r0, [r2] ; (value in testing: #$02B9) 080A05F2: 480D ldr r0, =#0x00003AD0 080A05F4: 180A add r2, r1, r0 ; r2 = #$020361D0 080A05F6: 6810 ldr r0, [r2] 080A05F8: 3001 add r0, #0x01 ; Increment $020361D0 080A05FA: 6010 str r0, [r2] ; (value in testing: #$02B9) 080A05FC: 480B ldr r0, =#0x00009448 080A05FE: 1809 add r1, r1, r0 ; r1 = #$0203BB48 080A0600: 7808 ldrb r0, [r1] ; (value in testing: #$03) 080A0602: 2806 cmp r0, #0x06 080A0604: DC03 bgt 0x080A060E ; Branch greater than #$06 080A0606: 2805 cmp r0, #0x05 080A0608: DB01 blt 0x080A060E ; Branch less than #$05 080A060A: F000 bl 080A060C: F811 bl 0x080A0630 080A060E: F000 bl 080A0610: F8DB bl 0x080A07C8 080A0612: 4903 ldr r1, =#0x02032700 080A0614: 6808 ldr r0, [r1] 080A0616: 6849 ldr r1, [r1, #0x04] 080A0618: F000 bl 080A061A: F81C bl 0x080A0654 080A061C: BC01 pop {r0} 080A061E: 4700 bx r0 ;080A0620: 2700 mov r7, #0x00 ;080A0622: 0203 lsl r3, r0, #0x8 ;080A0624: 3ACC sub r2, #0xCC ;080A0626: 0000 lsl r0, r0, #0x0 ;080A0628: 3AD0 sub r2, #0xD0 ;080A062A: 0000 lsl r0, r0, #0x0 ;080A062C: 9448 str r4, [sp, #0x120] ;080A062E: 0000 lsl r0, r0, #0x0
$080A0630 - (Upcounting/Resetting $0203BB5C)
Loads $0203BB5C, if it is > #$0CDFE5C3, $0203BB5C gets set to #$0CDEFE588, if not, the value gets incremented and sotred back.
080A0630: 4A03 ldr r2, =#0x0203BB5C 080A0632: 6811 ldr r1, [r2] 080A0634: 4803 ldr r0, =#0x0CDFE5C3 080A0636: 4281 cmp r1, r0 080A0638: D806 bhi 0x080A0648 080A063A: 1C48 add r0, r1, #0x1 080A063C: E005 b 0x080A064A ;080A063E: 0000 lsl r0, r0, #0x0 ;080A0640: BB5C pop {r2, r3, r4, r6, pc} ;080A0642: 0203 lsl r3, r0, #0x8 ;080A0644: E5C3 b 0x080A01CE ;080A0646: 0CDF lsr r7, r3, #0x13 080A0648: 4801 ldr r0, =#0x0CDFE588 080A064A: 6010 str r0, [r2] 080A064C: 4770 bx lr ;080A064E: 0000 lsl r0, r0, #0x0 ;080A0650: E588 b 0x080A0164 ;080A0652: 0CDF lsr r7, r3, #0x13
$080A07C8 - ?
080A07C8: B530 push {r4, r5, lr} 080A07CA: 4D0B ldr r5, =#0x02032700 ; r5 = #$02032700 080A07CC: 6868 ldr r0, [r5, #0x04] ; r0 = $02032704 080A07CE: F000 bl 080A07D0: F817 bl 0x080A0800 ; ? 080A07D2: F000 bl 080A07D4: F879 bl 0x080A08C8 ; (Work off Flags in $0203BB4F/50) 080A07D6: F000 bl 080A07D8: F97B bl 0x080A0AD0 ; ? 080A07DA: 4808 ldr r0, =#0x00003F04 080A07DC: 182C add r4, r5, r0 080A07DE: 1C20 add r0, r4, #0x0 ; r0 = #$02036604 080A07E0: F000 bl 080A07E2: F9D0 bl 0x080A0B84 ; ? 080A07E4: 1C20 add r0, r4, #0x0 ; r0 = #$02036604 080A07E6: F000 bl 080A07E8: FA7F bl 0x080A0CE8 ; ? 080A07EA: 6868 ldr r0, [r5, #0x04] 080A07EC: F000 bl 080A07EE: F83A bl 0x080A0864 ; ? 080A07F0: BC30 pop {r4, r5} 080A07F2: BC01 pop {r0} 080A07F4: 4700 bx r0 ;080A07F6: 0000 lsl r0, r0, #0x0 ;080A07F8: 2700 mov r7, #0x00 ;080A07FA: 0203 lsl r3, r0, #0x8 ;080A07FC: 3F04 sub r7, #0x04 ;080A07FE: 0000 lsl r0, r0, #0x0
$080A0800 - Update OAM (DMA or CpuFastSet)
This transfers the whole OAM buffer to OAM. If $020365EC is #$01, the CpuFastSet is used, else it's done by DMA.
080A0800: B500 push {lr} 080A0802: 1C02 add r2, r0, #0x0 ; r2 = r0 (in this case, #$0203CAD0) 080A0804: 480D ldr r0, =#0x02032700 080A0806: 490E ldr r1, =#0x00003EEC 080A0808: 1840 add r0, r0, r1 080A080A: 8800 ldrh r0, [r0] ; r0 = $020365EC 080A080C: 2801 cmp r0, #0x01 080A080E: D11D bne 0x080A084C 080A0810: 490C ldr r1, =#0x040000D4 ; DMA PREPARATION - UPDATE OAM (TRANSFER OAM BUFFER) 080A0812: 2396 mov r3, #0x96 080A0814: 015B lsl r3, r3, #0x5 ; r3 = #$000012C0 080A0816: 18D0 add r0, r2, r3 ; r2 = #$0203DD90 (OAM Buffer) 080A0818: 6008 str r0, [r1] ; Source 080A081A: 20E0 mov r0, #0xE0 080A081C: 04C0 lsl r0, r0, #0x13 080A081E: 6048 str r0, [r1, #0x04] ; Destination: OAM (#$07000000) 080A0820: 4809 ldr r0, =#0x80000200 080A0822: 6088 str r0, [r1, #0x08] ; Activate DMA, transfer #$200 Doublebytes (whole OAM) 080A0824: 6888 ldr r0, [r1, #0x08] 080A0826: 6888 ldr r0, [r1, #0x08] 080A0828: 2280 mov r2, #0x80 080A082A: 0612 lsl r2, r2, #0x18 080A082C: 2800 cmp r0, #0x00 080A082E: DA16 bge 0x080A085E ; Branch (exit) if DMA is done 080A0830: 6888 ldr r0, [r1, #0x08] 080A0832: 4010 and r0, r2 080A0834: 2800 cmp r0, #0x00 080A0836: D1FB bne 0x080A0830 ; Loop if DMA isn't done yet 080A0838: E011 b 0x080A085E ; Exit ;080A083A: 0000 lsl r0, r0, #0x0 ;080A083C: 2700 mov r7, #0x00 ;080A083E: 0203 lsl r3, r0, #0x8 ;080A0840: 3EEC sub r6, #0xEC ;080A0842: 0000 lsl r0, r0, #0x0 ;080A0844: 00D4 lsl r4, r2, #0x3 ;080A0846: 0400 lsl r0, r0, #0x10 ;080A0848: 0200 lsl r0, r0, #0x8 ;080A084A: 8000 strh r0, [r0] 080A084C: 2196 mov r1, #0x96 080A084E: 0149 lsl r1, r1, #0x5 080A0850: 1850 add r0, r2, r1 ; r0 = #$0203DD90 (OAM Buffer) 080A0852: 21E0 mov r1, #0xE0 080A0854: 04C9 lsl r1, r1, #0x13 ; r1 = #$07000000 (OAM) 080A0856: 2280 mov r2, #0x80 080A0858: 0052 lsl r2, r2, #0x1 ; r2 = #$00000100 (Number of OAM entries) 080A085A: F01F bl ; swi CpuFastSet 080A085C: F8A1 bl 0x080BF9A0 ; Transfers from r1 bytes from r0 to r2 080A085E: BC01 pop {r0} 080A0860: 4700 bx r0 ;080A0862: 0000 lsl r0, r0, #0x0
$080A0864 - ?
080A0864: B500 push {lr} 080A0866: 1C02 add r2, r0, #0x0 080A0868: 480D ldr r0, =#0x02032700 080A086A: 490E ldr r1, =#0x00003EEC 080A086C: 1840 add r0, r0, r1 080A086E: 8800 ldrh r0, [r0] 080A0870: 2801 cmp r0, #0x01 080A0872: D11D bne 0x080A08B0 080A0874: 490C ldr r1, =#0x040000D4 080A0876: 23CE mov r3, #0xCE 080A0878: 015B lsl r3, r3, #0x5 080A087A: 18D0 add r0, r2, r3 080A087C: 6008 str r0, [r1] 080A087E: 20A0 mov r0, #0xA0 080A0880: 04C0 lsl r0, r0, #0x13 080A0882: 6048 str r0, [r1, #0x04] 080A0884: 4809 ldr r0, =#0x80000200 080A0886: 6088 str r0, [r1, #0x08] 080A0888: 6888 ldr r0, [r1, #0x08] 080A088A: 6888 ldr r0, [r1, #0x08] 080A088C: 2280 mov r2, #0x80 080A088E: 0612 lsl r2, r2, #0x18 080A0890: 2800 cmp r0, #0x00 080A0892: DA16 bge 0x080A08C2 080A0894: 6888 ldr r0, [r1, #0x08] 080A0896: 4010 and r0, r2 080A0898: 2800 cmp r0, #0x00 080A089A: D1FB bne 0x080A0894 080A089C: E011 b 0x080A08C2 ;080A089E: 0000 lsl r0, r0, #0x0 ;080A08A0: 2700 mov r7, #0x00 ;080A08A2: 0203 lsl r3, r0, #0x8 ;080A08A4: 3EEC sub r6, #0xEC ;080A08A6: 0000 lsl r0, r0, #0x0 ;080A08A8: 00D4 lsl r4, r2, #0x3 ;080A08AA: 0400 lsl r0, r0, #0x10 ;080A08AC: 0200 lsl r0, r0, #0x8 ;080A08AE: 8000 strh r0, [r0] 080A08B0: 21CE mov r1, #0xCE 080A08B2: 0149 lsl r1, r1, #0x5 080A08B4: 1850 add r0, r2, r1 080A08B6: 21A0 mov r1, #0xA0 080A08B8: 04C9 lsl r1, r1, #0x13 080A08BA: 2280 mov r2, #0x80 080A08BC: 0052 lsl r2, r2, #0x1 080A08BE: F01F bl 080A08C0: F86F bl 0x080BF9A0 080A08C2: BC01 pop {r0} 080A08C4: 4700 bx r0 ;080A08C6: 0000 lsl r0, r0, #0x0
$080A08C8 - (Work off Flags in $0203BB4F/50)
080A08C8: B5F0 push {r4, r5, r6, r7, lr} 080A08CA: 464F mov r7, r9 080A08CC: 4646 mov r6, r8 080A08CE: B4C0 push {r6, r7} 080A08D0: B081 add sp, #-0x004 080A08D2: 4D3A ldr r5, =#0x02032700 080A08D4: 483A ldr r0, =#0x0000944F 080A08D6: 182C add r4, r5, r0 080A08D8: 7820 ldrb r0, [r4] ; r0 = $0203BB4F 080A08DA: 07C0 lsl r0, r0, #0x1F 080A08DC: 2800 cmp r0, #0x00 080A08DE: D001 beq 0x080A08E4 ; Branch if bit 0 of $0203BB4F is clear 080A08E0: F7FE bl 080A08E2: FAEC bl 0x0809EEBC 080A08E4: 7820 ldrb r0, [r4] 080A08E6: 0780 lsl r0, r0, #0x1E 080A08E8: 2800 cmp r0, #0x00 080A08EA: DA01 bge 0x080A08F0 ; Branch if bit 1 of $0203BB4F is clear 080A08EC: F7FE bl 080A08EE: FCAE bl 0x0809F24C 080A08F0: 7820 ldrb r0, [r4] 080A08F2: 0740 lsl r0, r0, #0x1D 080A08F4: 2800 cmp r0, #0x00 080A08F6: DA01 bge 0x080A08FC ; Branch if bit 2 of $0203BB4F is clear 080A08F8: F7FE bl 080A08FA: FD72 bl 0x0809F3E0 080A08FC: 7820 ldrb r0, [r4] 080A08FE: 0700 lsl r0, r0, #0x1C 080A0900: 2800 cmp r0, #0x00 080A0902: DA01 bge 0x080A0908 ; Branch if bit 3 of $0203BB4F is clear 080A0904: F7FE bl 080A0906: FDA4 bl 0x0809F450 080A0908: 7820 ldrb r0, [r4] 080A090A: 06C0 lsl r0, r0, #0x1B 080A090C: 2800 cmp r0, #0x00 080A090E: DA04 bge 0x080A091A ; Branch if bit 4 of $0203BB4F is clear 080A0910: 492C ldr r1, =#0x0000944C 080A0912: 1868 add r0, r5, r1 ; r0 = 0203BB4C 080A0914: 7800 ldrb r0, [r0] 080A0916: F7FE bl 080A0918: FDD3 bl 0x0809F4C0 080A091A: 7820 ldrb r0, [r4] 080A091C: 0680 lsl r0, r0, #0x1A 080A091E: 2800 cmp r0, #0x00 080A0920: DA01 bge 0x080A0926 ; Branch if bit 5 of $0203BB4F is clear 080A0922: F7FE bl 080A0924: FE0B bl 0x0809F53C 080A0926: 4A28 ldr r2, =#0x00003AEC 080A0928: 18A8 add r0, r5, r2 080A092A: F7FE bl 080A092C: FC15 bl 0x0809F158 080A092E: 7820 ldrb r0, [r4] 080A0930: 0640 lsl r0, r0, #0x19 080A0932: 2800 cmp r0, #0x00 080A0934: DA03 bge 0x080A093E ; Branch if bit 6 of $0203BB4F is clear 080A0936: 4925 ldr r1, =#0x00008FD0 080A0938: 1868 add r0, r5, r1 080A093A: F7FE bl 080A093C: FE2F bl 0x0809F59C 080A093E: 7820 ldrb r0, [r4] 080A0940: 09C0 lsr r0, r0, #0x7 080A0942: 2800 cmp r0, #0x00 080A0944: D001 beq 0x080A094A ; Branch if bit 7 of $0203BB4F is clear 080A0946: F7FF bl 080A0948: F9A9 bl 0x0809FC9C 080A094A: 4A21 ldr r2, =#0x00009450 080A094C: 18AC add r4, r5, r2 080A094E: 7820 ldrb r0, [r4] 080A0950: 07C0 lsl r0, r0, #0x1F 080A0952: 2800 cmp r0, #0x00 080A0954: D004 beq 0x080A0960 ; Branch if bit 0 of $0203BB50 is clear
080A0956: 491F ldr r1, =#0x0000944B 080A0958: 1868 add r0, r5, r1 080A095A: 7800 ldrb r0, [r0] 080A095C: F7FF bl 080A095E: F940 bl 0x0809FBE0 080A0960: 7820 ldrb r0, [r4] 080A0962: 0780 lsl r0, r0, #0x1E 080A0964: 2800 cmp r0, #0x00 080A0966: DA04 bge 0x080A0972 ; Branch if bit 1 of $0203BB50 is clear 080A0968: 4A1B ldr r2, =#0x0000944A 080A096A: 18A8 add r0, r5, r2 080A096C: 7800 ldrb r0, [r0] 080A096E: F7FE bl 080A0970: FFA5 bl 0x0809F8BC 080A0972: 7820 ldrb r0, [r4] 080A0974: 0740 lsl r0, r0, #0x1D 080A0976: 2800 cmp r0, #0x00 080A0978: DA01 bge 0x080A097E ; Branch if bit 2 of $0203BB50 is clear 080A097A: F7FE bl 080A097C: FFCF bl 0x0809F91C 080A097E: 7820 ldrb r0, [r4] 080A0980: 0700 lsl r0, r0, #0x1C 080A0982: 2800 cmp r0, #0x00 080A0984: DA09 bge 0x080A099A ; Branch if bit 3 of $0203BB50 is clear 080A0986: 4914 ldr r1, =#0x0000944A 080A0988: 1868 add r0, r5, r1 080A098A: 7800 ldrb r0, [r0] 080A098C: 4A13 ldr r2, =#0x00009451 080A098E: 18A9 add r1, r5, r2 080A0990: 7809 ldrb r1, [r1] 080A0992: 0749 lsl r1, r1, #0x1D 080A0994: 0FC9 lsr r1, r1, #0x1F 080A0996: F7FF bl 080A0998: F811 bl 0x0809F9BC 080A099A: 7820 ldrb r0, [r4] 080A099C: 06C0 lsl r0, r0, #0x1B 080A099E: 2800 cmp r0, #0x00 080A09A0: DA28 bge 0x080A09F4 ; Branch if bit 4 of $0203BB50 is clear 080A09A2: 490F ldr r1, =#0x00009448 080A09A4: 1868 add r0, r5, r1 080A09A6: 7800 ldrb r0, [r0] 080A09A8: 2800 cmp r0, #0x00 080A09AA: DB76 blt 0x080A0A9A 080A09AC: 2803 cmp r0, #0x03 080A09AE: DD19 ble 0x080A09E4 080A09B0: 2805 cmp r0, #0x05 080A09B2: D172 bne 0x080A0A9A 080A09B4: 229A mov r2, #0x9A 080A09B6: 0052 lsl r2, r2, #0x1 080A09B8: 18A9 add r1, r5, r2 080A09BA: E016 b 0x080A09EA ;080A09BC: 2700 mov r7, #0x00 ;080A09BE: 0203 lsl r3, r0, #0x8 ;080A09C0: 944F str r4, [sp, #0x13C] ;080A09C2: 0000 lsl r0, r0, #0x0 ;080A09C4: 944C str r4, [sp, #0x130] ;080A09C6: 0000 lsl r0, r0, #0x0 ;080A09C8: 3AEC sub r2, #0xEC ;080A09CA: 0000 lsl r0, r0, #0x0 ;080A09CC: 8FD0 ldrh r0, [r2, #0x3E] ;080A09CE: 0000 lsl r0, r0, #0x0 ;080A09D0: 9450 str r4, [sp, #0x140] ;080A09D2: 0000 lsl r0, r0, #0x0 ;080A09D4: 944B str r4, [sp, #0x12C] ;080A09D6: 0000 lsl r0, r0, #0x0 ;080A09D8: 944A str r4, [sp, #0x128] ;080A09DA: 0000 lsl r0, r0, #0x0 ;080A09DC: 9451 str r4, [sp, #0x144] ;080A09DE: 0000 lsl r0, r0, #0x0 ;080A09E0: 9448 str r4, [sp, #0x120] ;080A09E2: 0000 lsl r0, r0, #0x0 080A09E4: 20CA mov r0, #0xCA 080A09E6: 0040 lsl r0, r0, #0x1 080A09E8: 1829 add r1, r5, r0 080A09EA: 482F ldr r0, =#0x02032700 080A09EC: 6900 ldr r0, [r0, #0x10] 080A09EE: 8909 ldrh r1, [r1, #0x08] 080A09F0: F7FF bl 080A09F2: F808 bl 0x0809FA04 080A09F4: 4F2C ldr r7, =#0x02032700 080A09F6: 492D ldr r1, =#0x00009450 080A09F8: 19C9 add r1, r1, r7 080A09FA: 4689 mov r9, r1 080A09FC: 7808 ldrb r0, [r1] 080A09FE: 0680 lsl r0, r0, #0x1A 080A0A00: 2800 cmp r0, #0x00 080A0A02: DA02 bge 0x080A0A0A 080A0A04: 2000 mov r0, #0x00 080A0A06: F7FF bl 080A0A08: F963 bl 0x0809FCD0 080A0A0A: 464A mov r2, r9 080A0A0C: 7810 ldrb r0, [r2] 080A0A0E: 0640 lsl r0, r0, #0x19 080A0A10: 2800 cmp r0, #0x00 080A0A12: DA01 bge 0x080A0A18 080A0A14: F7FF bl 080A0A16: FA1C bl 0x0809FE50 080A0A18: 4649 mov r1, r9 080A0A1A: 7808 ldrb r0, [r1] 080A0A1C: 09C0 lsr r0, r0, #0x7 080A0A1E: 2800 cmp r0, #0x00 080A0A20: D003 beq 0x080A0A2A 080A0A22: 4A23 ldr r2, =#0x00002F8C 080A0A24: 18B8 add r0, r7, r2 080A0A26: F7FF bl 080A0A28: FA63 bl 0x0809FEF0 080A0A2A: 4822 ldr r0, =#0x00009451 080A0A2C: 19C0 add r0, r0, r7 080A0A2E: 4680 mov r8, r0 080A0A30: 7800 ldrb r0, [r0] 080A0A32: 07C0 lsl r0, r0, #0x1F 080A0A34: 2800 cmp r0, #0x00 080A0A36: D017 beq 0x080A0A68 080A0A38: 491F ldr r1, =#0x00002F62 080A0A3A: 1878 add r0, r7, r1 080A0A3C: 7800 ldrb r0, [r0] 080A0A3E: 4A1F ldr r2, =#0x00002F61 080A0A40: 18BE add r6, r7, r2 080A0A42: 7831 ldrb r1, [r6] 080A0A44: 3203 add r2, #0x03 080A0A46: 18BD add r5, r7, r2 080A0A48: 782A ldrb r2, [r5] 080A0A4A: 4B1D ldr r3, =#0x06013800 080A0A4C: 2401 mov r4, #0x01 080A0A4E: 9400 str r4, [sp] 080A0A50: F7FF bl 080A0A52: FA70 bl 0x0809FF34 080A0A54: 491B ldr r1, =#0x00002F63 080A0A56: 1878 add r0, r7, r1 080A0A58: 7800 ldrb r0, [r0] 080A0A5A: 7831 ldrb r1, [r6] 080A0A5C: 782A ldrb r2, [r5] 080A0A5E: 4B1A ldr r3, =#0x06013900 080A0A60: 2402 mov r4, #0x02 080A0A62: 9400 str r4, [sp] 080A0A64: F7FF bl 080A0A66: FA66 bl 0x0809FF34 080A0A68: 4642 mov r2, r8 080A0A6A: 7810 ldrb r0, [r2] 080A0A6C: 0780 lsl r0, r0, #0x1E 080A0A6E: 2800 cmp r0, #0x00 080A0A70: DA01 bge 0x080A0A76 080A0A72: F7FF bl 080A0A74: FB11 bl 0x080A0098 080A0A76: 4815 ldr r0, =#0x0000944F 080A0A78: 183A add r2, r7, r0 080A0A7A: 2002 mov r0, #0x02 080A0A7C: 4240 neg r0, r0 080A0A7E: 2303 mov r3, #0x03 080A0A80: 425B neg r3, r3 080A0A82: 2405 mov r4, #0x05 080A0A84: 4264 neg r4, r4 080A0A86: 2100 mov r1, #0x00 080A0A88: 7011 strb r1, [r2] 080A0A8A: 464A mov r2, r9 080A0A8C: 7011 strb r1, [r2] 080A0A8E: 4642 mov r2, r8 080A0A90: 7811 ldrb r1, [r2] 080A0A92: 4008 and r0, r1 080A0A94: 4018 and r0, r3 080A0A96: 4020 and r0, r4 080A0A98: 7010 strb r0, [r2] 080A0A9A: B001 add sp, #0x004 080A0A9C: BC18 pop {r3, r4} 080A0A9E: 4698 mov r8, r3 080A0AA0: 46A1 mov r9, r4 080A0AA2: BCF0 pop {r4, r5, r6, r7} 080A0AA4: BC01 pop {r0} 080A0AA6: 4700 bx r0 ;080A0AA8: 2700 mov r7, #0x00 ;080A0AAA: 0203 lsl r3, r0, #0x8 ;080A0AAC: 9450 str r4, [sp, #0x140] ;080A0AAE: 0000 lsl r0, r0, #0x0 ;080A0AB0: 2F8C cmp r7, #0x8C ;080A0AB2: 0000 lsl r0, r0, #0x0 ;080A0AB4: 9451 str r4, [sp, #0x144] ;080A0AB6: 0000 lsl r0, r0, #0x0 ;080A0AB8: 2F62 cmp r7, #0x62 ;080A0ABA: 0000 lsl r0, r0, #0x0 ;080A0ABC: 2F61 cmp r7, #0x61 ;080A0ABE: 0000 lsl r0, r0, #0x0 ;080A0AC0: 3800 sub r0, #0x00 ;080A0AC2: 0601 lsl r1, r0, #0x18 ;080A0AC4: 2F63 cmp r7, #0x63 ;080A0AC6: 0000 lsl r0, r0, #0x0 ;080A0AC8: 3900 sub r1, #0x00 ;080A0ACA: 0601 lsl r1, r0, #0x18 ;080A0ACC: 944F str r4, [sp, #0x13C] ;080A0ACE: 0000 lsl r0, r0, #0x0
$080A0AD0 - ?
080A0AD0: B5F0 push {r4, r5, r6, r7, lr} 080A0AD2: 4647 mov r7, r8 080A0AD4: B480 push {r7} 080A0AD6: 4C23 ldr r4, =#0x02032700 080A0AD8: 6862 ldr r2, [r4, #0x04] 080A0ADA: 20F8 mov r0, #0xF8 080A0ADC: 0140 lsl r0, r0, #0x5 080A0ADE: 4680 mov r8, r0 080A0AE0: 1810 add r0, r2, r0 080A0AE2: 7800 ldrb r0, [r0] 080A0AE4: 2800 cmp r0, #0x00 080A0AE6: D003 beq 0x080A0AF0 080A0AE8: 491F ldr r1, =#0x0600E000 080A0AEA: 1C10 add r0, r2, #0x0 080A0AEC: F000 bl 080A0AEE: F97E bl 0x080A0DEC 080A0AF0: 6861 ldr r1, [r4, #0x04] 080A0AF2: 4F1E ldr r7, =#0x00001F01 080A0AF4: 19C8 add r0, r1, r7 080A0AF6: 7800 ldrb r0, [r0] 080A0AF8: 2800 cmp r0, #0x00 080A0AFA: D005 beq 0x080A0B08 080A0AFC: 2296 mov r2, #0x96 080A0AFE: 00D2 lsl r2, r2, #0x3 080A0B00: 1888 add r0, r1, r2 080A0B02: 491B ldr r1, =#0x0600E800 080A0B04: F000 bl 080A0B06: F972 bl 0x080A0DEC 080A0B08: 6861 ldr r1, [r4, #0x04] 080A0B0A: 4E1A ldr r6, =#0x00001F02 080A0B0C: 1988 add r0, r1, r6 080A0B0E: 7800 ldrb r0, [r0] 080A0B10: 2800 cmp r0, #0x00 080A0B12: D005 beq 0x080A0B20 080A0B14: 2296 mov r2, #0x96 080A0B16: 0112 lsl r2, r2, #0x4 080A0B18: 1888 add r0, r1, r2 080A0B1A: 4917 ldr r1, =#0x0600F000 080A0B1C: F000 bl 080A0B1E: F966 bl 0x080A0DEC 080A0B20: 6861 ldr r1, [r4, #0x04] 080A0B22: 4D16 ldr r5, =#0x00001F03 080A0B24: 1948 add r0, r1, r5 080A0B26: 7800 ldrb r0, [r0] 080A0B28: 2800 cmp r0, #0x00 080A0B2A: D005 beq 0x080A0B38 080A0B2C: 22E1 mov r2, #0xE1 080A0B2E: 0112 lsl r2, r2, #0x4 080A0B30: 1888 add r0, r1, r2 080A0B32: 4913 ldr r1, =#0x0600F800 080A0B34: F000 bl 080A0B36: F95A bl 0x080A0DEC 080A0B38: 6860 ldr r0, [r4, #0x04] 080A0B3A: 4440 add r0, r8 080A0B3C: 7801 ldrb r1, [r0] 080A0B3E: 2100 mov r1, #0x00 080A0B40: 7001 strb r1, [r0] 080A0B42: 6860 ldr r0, [r4, #0x04] 080A0B44: 19C0 add r0, r0, r7 080A0B46: 7802 ldrb r2, [r0] 080A0B48: 7001 strb r1, [r0] 080A0B4A: 6860 ldr r0, [r4, #0x04] 080A0B4C: 1980 add r0, r0, r6 080A0B4E: 7802 ldrb r2, [r0] 080A0B50: 7001 strb r1, [r0] 080A0B52: 6860 ldr r0, [r4, #0x04] 080A0B54: 1940 add r0, r0, r5 080A0B56: 7802 ldrb r2, [r0] 080A0B58: 7001 strb r1, [r0] 080A0B5A: BC08 pop {r3} 080A0B5C: 4698 mov r8, r3 080A0B5E: BCF0 pop {r4, r5, r6, r7} 080A0B60: BC01 pop {r0} 080A0B62: 4700 bx r0 ;DATA ;=========== ;080A0B64: 2700 mov r7, #0x00 ;080A0B66: 0203 lsl r3, r0, #0x8 ;080A0B68: E000 b 0x080A0B6C ;080A0B6A: 0600 lsl r0, r0, #0x18 ;080A0B6C: 1F01 sub r1, r0, #0x4 ;080A0B6E: 0000 lsl r0, r0, #0x0 ;080A0B70: E800 ??? ;080A0B72: 0600 lsl r0, r0, #0x18 ;080A0B74: 1F02 sub r2, r0, #0x4 ;080A0B76: 0000 lsl r0, r0, #0x0 ;080A0B78: F000 bl ;080A0B7A: 0600 lsl r0, r0, #0x18 ;080A0B7C: 1F03 sub r3, r0, #0x4 ;080A0B7E: 0000 lsl r0, r0, #0x0 ;080A0B80: F800 bl 0x080A0B82 ;080A0B82: 0600 lsl r0, r0, #0x18
$080A0B84 - ?
080A0B84: B5F0 push {r4, r5, r6, r7, lr} 080A0B86: 4647 mov r7, r8 080A0B88: B480 push {r7} 080A0B8A: B081 add sp, #-0x004 080A0B8C: 1C06 add r6, r0, #0x0 080A0B8E: 20C8 mov r0, #0xC8 080A0B90: 0080 lsl r0, r0, #0x2 080A0B92: 1833 add r3, r6, r0 080A0B94: 466A mov r2, sp 080A0B96: 4942 ldr r1, =#0x000050CA 080A0B98: 1870 add r0, r6, r1 080A0B9A: 7801 ldrb r1, [r0] 080A0B9C: 0749 lsl r1, r1, #0x1D 080A0B9E: 0F49 lsr r1, r1, #0x1D 080A0BA0: 4C40 ldr r4, =#0x000050C2 080A0BA2: 1930 add r0, r6, r4 080A0BA4: 1840 add r0, r0, r1 080A0BA6: 7800 ldrb r0, [r0] 080A0BA8: 8010 strh r0, [r2] 080A0BAA: 4668 mov r0, sp 080A0BAC: 8800 ldrh r0, [r0] 080A0BAE: 2800 cmp r0, #0x00 080A0BB0: D035 beq 0x080A0C1E 080A0BB2: 4A3D ldr r2, =#0x040000D4 080A0BB4: 483D ldr r0, =#0x80000030 080A0BB6: 4680 mov r8, r0 080A0BB8: 2780 mov r7, #0x80 080A0BBA: 063F lsl r7, r7, #0x18 080A0BBC: 466D mov r5, sp 080A0BBE: 1C18 add r0, r3, #0x0 080A0BC0: 3008 add r0, #0x08 080A0BC2: 6010 str r0, [r2] 080A0BC4: 6819 ldr r1, [r3] 080A0BC6: 6051 str r1, [r2, #0x04] 080A0BC8: 4644 mov r4, r8 080A0BCA: 6094 str r4, [r2, #0x08] 080A0BCC: 6890 ldr r0, [r2, #0x08] 080A0BCE: 6890 ldr r0, [r2, #0x08] 080A0BD0: 4038 and r0, r7 080A0BD2: 1C1C add r4, r3, #0x0 080A0BD4: 3468 add r4, #0x68 080A0BD6: 33CC add r3, #0xCC 080A0BD8: 469C mov r12, r3 080A0BDA: 2800 cmp r0, #0x00 080A0BDC: D005 beq 0x080A0BEA 080A0BDE: 2380 mov r3, #0x80 080A0BE0: 061B lsl r3, r3, #0x18 080A0BE2: 6890 ldr r0, [r2, #0x08] 080A0BE4: 4018 and r0, r3 080A0BE6: 2800 cmp r0, #0x00 080A0BE8: D1FB bne 0x080A0BE2 080A0BEA: 6014 str r4, [r2] 080A0BEC: 2380 mov r3, #0x80 080A0BEE: 00DB lsl r3, r3, #0x3 080A0BF0: 18C8 add r0, r1, r3 080A0BF2: 6050 str r0, [r2, #0x04] 080A0BF4: 4644 mov r4, r8 080A0BF6: 6094 str r4, [r2, #0x08] 080A0BF8: 6890 ldr r0, [r2, #0x08] 080A0BFA: 1C13 add r3, r2, #0x0 080A0BFC: 6898 ldr r0, [r3, #0x08] 080A0BFE: 4038 and r0, r7 080A0C00: 2800 cmp r0, #0x00 080A0C02: D005 beq 0x080A0C10 080A0C04: 2180 mov r1, #0x80 080A0C06: 0609 lsl r1, r1, #0x18 080A0C08: 6898 ldr r0, [r3, #0x08] 080A0C0A: 4008 and r0, r1 080A0C0C: 2800 cmp r0, #0x00 080A0C0E: D1FB bne 0x080A0C08 080A0C10: 8828 ldrh r0, [r5] 080A0C12: 3801 sub r0, #0x01 080A0C14: 8028 strh r0, [r5] 080A0C16: 4663 mov r3, r12 080A0C18: 8828 ldrh r0, [r5] 080A0C1A: 2800 cmp r0, #0x00 080A0C1C: D1CF bne 0x080A0BBE 080A0C1E: 4820 ldr r0, =#0x000050CA 080A0C20: 1833 add r3, r6, r0 080A0C22: 7818 ldrb r0, [r3] 080A0C24: 0740 lsl r0, r0, #0x1D 080A0C26: 0F40 lsr r0, r0, #0x1D 080A0C28: 4A1E ldr r2, =#0x000050C2 080A0C2A: 18B1 add r1, r6, r2 080A0C2C: 1809 add r1, r1, r0 080A0C2E: 2700 mov r7, #0x00 080A0C30: 700F strb r7, [r1] 080A0C32: 781A ldrb r2, [r3] 080A0C34: 0750 lsl r0, r2, #0x1D 080A0C36: 0F40 lsr r0, r0, #0x1D 080A0C38: 3001 add r0, #0x01 080A0C3A: 2107 mov r1, #0x07 080A0C3C: 4008 and r0, r1 080A0C3E: 2108 mov r1, #0x08 080A0C40: 4249 neg r1, r1 080A0C42: 4011 and r1, r2 080A0C44: 4301 orr r1, r0 080A0C46: 7019 strb r1, [r3] 080A0C48: 2007 mov r0, #0x07 080A0C4A: 4008 and r0, r1 080A0C4C: 2804 cmp r0, #0x04 080A0C4E: D140 bne 0x080A0CD2 080A0C50: 4B17 ldr r3, =#0x000050C8 080A0C52: 18F5 add r5, r6, r3 080A0C54: 8828 ldrh r0, [r5] 080A0C56: 2800 cmp r0, #0x00 080A0C58: D007 beq 0x080A0C6A 080A0C5A: 4816 ldr r0, =#0x02032700 080A0C5C: 6840 ldr r0, [r0, #0x04] 080A0C5E: 2496 mov r4, #0x96 080A0C60: 00E4 lsl r4, r4, #0x3 080A0C62: 1900 add r0, r0, r4 080A0C64: 4914 ldr r1, =#0x0600E800 080A0C66: F000 bl 080A0C68: F8C1 bl 0x080A0DEC 080A0C6A: 4814 ldr r0, =#0x00004678 080A0C6C: 1834 add r4, r6, r0 080A0C6E: 6820 ldr r0, [r4] 080A0C70: 7C40 ldrb r0, [r0, #0x11] 080A0C72: 7028 strb r0, [r5] 080A0C74: 6820 ldr r0, [r4] 080A0C76: 7C81 ldrb r1, [r0, #0x12] 080A0C78: 4A11 ldr r2, =#0x000050C9 080A0C7A: 18B0 add r0, r6, r2 080A0C7C: 7001 strb r1, [r0] 080A0C7E: 6820 ldr r0, [r4] 080A0C80: 7447 strb r7, [r0, #0x11] 080A0C82: 6820 ldr r0, [r4] 080A0C84: 7487 strb r7, [r0, #0x12] 080A0C86: 1C30 add r0, r6, #0x0 080A0C88: 2100 mov r1, #0x00 080A0C8A: F7FD bl 080A0C8C: FFBB bl 0x0809EC04 080A0C8E: 4B0D ldr r3, =#0x00004650 080A0C90: 18F1 add r1, r6, r3 080A0C92: 6820 ldr r0, [r4] 080A0C94: 4288 cmp r0, r1 080A0C96: D119 bne 0x080A0CCC 080A0C98: 490B ldr r1, =#0x00004664 080A0C9A: 1870 add r0, r6, r1 080A0C9C: E017 b 0x080A0CCE ;080A0C9E: 0000 lsl r0, r0, #0x0 ;080A0CA0: 50CA str r2, [r1, r3] ;080A0CA2: 0000 lsl r0, r0, #0x0 ;080A0CA4: 50C2 str r2, [r0, r3] ;080A0CA6: 0000 lsl r0, r0, #0x0 ;080A0CA8: 00D4 lsl r4, r2, #0x3 ;080A0CAA: 0400 lsl r0, r0, #0x10 ;080A0CAC: 0030 lsl r0, r6, #0x0 ;080A0CAE: 8000 strh r0, [r0] ;080A0CB0: 50C8 str r0, [r1, r3] ;080A0CB2: 0000 lsl r0, r0, #0x0 ;080A0CB4: 2700 mov r7, #0x00 ;080A0CB6: 0203 lsl r3, r0, #0x8 ;080A0CB8: E800 ??? ;080A0CBA: 0600 lsl r0, r0, #0x18 ;080A0CBC: 4678 mov r0, pc ;080A0CBE: 0000 lsl r0, r0, #0x0 ;080A0CC0: 50C9 str r1, [r1, r3] ;080A0CC2: 0000 lsl r0, r0, #0x0 ;080A0CC4: 4650 mov r0, r10 ;080A0CC6: 0000 lsl r0, r0, #0x0 ;080A0CC8: 4664 mov r4, r12 ;080A0CCA: 0000 lsl r0, r0, #0x0 080A0CCC: 1C08 add r0, r1, #0x0 080A0CCE: 6020 str r0, [r4] 080A0CD0: E003 b 0x080A0CDA 080A0CD2: 2009 mov r0, #0x09 080A0CD4: 4240 neg r0, r0 080A0CD6: 4001 and r1, r0 080A0CD8: 7019 strb r1, [r3] 080A0CDA: B001 add sp, #0x004 080A0CDC: BC08 pop {r3} 080A0CDE: 4698 mov r8, r3 080A0CE0: BCF0 pop {r4, r5, r6, r7} 080A0CE2: BC01 pop {r0} 080A0CE4: 4700 bx r0 ;080A0CE6: 0000 lsl r0, r0, #0x0
$080A0CE8 - ?
080A0CE8: B5F0 push {r4, r5, r6, r7, lr} 080A0CEA: 464F mov r7, r9 080A0CEC: 4646 mov r6, r8 080A0CEE: B4C0 push {r6, r7} 080A0CF0: B081 add sp, #-0x004 080A0CF2: 1C06 add r6, r0, #0x0 080A0CF4: 482B ldr r0, =#0x00001BD0 080A0CF6: 1832 add r2, r6, r0 080A0CF8: 4669 mov r1, sp 080A0CFA: 3102 add r1, #0x02 080A0CFC: 4B2A ldr r3, =#0x000050C7 080A0CFE: 18F0 add r0, r6, r3 080A0D00: 7800 ldrb r0, [r0] 080A0D02: 8008 strh r0, [r1] 080A0D04: 8808 ldrh r0, [r1] 080A0D06: 2800 cmp r0, #0x00 080A0D08: D041 beq 0x080A0D8E 080A0D0A: 4B28 ldr r3, =#0x040000D4 080A0D0C: 4C28 ldr r4, =#0x80000020 080A0D0E: 46A1 mov r9, r4 080A0D10: 2080 mov r0, #0x80 080A0D12: 0600 lsl r0, r0, #0x18 080A0D14: 4680 mov r8, r0 080A0D16: 1C0F add r7, r1, #0x0 080A0D18: 1C10 add r0, r2, #0x0 080A0D1A: 3087 add r0, #0x87 080A0D1C: 7801 ldrb r1, [r0] 080A0D1E: 200C mov r0, #0x0C 080A0D20: 4008 and r0, r1 080A0D22: 2188 mov r1, #0x88 080A0D24: 1889 add r1, r1, r2 080A0D26: 468C mov r12, r1 080A0D28: 2800 cmp r0, #0x00 080A0D2A: D129 bne 0x080A0D80 080A0D2C: 1D10 add r0, r2, #0x4 080A0D2E: 6018 str r0, [r3] 080A0D30: 6811 ldr r1, [r2] 080A0D32: 6059 str r1, [r3, #0x04] 080A0D34: 464C mov r4, r9 080A0D36: 609C str r4, [r3, #0x08] 080A0D38: 6898 ldr r0, [r3, #0x08] 080A0D3A: 1C1D add r5, r3, #0x0 080A0D3C: 6898 ldr r0, [r3, #0x08] 080A0D3E: 4644 mov r4, r8 080A0D40: 4020 and r0, r4 080A0D42: 1C0C add r4, r1, #0x0 080A0D44: 1C11 add r1, r2, #0x0 080A0D46: 3144 add r1, #0x44 080A0D48: 2800 cmp r0, #0x00 080A0D4A: D005 beq 0x080A0D58 080A0D4C: 2280 mov r2, #0x80 080A0D4E: 0612 lsl r2, r2, #0x18 080A0D50: 68A8 ldr r0, [r5, #0x08] 080A0D52: 4010 and r0, r2 080A0D54: 2800 cmp r0, #0x00 080A0D56: D1FB bne 0x080A0D50 080A0D58: 6019 str r1, [r3] 080A0D5A: 2180 mov r1, #0x80 080A0D5C: 00C9 lsl r1, r1, #0x3 080A0D5E: 1860 add r0, r4, r1 080A0D60: 6058 str r0, [r3, #0x04] 080A0D62: 464A mov r2, r9 080A0D64: 609A str r2, [r3, #0x08] 080A0D66: 6898 ldr r0, [r3, #0x08] 080A0D68: 1C1A add r2, r3, #0x0 080A0D6A: 6890 ldr r0, [r2, #0x08] 080A0D6C: 4644 mov r4, r8 080A0D6E: 4020 and r0, r4 080A0D70: 2800 cmp r0, #0x00 080A0D72: D005 beq 0x080A0D80 080A0D74: 2180 mov r1, #0x80 080A0D76: 0609 lsl r1, r1, #0x18 080A0D78: 6890 ldr r0, [r2, #0x08] 080A0D7A: 4008 and r0, r1 080A0D7C: 2800 cmp r0, #0x00 080A0D7E: D1FB bne 0x080A0D78 080A0D80: 8838 ldrh r0, [r7] 080A0D82: 3801 sub r0, #0x01 080A0D84: 8038 strh r0, [r7] 080A0D86: 4662 mov r2, r12 080A0D88: 8838 ldrh r0, [r7] 080A0D8A: 2800 cmp r0, #0x00 080A0D8C: D1C4 bne 0x080A0D18 080A0D8E: 4809 ldr r0, =#0x00004694 080A0D90: 1832 add r2, r6, r0 080A0D92: 4B09 ldr r3, =#0x0000467C 080A0D94: 18F1 add r1, r6, r3 080A0D96: 6810 ldr r0, [r2] 080A0D98: 4288 cmp r0, r1 080A0D9A: D111 bne 0x080A0DC0 080A0D9C: 4C07 ldr r4, =#0x00004688 080A0D9E: 1930 add r0, r6, r4 080A0DA0: E00F b 0x080A0DC2 ;080A0DA2: 0000 lsl r0, r0, #0x0 ;080A0DA4: 1BD0 sub r0, r2, r7 ;080A0DA6: 0000 lsl r0, r0, #0x0 ;080A0DA8: 50C7 str r7, [r0, r3] ;080A0DAA: 0000 lsl r0, r0, #0x0 ;080A0DAC: 00D4 lsl r4, r2, #0x3 ;080A0DAE: 0400 lsl r0, r0, #0x10 ;080A0DB0: 0020 lsl r0, r4, #0x0 ;080A0DB2: 8000 strh r0, [r0] ;080A0DB4: 4694 mov r12, r2 ;080A0DB6: 0000 lsl r0, r0, #0x0 ;080A0DB8: 467C mov r4, pc ;080A0DBA: 0000 lsl r0, r0, #0x0 ;080A0DBC: 4688 mov r8, r1 ;080A0DBE: 0000 lsl r0, r0, #0x0 080A0DC0: 1C08 add r0, r1, #0x0 080A0DC2: 6010 str r0, [r2] 080A0DC4: 4907 ldr r1, =#0x00004694 080A0DC6: 1870 add r0, r6, r1 080A0DC8: 6800 ldr r0, [r0] 080A0DCA: 2100 mov r1, #0x00 080A0DCC: 7241 strb r1, [r0, #0x09] 080A0DCE: 4A06 ldr r2, =#0x000050C7 080A0DD0: 18B0 add r0, r6, r2 080A0DD2: 7001 strb r1, [r0] 080A0DD4: B001 add sp, #0x004 080A0DD6: BC18 pop {r3, r4} 080A0DD8: 4698 mov r8, r3 080A0DDA: 46A1 mov r9, r4 080A0DDC: BCF0 pop {r4, r5, r6, r7} 080A0DDE: BC01 pop {r0} 080A0DE0: 4700 bx r0 ;080A0DE2: 0000 lsl r0, r0, #0x0 ;080A0DE4: 4694 mov r12, r2 ;080A0DE6: 0000 lsl r0, r0, #0x0 ;080A0DE8: 50C7 str r7, [r0, r3] ;080A0DEA: 0000 lsl r0, r0, #0x0
$080A0DEC - ?
080A0DEC: B570 push {r4, r5, r6, lr} 080A0DEE: B081 add sp, #-0x004 080A0DF0: 1C03 add r3, r0, #0x0 080A0DF2: 1C0E add r6, r1, #0x0 080A0DF4: 4669 mov r1, sp 080A0DF6: 2000 mov r0, #0x00 080A0DF8: 8008 strh r0, [r1] 080A0DFA: 4668 mov r0, sp 080A0DFC: 8800 ldrh r0, [r0] 080A0DFE: 2813 cmp r0, #0x13 080A0E00: D819 bhi 0x080A0E36 080A0E02: 4C0F ldr r4, =#0x040000D4 080A0E04: 466D mov r5, sp 080A0E06: 6023 str r3, [r4] 080A0E08: 6066 str r6, [r4, #0x04] 080A0E0A: 480E ldr r0, =#0x8000001E 080A0E0C: 60A0 str r0, [r4, #0x08] 080A0E0E: 68A0 ldr r0, [r4, #0x08] 080A0E10: 68A0 ldr r0, [r4, #0x08] 080A0E12: 2280 mov r2, #0x80 080A0E14: 0612 lsl r2, r2, #0x18 080A0E16: 333C add r3, #0x3C 080A0E18: 1C31 add r1, r6, #0x0 080A0E1A: 3140 add r1, #0x40 080A0E1C: 2800 cmp r0, #0x00 080A0E1E: DA03 bge 0x080A0E28 080A0E20: 68A0 ldr r0, [r4, #0x08] 080A0E22: 4010 and r0, r2 080A0E24: 2800 cmp r0, #0x00 080A0E26: D1FB bne 0x080A0E20 080A0E28: 1C0E add r6, r1, #0x0 080A0E2A: 8828 ldrh r0, [r5] 080A0E2C: 3001 add r0, #0x01 080A0E2E: 8028 strh r0, [r5] 080A0E30: 8828 ldrh r0, [r5] 080A0E32: 2813 cmp r0, #0x13 080A0E34: D9E7 bls 0x080A0E06 080A0E36: B001 add sp, #0x004 080A0E38: BC70 pop {r4, r5, r6} 080A0E3A: BC01 pop {r0} 080A0E3C: 4700 bx r0 ;080A0E3E: 0000 lsl r0, r0, #0x0 ;080A0E40: 00D4 lsl r4, r2, #0x3 ;080A0E42: 0400 lsl r0, r0, #0x10 ;080A0E44: 001E lsl r6, r3, #0x0 ;080A0E46: 8000 strh r0, [r0]
$080A0E48 - ?
080A0E48: B530 push {r4, r5, lr} 080A0E4A: 1C04 add r4, r0, #0x0 080A0E4C: 1C0D add r5, r1, #0x0 080A0E4E: 1C28 add r0, r5, #0x0 080A0E50: F005 bl 080A0E52: FFC0 bl 0x080A6DD4 080A0E54: 7B29 ldrb r1, [r5, #0x0C] 080A0E56: 2004 mov r0, #0x04 080A0E58: 4008 and r0, r1 080A0E5A: 2800 cmp r0, #0x00 080A0E5C: D00A beq 0x080A0E74 080A0E5E: 4804 ldr r0, =#0x00003AD6 080A0E60: 1822 add r2, r4, r0 080A0E62: 7811 ldrb r1, [r2] 080A0E64: 2002 mov r0, #0x02 080A0E66: 4240 neg r0, r0 080A0E68: 4008 and r0, r1 080A0E6A: 7010 strb r0, [r2] 080A0E6C: E01F b 0x080A0EAE ;080A0E6E: 0000 lsl r0, r0, #0x0 ;080A0E70: 3AD6 sub r2, #0xD6 ;080A0E72: 0000 lsl r0, r0, #0x0 080A0E74: 4804 ldr r0, =#0x00003AD6 080A0E76: 1823 add r3, r4, r0 080A0E78: 781A ldrb r2, [r3] 080A0E7A: 2002 mov r0, #0x02 080A0E7C: 4010 and r0, r2 080A0E7E: 2800 cmp r0, #0x00 080A0E80: D004 beq 0x080A0E8C 080A0E82: 2001 mov r0, #0x01 080A0E84: 4310 orr r0, r2 080A0E86: E007 b 0x080A0E98 ;080A0E88: 3AD6 sub r2, #0xD6 ;080A0E8A: 0000 lsl r0, r0, #0x0 080A0E8C: 0789 lsl r1, r1, #0x1E 080A0E8E: 0FC9 lsr r1, r1, #0x1F 080A0E90: 2002 mov r0, #0x02 080A0E92: 4240 neg r0, r0 080A0E94: 4010 and r0, r2 080A0E96: 4308 orr r0, r1 080A0E98: 7018 strb r0, [r3] 080A0E9A: 4919 ldr r1, =#0x00003AD6 080A0E9C: 1860 add r0, r4, r1 080A0E9E: 7801 ldrb r1, [r0] 080A0EA0: 2004 mov r0, #0x04 080A0EA2: 4008 and r0, r1 080A0EA4: 2800 cmp r0, #0x00 080A0EA6: D002 beq 0x080A0EAE 080A0EA8: 2019 mov r0, #0x19 080A0EAA: F7BA bl 080A0EAC: FB5B bl 0x0805B564 080A0EAE: 7B28 ldrb r0, [r5, #0x0C] 080A0EB0: 4913 ldr r1, =#0x00003AD6 080A0EB2: 1863 add r3, r4, r1 080A0EB4: 2104 mov r1, #0x04 080A0EB6: 4001 and r1, r0 080A0EB8: 781A ldrb r2, [r3] 080A0EBA: 2005 mov r0, #0x05 080A0EBC: 4240 neg r0, r0 080A0EBE: 4010 and r0, r2 080A0EC0: 4308 orr r0, r1 080A0EC2: 2103 mov r1, #0x03 080A0EC4: 4249 neg r1, r1 080A0EC6: 4008 and r0, r1 080A0EC8: 7018 strb r0, [r3] 080A0ECA: 1C20 add r0, r4, #0x0 080A0ECC: F005 bl 080A0ECE: FFB6 bl 0x080A6E3C 080A0ED0: 1C20 add r0, r4, #0x0 080A0ED2: F005 bl 080A0ED4: FFF3 bl 0x080A6EBC 080A0ED6: 1C20 add r0, r4, #0x0 080A0ED8: 1C29 add r1, r5, #0x0 080A0EDA: F006 bl 080A0EDC: F825 bl 0x080A6F28 080A0EDE: 0600 lsl r0, r0, #0x18 080A0EE0: 2800 cmp r0, #0x00 080A0EE2: D14C bne 0x080A0F7E 080A0EE4: 4907 ldr r1, =#0x00003826 080A0EE6: 1860 add r0, r4, r1 080A0EE8: 7801 ldrb r1, [r0] 080A0EEA: 2201 mov r2, #0x01 080A0EEC: 1C10 add r0, r2, #0x0 080A0EEE: 4008 and r0, r1 080A0EF0: 2800 cmp r0, #0x00 080A0EF2: D009 beq 0x080A0F08 080A0EF4: 1C20 add r0, r4, #0x0 080A0EF6: 1C29 add r1, r5, #0x0 080A0EF8: F004 bl 080A0EFA: FE44 bl 0x080A5B84 080A0EFC: E03F b 0x080A0F7E ;080A0EFE: 0000 lsl r0, r0, #0x0 ;080A0F00: 3AD6 sub r2, #0xD6 ;080A0F02: 0000 lsl r0, r0, #0x0 ;080A0F04: 3826 sub r0, #0x26 ;080A0F06: 0000 lsl r0, r0, #0x0 080A0F08: 4905 ldr r1, =#0x000037DD 080A0F0A: 1860 add r0, r4, r1 080A0F0C: 7801 ldrb r1, [r0] 080A0F0E: 1C10 add r0, r2, #0x0 080A0F10: 4008 and r0, r1 080A0F12: 2800 cmp r0, #0x00 080A0F14: D006 beq 0x080A0F24 080A0F16: 1C20 add r0, r4, #0x0 080A0F18: 1C29 add r1, r5, #0x0 080A0F1A: F004 bl 080A0F1C: FD65 bl 0x080A59E8 080A0F1E: E02E b 0x080A0F7E ;080A0F20: 37DD add r7, #0xDD ;080A0F22: 0000 lsl r0, r0, #0x0 080A0F24: 4905 ldr r1, =#0x000037D3 080A0F26: 1860 add r0, r4, r1 080A0F28: 7800 ldrb r0, [r0] 080A0F2A: 07C0 lsl r0, r0, #0x1F 080A0F2C: 2800 cmp r0, #0x00 080A0F2E: D007 beq 0x080A0F40 080A0F30: 1C20 add r0, r4, #0x0 080A0F32: 1C29 add r1, r5, #0x0 080A0F34: F003 bl 080A0F36: FF2A bl 0x080A4D8C 080A0F38: E021 b 0x080A0F7E ;080A0F3A: 0000 lsl r0, r0, #0x0 ;080A0F3C: 37D3 add r7, #0xD3 ;080A0F3E: 0000 lsl r0, r0, #0x0 080A0F40: 4905 ldr r1, =#0x000037C4 080A0F42: 1860 add r0, r4, r1 080A0F44: 7801 ldrb r1, [r0] 080A0F46: 1C10 add r0, r2, #0x0 080A0F48: 4008 and r0, r1 080A0F4A: 2800 cmp r0, #0x00 080A0F4C: D006 beq 0x080A0F5C 080A0F4E: 1C20 add r0, r4, #0x0 080A0F50: 1C29 add r1, r5, #0x0 080A0F52: F003 bl 080A0F54: F94D bl 0x080A41F0 080A0F56: E012 b 0x080A0F7E ;080A0F58: 37C4 add r7, #0xC4 ;080A0F5A: 0000 lsl r0, r0, #0x0 080A0F5C: 4809 ldr r0, =#0x00003AD0 080A0F5E: 1822 add r2, r4, r0 080A0F60: 7810 ldrb r0, [r2] 080A0F62: 280D cmp r0, #0x0D 080A0F64: D80B bhi 0x080A0F7E 080A0F66: 4908 ldr r1, =#0x08699548 080A0F68: 0082 lsl r2, r0, #0x2 080A0F6A: 1852 add r2, r2, r1 080A0F6C: 0041 lsl r1, r0, #0x1 080A0F6E: 1809 add r1, r1, r0 080A0F70: 0109 lsl r1, r1, #0x4 080A0F72: 1861 add r1, r4, r1 080A0F74: 6813 ldr r3, [r2] 080A0F76: 1C20 add r0, r4, #0x0 080A0F78: 1C2A add r2, r5, #0x0 080A0F7A: F01F bl 080A0F7C: FAF9 bl 0x080C0570 080A0F7E: BC30 pop {r4, r5} 080A0F80: BC01 pop {r0} 080A0F82: 4700 bx r0 ;080A0F84: 3AD0 sub r2, #0xD0 ;080A0F86: 0000 lsl r0, r0, #0x0 ;080A0F88: 9548 str r5, [sp, #0x120] ;080A0F8A: 0869 lsr r1, r5, #0x1
$080A41F0 - ?
080A41F0: B5F0 push {r4, r5, r6, r7, lr} 080A41F2: 464F mov r7, r9 080A41F4: 4646 mov r6, r8 080A41F6: B4C0 push {r6, r7} 080A41F8: B085 add sp, #-0x014 080A41FA: 1C05 add r5, r0, #0x0 ; r5 = Orig. r0 080A41FC: 1C0E add r6, r1, #0x0 ; r6 = Orig. r1 080A41FE: 20A8 mov r0, #0xA8 080A4200: 0080 lsl r0, r0, #0x2 080A4202: 182F add r7, r5, r0 ; r7 = Orig. r0 + #$02A0 080A4204: 4912 ldr r1, =#0x00003AD6 080A4206: 1868 add r0, r5, r1 080A4208: 7801 ldrb r1, [r0] ; r0 = [Orig. r0 + #$3AD6] 080A420A: 2201 mov r2, #0x01 080A420C: 4691 mov r9, r2 080A420E: 2301 mov r3, #0x01 080A4210: 4698 mov r8, r3 080A4212: 4640 mov r0, r8 080A4214: 4008 and r0, r1 080A4216: 2800 cmp r0, #0x00 080A4218: D100 bne 0x080A421C ; Branch if Bit 0 of [Orig. r0 + #$3AD6] is set 080A421A: E123 b 0x080A4464 ; Branch if Bit 0 of [Orig. r0 + #$3AD6] is clear 080A421C: 8830 ldrh r0, [r6] ; r0 = [Orig. r1] 080A421E: 2802 cmp r0, #0x02 080A4220: D172 bne 0x080A4308 ; Branch if r0 <> #$02 080A4222: 201A mov r0, #0x1A 080A4224: F7B7 bl 080A4226: F99E bl 0x0805B564 ; ? 080A4228: 480A ldr r0, =#0x000037C4 080A422A: 182B add r3, r5, r0 080A422C: 7818 ldrb r0, [r3] ; r0 = [Orig. r0 + #$37C4] 080A422E: 2402 mov r4, #0x02 080A4230: 4264 neg r4, r4 ; #$FFFFFFFE 080A4232: 4004 and r4, r0 ; Remove Bit 0 080A4234: 701C strb r4, [r3] ; Store back 080A4236: A804 add r0, sp, #0x010 080A4238: 4641 mov r1, r8 080A423A: 7001 strb r1, [r0] 080A423C: 4A06 ldr r2, =#0x000037BC 080A423E: 18A8 add r0, r5, r2 080A4240: 8801 ldrh r1, [r0] 080A4242: 2905 cmp r1, #0x05 080A4244: D024 beq 0x080A4290 080A4246: 2905 cmp r1, #0x05 080A4248: DC08 bgt 0x080A425C 080A424A: 2902 cmp r1, #0x02 080A424C: D00B beq 0x080A4266 080A424E: E046 b 0x080A42DE ;080A4250: 3AD6 sub r2, #0xD6 ;080A4252: 0000 lsl r0, r0, #0x0 ;080A4254: 37C4 add r7, #0xC4 ;080A4256: 0000 lsl r0, r0, #0x0 ;080A4258: 37BC add r7, #0xBC ;080A425A: 0000 lsl r0, r0, #0x0 080A425C: 2908 cmp r1, #0x08 080A425E: D027 beq 0x080A42B0 080A4260: 290B cmp r1, #0x0B 080A4262: D02F beq 0x080A42C4 080A4264: E03B b 0x080A42DE 080A4266: 4809 ldr r0, =#0x000037C5 080A4268: 182A add r2, r5, r0 080A426A: 7810 ldrb r0, [r2] 080A426C: 4001 and r1, r0 080A426E: 2900 cmp r1, #0x00 080A4270: D035 beq 0x080A42DE 080A4272: 1C20 add r0, r4, #0x0 080A4274: 4649 mov r1, r9 080A4276: 4308 orr r0, r1 080A4278: 7018 strb r0, [r3] 080A427A: 7811 ldrb r1, [r2] 080A427C: 2003 mov r0, #0x03 080A427E: 4240 neg r0, r0 080A4280: 4008 and r0, r1 080A4282: 7010 strb r0, [r2] 080A4284: A904 add r1, sp, #0x010 080A4286: 2000 mov r0, #0x00 080A4288: 7008 strb r0, [r1] 080A428A: E028 b 0x080A42DE ;080A428C: 37C5 add r7, #0xC5 ;080A428E: 0000 lsl r0, r0, #0x0 080A4290: 4A06 ldr r2, =#0x000037BE 080A4292: 18A8 add r0, r5, r2 080A4294: 8804 ldrh r4, [r0] 080A4296: 1C28 add r0, r5, #0x0 080A4298: F003 bl 080A429A: FF8C bl 0x080A81B4 080A429C: 23A9 mov r3, #0xA9 080A429E: 009B lsl r3, r3, #0x2 080A42A0: 18E8 add r0, r5, r3 080A42A2: 2100 mov r1, #0x00 080A42A4: 8004 strh r4, [r0] 080A42A6: A804 add r0, sp, #0x010 080A42A8: 7001 strb r1, [r0] 080A42AA: E018 b 0x080A42DE ;080A42AC: 37BE add r7, #0xBE ;080A42AE: 0000 lsl r0, r0, #0x0 080A42B0: 4803 ldr r0, =#0x000037BA 080A42B2: 1829 add r1, r5, r0 080A42B4: 7808 ldrb r0, [r1] 080A42B6: 464A mov r2, r9 080A42B8: 4310 orr r0, r2 080A42BA: 7008 strb r0, [r1] 080A42BC: E00F b 0x080A42DE ;080A42BE: 0000 lsl r0, r0, #0x0 ;080A42C0: 37BA add r7, #0xBA ;080A42C2: 0000 lsl r0, r0, #0x0 080A42C4: 4A0B ldr r2, =#0x02032700 080A42C6: 480C ldr r0, =#0x00009450 080A42C8: 1813 add r3, r2, r0 080A42CA: 7818 ldrb r0, [r3] 080A42CC: 2102 mov r1, #0x02 080A42CE: 4308 orr r0, r1 080A42D0: 7018 strb r0, [r3] 080A42D2: 490A ldr r1, =#0x00003AD1 080A42D4: 1868 add r0, r5, r1 080A42D6: 7800 ldrb r0, [r0] 080A42D8: 4B09 ldr r3, =#0x0000944A 080A42DA: 18D2 add r2, r2, r3 080A42DC: 7010 strb r0, [r2] 080A42DE: A804 add r0, sp, #0x010 080A42E0: 7800 ldrb r0, [r0] 080A42E2: 2800 cmp r0, #0x00 080A42E4: D100 bne 0x080A42E8 080A42E6: E0BD b 0x080A4464 080A42E8: 4806 ldr r0, =#0x020361AC 080A42EA: 2101 mov r1, #0x01 080A42EC: 2201 mov r2, #0x01 080A42EE: F011 bl 080A42F0: F9E7 bl 0x080B56C0 080A42F2: E09D b 0x080A4430 ;080A42F4: 2700 mov r7, #0x00 ;080A42F6: 0203 lsl r3, r0, #0x8 ;080A42F8: 9450 str r4, [sp, #0x140] ;080A42FA: 0000 lsl r0, r0, #0x0 ;080A42FC: 3AD1 sub r2, #0xD1 ;080A42FE: 0000 lsl r0, r0, #0x0 ;080A4300: 944A str r4, [sp, #0x128] ;080A4302: 0000 lsl r0, r0, #0x0 ;080A4304: 61AC str r4, [r5, #0x18] ;080A4306: 0203 lsl r3, r0, #0x8 080A4308: 480D ldr r0, =#0x000037BC 080A430A: 182C add r4, r5, r0 080A430C: 8820 ldrh r0, [r4] 080A430E: 280B cmp r0, #0x0B 080A4310: D900 bls 0x080A4314 080A4312: E0A7 b 0x080A4464 080A4314: 490B ldr r1, =#0x08699604 080A4316: 0080 lsl r0, r0, #0x2 080A4318: 1840 add r0, r0, r1 080A431A: 6803 ldr r3, [r0] 080A431C: 1C28 add r0, r5, #0x0 080A431E: 1C39 add r1, r7, #0x0 080A4320: 1C32 add r2, r6, #0x0 080A4322: F01C bl 080A4324: F925 bl 0x080C0570 080A4326: 0600 lsl r0, r0, #0x18 080A4328: 2800 cmp r0, #0x00 080A432A: D000 beq 0x080A432E 080A432C: E09A b 0x080A4464 080A432E: 8821 ldrh r1, [r4] 080A4330: 2904 cmp r1, #0x04 080A4332: D037 beq 0x080A43A4 080A4334: 2904 cmp r1, #0x04 080A4336: DC07 bgt 0x080A4348 080A4338: 2902 cmp r1, #0x02 080A433A: D00A beq 0x080A4352 080A433C: E07E b 0x080A443C ;080A433E: 0000 lsl r0, r0, #0x0 ;080A4340: 37BC add r7, #0xBC ;080A4342: 0000 lsl r0, r0, #0x0 ;080A4344: 9604 str r6, [sp, #0x010] ;080A4346: 0869 lsr r1, r5, #0x1 080A4348: 2905 cmp r1, #0x05 080A434A: D042 beq 0x080A43D2 080A434C: 290B cmp r1, #0x0B 080A434E: D054 beq 0x080A43FA 080A4350: E074 b 0x080A443C 080A4352: 4A0A ldr r2, =#0x000037C5 080A4354: 18A8 add r0, r5, r2 080A4356: 7800 ldrb r0, [r0] 080A4358: 4001 and r1, r0 080A435A: 2900 cmp r1, #0x00 080A435C: D012 beq 0x080A4384 080A435E: 4B08 ldr r3, =#0x000037C2 080A4360: 18E8 add r0, r5, r3 080A4362: 2110 mov r1, #0x10 080A4364: 9100 str r1, [sp] 080A4366: 2120 mov r1, #0x20 080A4368: 9101 str r1, [sp, #0x004] 080A436A: 4641 mov r1, r8 080A436C: 9102 str r1, [sp, #0x008] 080A436E: 1C31 add r1, r6, #0x0 080A4370: 2200 mov r2, #0x00 080A4372: 2302 mov r3, #0x02 080A4374: F018 bl 080A4376: F8F2 bl 0x080BC55C 080A4378: E074 b 0x080A4464 ;080A437A: 0000 lsl r0, r0, #0x0 ;080A437C: 37C5 add r7, #0xC5 ;080A437E: 0000 lsl r0, r0, #0x0 ;080A4380: 37C2 add r7, #0xC2 ;080A4382: 0000 lsl r0, r0, #0x0 080A4384: 8878 ldrh r0, [r7, #0x02] 080A4386: 2801 cmp r0, #0x01 080A4388: D96C bls 0x080A4464 080A438A: 22A9 mov r2, #0xA9 080A438C: 0092 lsl r2, r2, #0x2 080A438E: 18A9 add r1, r5, r2 080A4390: 3801 sub r0, #0x01 080A4392: 0400 lsl r0, r0, #0x10 080A4394: 0C00 lsr r0, r0, #0x10 080A4396: 9000 str r0, [sp] 080A4398: 1C38 add r0, r7, #0x0 080A439A: 1C32 add r2, r6, #0x0 080A439C: 2300 mov r3, #0x00 080A439E: F018 bl 080A43A0: F929 bl 0x080BC5F4 080A43A2: E041 b 0x080A4428 080A43A4: 887B ldrh r3, [r7, #0x02] 080A43A6: 2B01 cmp r3, #0x01 080A43A8: D95C bls 0x080A4464 080A43AA: 21A9 mov r1, #0xA9 080A43AC: 0089 lsl r1, r1, #0x2 080A43AE: 1868 add r0, r5, r1 080A43B0: 3B01 sub r3, #0x01 080A43B2: 041B lsl r3, r3, #0x10 080A43B4: 0C1B lsr r3, r3, #0x10 080A43B6: 2180 mov r1, #0x80 080A43B8: 9100 str r1, [sp] 080A43BA: 2140 mov r1, #0x40 080A43BC: 9101 str r1, [sp, #0x004] 080A43BE: 4642 mov r2, r8 080A43C0: 9202 str r2, [sp, #0x008] 080A43C2: 1C31 add r1, r6, #0x0 080A43C4: 2200 mov r2, #0x00 080A43C6: F018 bl 080A43C8: F8C9 bl 0x080BC55C 080A43CA: 0600 lsl r0, r0, #0x18 080A43CC: 2800 cmp r0, #0x00 080A43CE: D049 beq 0x080A4464 080A43D0: E02E b 0x080A4430 080A43D2: 887B ldrh r3, [r7, #0x02] 080A43D4: 2B01 cmp r3, #0x01 080A43D6: D945 bls 0x080A4464 080A43D8: 21A9 mov r1, #0xA9 080A43DA: 0089 lsl r1, r1, #0x2 080A43DC: 1868 add r0, r5, r1 080A43DE: 3B01 sub r3, #0x01 080A43E0: 041B lsl r3, r3, #0x10 080A43E2: 0C1B lsr r3, r3, #0x10 080A43E4: 2180 mov r1, #0x80 080A43E6: 9100 str r1, [sp] 080A43E8: 2140 mov r1, #0x40 080A43EA: 9101 str r1, [sp, #0x004] 080A43EC: 4642 mov r2, r8 080A43EE: 9202 str r2, [sp, #0x008] 080A43F0: 1C31 add r1, r6, #0x0 080A43F2: 2200 mov r2, #0x00 080A43F4: F018 bl 080A43F6: F8B2 bl 0x080BC55C 080A43F8: E034 b 0x080A4464 080A43FA: 23A9 mov r3, #0xA9 080A43FC: 009B lsl r3, r3, #0x2 080A43FE: 18E8 add r0, r5, r3 080A4400: 22AA mov r2, #0xAA 080A4402: 0092 lsl r2, r2, #0x2 080A4404: 18A9 add r1, r5, r2 080A4406: 4B0C ldr r3, =#0x00003ACA 080A4408: 18EC add r4, r5, r3 080A440A: 8822 ldrh r2, [r4] 080A440C: 0853 lsr r3, r2, #0x1 080A440E: 4699 mov r9, r3 080A4410: 4643 mov r3, r8 080A4412: 401A and r2, r3 080A4414: 444A add r2, r9 080A4416: 9200 str r2, [sp] 080A4418: 8822 ldrh r2, [r4] 080A441A: 9201 str r2, [sp, #0x004] 080A441C: 88FA ldrh r2, [r7, #0x06] 080A441E: 9202 str r2, [sp, #0x008] 080A4420: 1C32 add r2, r6, #0x0 080A4422: 2302 mov r3, #0x02 080A4424: F018 bl 080A4426: FA92 bl 0x080BC94C 080A4428: 0400 lsl r0, r0, #0x10 080A442A: 0C00 lsr r0, r0, #0x10 080A442C: 2802 cmp r0, #0x02 080A442E: D119 bne 0x080A4464 080A4430: 1C28 add r0, r5, #0x0 080A4432: F00E bl 080A4434: FD09 bl 0x080B2E48 080A4436: E015 b 0x080A4464 ;080A4438: 3ACA sub r2, #0xCA ;080A443A: 0000 lsl r0, r0, #0x0 080A443C: 8878 ldrh r0, [r7, #0x02] 080A443E: 2801 cmp r0, #0x01 080A4440: D910 bls 0x080A4464 080A4442: 1D39 add r1, r7, #0x4 080A4444: 3801 sub r0, #0x01 080A4446: 0400 lsl r0, r0, #0x10 080A4448: 0C00 lsr r0, r0, #0x10 080A444A: 9000 str r0, [sp] 080A444C: 1C38 add r0, r7, #0x0 080A444E: 1C32 add r2, r6, #0x0 080A4450: 2300 mov r3, #0x00 080A4452: F018 bl 080A4454: F8CF bl 0x080BC5F4 080A4456: 0400 lsl r0, r0, #0x10 080A4458: 0C00 lsr r0, r0, #0x10 080A445A: 2802 cmp r0, #0x02 080A445C: D102 bne 0x080A4464 080A445E: 1C28 add r0, r5, #0x0 080A4460: F00E bl 080A4462: FCF2 bl 0x080B2E48 080A4464: 490A ldr r1, =#0x000037BC 080A4466: 1868 add r0, r5, r1 080A4468: 8802 ldrh r2, [r0] 080A446A: 0091 lsl r1, r2, #0x2 080A446C: 4809 ldr r0, =#0x080C3628 080A446E: 180E add r6, r1, r0 080A4470: 4B09 ldr r3, =#0x000037C4 080A4472: 18E8 add r0, r5, r3 080A4474: 7801 ldrb r1, [r0] 080A4476: 2001 mov r0, #0x01 080A4478: 4684 mov r12, r0 080A447A: 4008 and r0, r1 080A447C: 2800 cmp r0, #0x00 080A447E: D100 bne 0x080A4482 080A4480: E08F b 0x080A45A2 080A4482: 2A04 cmp r2, #0x04 080A4484: D046 beq 0x080A4514 080A4486: 2A04 cmp r2, #0x04 080A4488: DC08 bgt 0x080A449C 080A448A: 2A02 cmp r2, #0x02 080A448C: D009 beq 0x080A44A2 080A448E: E075 b 0x080A457C ;080A4490: 37BC add r7, #0xBC ;080A4492: 0000 lsl r0, r0, #0x0 ;080A4494: 3628 add r6, #0x28 ;080A4496: 080C lsr r4, r1, #0x0 ;080A4498: 37C4 add r7, #0xC4 ;080A449A: 0000 lsl r0, r0, #0x0 080A449C: 2A0B cmp r2, #0x0B 080A449E: D04F beq 0x080A4540 080A44A0: E06C b 0x080A457C 080A44A2: 490E ldr r1, =#0x000037C5 080A44A4: 1868 add r0, r5, r1 080A44A6: 7800 ldrb r0, [r0] 080A44A8: 1C04 add r4, r0, #0x0 080A44AA: 4014 and r4, r2 080A44AC: 2C00 cmp r4, #0x00 080A44AE: D01B beq 0x080A44E8 080A44B0: 480B ldr r0, =#0x02032700 080A44B2: 68C0 ldr r0, [r0, #0x0C] 080A44B4: 4A0B ldr r2, =#0x000037C2 080A44B6: 18A9 add r1, r5, r2 080A44B8: 8809 ldrh r1, [r1] 080A44BA: 008A lsl r2, r1, #0x2 080A44BC: 1852 add r2, r2, r1 080A44BE: 0492 lsl r2, r2, #0x12 080A44C0: 23A8 mov r3, #0xA8 080A44C2: 03DB lsl r3, r3, #0xF 080A44C4: 18D2 add r2, r2, r3 080A44C6: 0C12 lsr r2, r2, #0x10 080A44C8: 4661 mov r1, r12 080A44CA: 9100 str r1, [sp] 080A44CC: 2100 mov r1, #0x00 080A44CE: 9101 str r1, [sp, #0x004] 080A44D0: 9102 str r1, [sp, #0x008] 080A44D2: 9103 str r1, [sp, #0x00C] 080A44D4: 2310 mov r3, #0x10 080A44D6: F01A bl 080A44D8: F9B7 bl 0x080BE848 080A44DA: E062 b 0x080A45A2 ;080A44DC: 37C5 add r7, #0xC5 ;080A44DE: 0000 lsl r0, r0, #0x0 ;080A44E0: 2700 mov r7, #0x00 ;080A44E2: 0203 lsl r3, r0, #0x8 ;080A44E4: 37C2 add r7, #0xC2 ;080A44E6: 0000 lsl r0, r0, #0x0 080A44E8: 4809 ldr r0, =#0x02032700 080A44EA: 68C0 ldr r0, [r0, #0x0C] 080A44EC: 8832 ldrh r2, [r6] 080A44EE: 88BB ldrh r3, [r7, #0x04] 080A44F0: 8939 ldrh r1, [r7, #0x08] 080A44F2: 1A5B sub r3, r3, r1 080A44F4: 011B lsl r3, r3, #0x4 080A44F6: 8876 ldrh r6, [r6, #0x02] 080A44F8: 199B add r3, r3, r6 080A44FA: 041B lsl r3, r3, #0x10 080A44FC: 0C1B lsr r3, r3, #0x10 080A44FE: 4661 mov r1, r12 080A4500: 9100 str r1, [sp] 080A4502: 9401 str r4, [sp, #0x004] 080A4504: 9402 str r4, [sp, #0x008] 080A4506: 9403 str r4, [sp, #0x00C] 080A4508: 2100 mov r1, #0x00 080A450A: F01A bl 080A450C: F99D bl 0x080BE848 080A450E: E048 b 0x080A45A2 ;080A4510: 2700 mov r7, #0x00 ;080A4512: 0203 lsl r3, r0, #0x8 080A4514: 4809 ldr r0, =#0x02032700 080A4516: 68C0 ldr r0, [r0, #0x0C] 080A4518: 88B9 ldrh r1, [r7, #0x04] 080A451A: 004B lsl r3, r1, #0x1 080A451C: 185B add r3, r3, r1 080A451E: 04DB lsl r3, r3, #0x13 080A4520: 22E0 mov r2, #0xE0 080A4522: 0312 lsl r2, r2, #0xC 080A4524: 189B add r3, r3, r2 080A4526: 0C1B lsr r3, r3, #0x10 080A4528: 4661 mov r1, r12 080A452A: 9100 str r1, [sp] 080A452C: 2100 mov r1, #0x00 080A452E: 9101 str r1, [sp, #0x004] 080A4530: 9102 str r1, [sp, #0x008] 080A4532: 9103 str r1, [sp, #0x00C] 080A4534: 2200 mov r2, #0x00 080A4536: F01A bl 080A4538: F987 bl 0x080BE848 080A453A: E032 b 0x080A45A2 ;080A453C: 2700 mov r7, #0x00 ;080A453E: 0203 lsl r3, r0, #0x8 080A4540: 480D ldr r0, =#0x02032700 080A4542: 68C0 ldr r0, [r0, #0x0C] 080A4544: 88BA ldrh r2, [r7, #0x04] 080A4546: 4661 mov r1, r12 080A4548: 4011 and r1, r2 080A454A: 2254 mov r2, #0x54 080A454C: 434A mul r2, r1 080A454E: 3238 add r2, #0x38 080A4550: 88BB ldrh r3, [r7, #0x04] 080A4552: 8939 ldrh r1, [r7, #0x08] 080A4554: 1A5B sub r3, r3, r1 080A4556: 0FD9 lsr r1, r3, #0x1F 080A4558: 185B add r3, r3, r1 080A455A: 105B asr r3, r3, #0x1 080A455C: 051B lsl r3, r3, #0x14 080A455E: 21D0 mov r1, #0xD0 080A4560: 03C9 lsl r1, r1, #0xF 080A4562: 185B add r3, r3, r1 080A4564: 0C1B lsr r3, r3, #0x10 080A4566: 4661 mov r1, r12 080A4568: 9100 str r1, [sp] 080A456A: 2100 mov r1, #0x00 080A456C: 9101 str r1, [sp, #0x004] 080A456E: 9102 str r1, [sp, #0x008] 080A4570: 9103 str r1, [sp, #0x00C] 080A4572: F01A bl 080A4574: F969 bl 0x080BE848 080A4576: E014 b 0x080A45A2 ;080A4578: 2700 mov r7, #0x00 ;080A457A: 0203 lsl r3, r0, #0x8 080A457C: 480C ldr r0, =#0x02032700 080A457E: 68C0 ldr r0, [r0, #0x0C] 080A4580: 8832 ldrh r2, [r6] 080A4582: 88BB ldrh r3, [r7, #0x04] 080A4584: 8939 ldrh r1, [r7, #0x08] 080A4586: 1A5B sub r3, r3, r1 080A4588: 011B lsl r3, r3, #0x4 080A458A: 8876 ldrh r6, [r6, #0x02] 080A458C: 199B add r3, r3, r6 080A458E: 041B lsl r3, r3, #0x10 080A4590: 0C1B lsr r3, r3, #0x10 080A4592: 2101 mov r1, #0x01 080A4594: 9100 str r1, [sp] 080A4596: 2100 mov r1, #0x00 080A4598: 9101 str r1, [sp, #0x004] 080A459A: 9102 str r1, [sp, #0x008] 080A459C: 9103 str r1, [sp, #0x00C] 080A459E: F01A bl 080A45A0: F953 bl 0x080BE848 080A45A2: B005 add sp, #0x014 080A45A4: BC18 pop {r3, r4} 080A45A6: 4698 mov r8, r3 080A45A8: 46A1 mov r9, r4 080A45AA: BCF0 pop {r4, r5, r6, r7} 080A45AC: BC01 pop {r0} 080A45AE: 4700 bx r0 ;080A45B0: 2700 mov r7, #0x00 ;080A45B2: 0203 lsl r3, r0, #0x8
$080A4D8C - ?
080A4D8C: B570 push {r4, r5, r6, lr} 080A4D8E: B084 add sp, #-0x010 080A4D90: 1C05 add r5, r0, #0x0 080A4D92: 1C0B add r3, r1, #0x0 080A4D94: 4909 ldr r1, =#0x000037D5 080A4D96: 1868 add r0, r5, r1 080A4D98: 7800 ldrb r0, [r0] 080A4D9A: 07C0 lsl r0, r0, #0x1F 080A4D9C: 2800 cmp r0, #0x00 080A4D9E: D013 beq 0x080A4DC8 080A4DA0: 4A07 ldr r2, =#0x000037CE 080A4DA2: 18A8 add r0, r5, r2 080A4DA4: 8800 ldrh r0, [r0] 080A4DA6: 2877 cmp r0, #0x77 080A4DA8: D90E bls 0x080A4DC8 080A4DAA: 4806 ldr r0, =#0x000037D3 080A4DAC: 182A add r2, r5, r0 080A4DAE: 7811 ldrb r1, [r2] 080A4DB0: 2002 mov r0, #0x02 080A4DB2: 4240 neg r0, r0 080A4DB4: 4008 and r0, r1 080A4DB6: 7010 strb r0, [r2] 080A4DB8: E0E3 b 0x080A4F82 ;080A4DBA: 0000 lsl r0, r0, #0x0 ;080A4DBC: 37D5 add r7, #0xD5 ;080A4DBE: 0000 lsl r0, r0, #0x0 ;080A4DC0: 37CE add r7, #0xCE ;080A4DC2: 0000 lsl r0, r0, #0x0 ;080A4DC4: 37D3 add r7, #0xD3 ;080A4DC6: 0000 lsl r0, r0, #0x0 080A4DC8: 4912 ldr r1, =#0x00003AD6 080A4DCA: 1868 add r0, r5, r1 080A4DCC: 7801 ldrb r1, [r0] 080A4DCE: 2001 mov r0, #0x01 080A4DD0: 4008 and r0, r1 080A4DD2: 2800 cmp r0, #0x00 080A4DD4: D040 beq 0x080A4E58 080A4DD6: 8818 ldrh r0, [r3] 080A4DD8: 2802 cmp r0, #0x02 080A4DDA: D12F bne 0x080A4E3C 080A4DDC: 4A0E ldr r2, =#0x000037D3 080A4DDE: 18AC add r4, r5, r2 080A4DE0: 7820 ldrb r0, [r4] 080A4DE2: 0740 lsl r0, r0, #0x1D 080A4DE4: 2800 cmp r0, #0x00 080A4DE6: DB37 blt 0x080A4E58 080A4DE8: 201A mov r0, #0x1A 080A4DEA: F7B6 bl 080A4DEC: FBBB bl 0x0805B564 080A4DEE: 7821 ldrb r1, [r4] 080A4DF0: 2002 mov r0, #0x02 080A4DF2: 4240 neg r0, r0 080A4DF4: 4008 and r0, r1 080A4DF6: 7020 strb r0, [r4] 080A4DF8: 4908 ldr r1, =#0x000037C8 080A4DFA: 1868 add r0, r5, r1 080A4DFC: 8800 ldrh r0, [r0] 080A4DFE: 2813 cmp r0, #0x13 080A4E00: D110 bne 0x080A4E24 080A4E02: 4A07 ldr r2, =#0x000037CC 080A4E04: 18A8 add r0, r5, r2 080A4E06: 8800 ldrh r0, [r0] 080A4E08: 2861 cmp r0, #0x61 080A4E0A: D10B bne 0x080A4E24 080A4E0C: 2003 mov r0, #0x03 080A4E0E: F001 bl 080A4E10: FFCD bl 0x080A6DAC 080A4E12: E021 b 0x080A4E58 ;080A4E14: 3AD6 sub r2, #0xD6 ;080A4E16: 0000 lsl r0, r0, #0x0 ;080A4E18: 37D3 add r7, #0xD3 ;080A4E1A: 0000 lsl r0, r0, #0x0 ;080A4E1C: 37C8 add r7, #0xC8 ;080A4E1E: 0000 lsl r0, r0, #0x0 ;080A4E20: 37CC add r7, #0xCC ;080A4E22: 0000 lsl r0, r0, #0x0 080A4E24: 4903 ldr r1, =#0x000037D2 080A4E26: 1868 add r0, r5, r1 080A4E28: 7801 ldrb r1, [r0] 080A4E2A: 4A03 ldr r2, =#0x00003AD0 080A4E2C: 18A8 add r0, r5, r2 080A4E2E: 7001 strb r1, [r0] 080A4E30: E012 b 0x080A4E58 ;080A4E32: 0000 lsl r0, r0, #0x0 ;080A4E34: 37D2 add r7, #0xD2 ;080A4E36: 0000 lsl r0, r0, #0x0 ;080A4E38: 3AD0 sub r2, #0xD0 ;080A4E3A: 0000 lsl r0, r0, #0x0 080A4E3C: 4814 ldr r0, =#0x000037C8 080A4E3E: 1829 add r1, r5, r0 080A4E40: 8808 ldrh r0, [r1] 080A4E42: 2813 cmp r0, #0x13 080A4E44: D808 bhi 0x080A4E58 080A4E46: 4813 ldr r0, =#0x08699634 080A4E48: 8809 ldrh r1, [r1] 080A4E4A: 0089 lsl r1, r1, #0x2 080A4E4C: 1809 add r1, r1, r0 080A4E4E: 680A ldr r2, [r1] 080A4E50: 1C28 add r0, r5, #0x0 080A4E52: 1C19 add r1, r3, #0x0 080A4E54: F01B bl 080A4E56: FB8A bl 0x080C056C ; bx r2 080A4E58: 490D ldr r1, =#0x000037C8 080A4E5A: 1868 add r0, r5, r1 080A4E5C: 8803 ldrh r3, [r0] 080A4E5E: 00D9 lsl r1, r3, #0x3 080A4E60: 1AC9 sub r1, r1, r3 080A4E62: 0089 lsl r1, r1, #0x2 080A4E64: 480C ldr r0, =#0x080C3660 080A4E66: 1809 add r1, r1, r0 080A4E68: 4A0C ldr r2, =#0x000037CA 080A4E6A: 18A8 add r0, r5, r2 080A4E6C: 8800 ldrh r0, [r0] 080A4E6E: 0080 lsl r0, r0, #0x2 080A4E70: 180C add r4, r1, r0 080A4E72: 490B ldr r1, =#0x000037D3 080A4E74: 1868 add r0, r5, r1 080A4E76: 7801 ldrb r1, [r0] 080A4E78: 2011 mov r0, #0x11 080A4E7A: 4008 and r0, r1 080A4E7C: 2801 cmp r0, #0x01 080A4E7E: D174 bne 0x080A4F6A 080A4E80: 2B10 cmp r3, #0x10 080A4E82: D012 beq 0x080A4EAA 080A4E84: 2B10 cmp r3, #0x10 080A4E86: DC0D bgt 0x080A4EA4 080A4E88: 2B07 cmp r3, #0x07 080A4E8A: D029 beq 0x080A4EE0 080A4E8C: E062 b 0x080A4F54 ;080A4E8E: 0000 lsl r0, r0, #0x0 ;080A4E90: 37C8 add r7, #0xC8 ;080A4E92: 0000 lsl r0, r0, #0x0 ;080A4E94: 9634 str r6, [sp, #0x0D0] ;080A4E96: 0869 lsr r1, r5, #0x1 ;080A4E98: 3660 add r6, #0x60 ;080A4E9A: 080C lsr r4, r1, #0x0 ;080A4E9C: 37CA add r7, #0xCA ;080A4E9E: 0000 lsl r0, r0, #0x0 ;080A4EA0: 37D3 add r7, #0xD3 ;080A4EA2: 0000 lsl r0, r0, #0x0 080A4EA4: 2B13 cmp r3, #0x13 080A4EA6: D035 beq 0x080A4F14 080A4EA8: E054 b 0x080A4F54 080A4EAA: 480B ldr r0, =#0x02032700 080A4EAC: 68C6 ldr r6, [r0, #0x0C] 080A4EAE: 8822 ldrh r2, [r4] 080A4EB0: 490A ldr r1, =#0x000038F0 080A4EB2: 1868 add r0, r5, r1 080A4EB4: 7801 ldrb r1, [r0] 080A4EB6: 2003 mov r0, #0x03 080A4EB8: 4008 and r0, r1 080A4EBA: 2800 cmp r0, #0x00 080A4EBC: D103 bne 0x080A4EC6 080A4EBE: 1C10 add r0, r2, #0x0 080A4EC0: 3044 add r0, #0x44 080A4EC2: 0400 lsl r0, r0, #0x10 080A4EC4: 0C02 lsr r2, r0, #0x10 080A4EC6: 8863 ldrh r3, [r4, #0x02] 080A4EC8: 2000 mov r0, #0x00 080A4ECA: 9000 str r0, [sp] 080A4ECC: 9001 str r0, [sp, #0x004] 080A4ECE: 9002 str r0, [sp, #0x008] 080A4ED0: 9003 str r0, [sp, #0x00C] 080A4ED2: 1C30 add r0, r6, #0x0 080A4ED4: E014 b 0x080A4F00 ;080A4ED6: 0000 lsl r0, r0, #0x0 ;080A4ED8: 2700 mov r7, #0x00 ;080A4EDA: 0203 lsl r3, r0, #0x8 ;080A4EDC: 38F0 sub r0, #0xF0 ;080A4EDE: 0000 lsl r0, r0, #0x0 080A4EE0: 4A09 ldr r2, =#0x02032700 080A4EE2: 490A ldr r1, =#0x00009448 080A4EE4: 1850 add r0, r2, r1 080A4EE6: 7801 ldrb r1, [r0] 080A4EE8: 2900 cmp r1, #0x00 080A4EEA: D111 bne 0x080A4F10 080A4EEC: 68D0 ldr r0, [r2, #0x0C] 080A4EEE: 8822 ldrh r2, [r4] 080A4EF0: 3A08 sub r2, #0x08 080A4EF2: 0412 lsl r2, r2, #0x10 080A4EF4: 0C12 lsr r2, r2, #0x10 080A4EF6: 8863 ldrh r3, [r4, #0x02] 080A4EF8: 9100 str r1, [sp] 080A4EFA: 9101 str r1, [sp, #0x004] 080A4EFC: 9102 str r1, [sp, #0x008] 080A4EFE: 9103 str r1, [sp, #0x00C] 080A4F00: 2100 mov r1, #0x00 080A4F02: F019 bl 080A4F04: FCA1 bl 0x080BE848 080A4F06: E030 b 0x080A4F6A ;080A4F08: 2700 mov r7, #0x00 ;080A4F0A: 0203 lsl r3, r0, #0x8 ;080A4F0C: 9448 str r4, [sp, #0x120] ;080A4F0E: 0000 lsl r0, r0, #0x0 080A4F10: 68D0 ldr r0, [r2, #0x0C] 080A4F12: E013 b 0x080A4F3C 080A4F14: 4A06 ldr r2, =#0x000037CC 080A4F16: 18A8 add r0, r5, r2 080A4F18: 8800 ldrh r0, [r0] 080A4F1A: 285F cmp r0, #0x5F 080A4F1C: D001 beq 0x080A4F22 080A4F1E: 2861 cmp r0, #0x61 080A4F20: D10A bne 0x080A4F38 080A4F22: 4804 ldr r0, =#0x02032700 080A4F24: 68C0 ldr r0, [r0, #0x0C] 080A4F26: 8822 ldrh r2, [r4] 080A4F28: 3A08 sub r2, #0x08 080A4F2A: 0412 lsl r2, r2, #0x10 080A4F2C: 0C12 lsr r2, r2, #0x10 080A4F2E: E006 b 0x080A4F3E ;080A4F30: 37CC add r7, #0xCC ;080A4F32: 0000 lsl r0, r0, #0x0 080A4F34: 2700 mov r7, #0x00 080A4F36: 0203 lsl r3, r0, #0x8 080A4F38: 4805 ldr r0, =#0x02032700 080A4F3A: 68C0 ldr r0, [r0, #0x0C] 080A4F3C: 8822 ldrh r2, [r4] 080A4F3E: 8863 ldrh r3, [r4, #0x02] 080A4F40: 2100 mov r1, #0x00 080A4F42: 9100 str r1, [sp] 080A4F44: 9101 str r1, [sp, #0x004] 080A4F46: 9102 str r1, [sp, #0x008] 080A4F48: 9103 str r1, [sp, #0x00C] 080A4F4A: F019 bl 080A4F4C: FC7D bl 0x080BE848 080A4F4E: E00C b 0x080A4F6A ;080A4F50: 2700 mov r7, #0x00 ;080A4F52: 0203 lsl r3, r0, #0x8 080A4F54: 480D ldr r0, =#0x02032700 080A4F56: 68C0 ldr r0, [r0, #0x0C] 080A4F58: 8822 ldrh r2, [r4] 080A4F5A: 8863 ldrh r3, [r4, #0x02] 080A4F5C: 2100 mov r1, #0x00 080A4F5E: 9100 str r1, [sp] 080A4F60: 9101 str r1, [sp, #0x004] 080A4F62: 9102 str r1, [sp, #0x008] 080A4F64: 9103 str r1, [sp, #0x00C] 080A4F66: F019 bl 080A4F68: FC6F bl 0x080BE848 080A4F6A: 4809 ldr r0, =#0x000037D3 080A4F6C: 182A add r2, r5, r0 080A4F6E: 7811 ldrb r1, [r2] 080A4F70: 2011 mov r0, #0x11 080A4F72: 4240 neg r0, r0 080A4F74: 4008 and r0, r1 080A4F76: 7010 strb r0, [r2] 080A4F78: 4A06 ldr r2, =#0x000037CE 080A4F7A: 18A9 add r1, r5, r2 080A4F7C: 8808 ldrh r0, [r1] 080A4F7E: 3001 add r0, #0x01 080A4F80: 8008 strh r0, [r1] 080A4F82: B004 add sp, #0x010 080A4F84: BC70 pop {r4, r5, r6} 080A4F86: BC01 pop {r0} 080A4F88: 4700 bx r0 ;080A4F8A: 0000 lsl r0, r0, #0x0 ;080A4F8C: 2700 mov r7, #0x00 ;080A4F8E: 0203 lsl r3, r0, #0x8 ;080A4F90: 37D3 add r7, #0xD3 ;080A4F92: 0000 lsl r0, r0, #0x0 ;080A4F94: 37CE add r7, #0xCE ;080A4F96: 0000 lsl r0, r0, #0x0
$080A5B84 - ?
080A5B84: B530 push {r4, r5, lr} 080A5B86: 1C05 add r5, r0, #0x0 080A5B88: 1C0A add r2, r1, #0x0 080A5B8A: 490B ldr r1, =#0x00003AD6 080A5B8C: 1868 add r0, r5, r1 080A5B8E: 7801 ldrb r1, [r0] 080A5B90: 2001 mov r0, #0x01 080A5B92: 4008 and r0, r1 080A5B94: 2800 cmp r0, #0x00 080A5B96: D042 beq 0x080A5C1E 080A5B98: 8811 ldrh r1, [r2] 080A5B9A: 2904 cmp r1, #0x04 080A5B9C: D001 beq 0x080A5BA2 080A5B9E: 2902 cmp r1, #0x02 080A5BA0: D10E bne 0x080A5BC0 080A5BA2: 201A mov r0, #0x1A 080A5BA4: F7B5 bl 080A5BA6: FCDE bl 0x0805B564 080A5BA8: 4804 ldr r0, =#0x00003826 080A5BAA: 182A add r2, r5, r0 080A5BAC: 7811 ldrb r1, [r2] 080A5BAE: 2002 mov r0, #0x02 080A5BB0: 4240 neg r0, r0 080A5BB2: 4008 and r0, r1 080A5BB4: 7010 strb r0, [r2] 080A5BB6: E032 b 0x080A5C1E ;080A5BB8: 3AD6 sub r2, #0xD6 ;080A5BBA: 0000 lsl r0, r0, #0x0 ;080A5BBC: 3826 sub r0, #0x26 ;080A5BBE: 0000 lsl r0, r0, #0x0 080A5BC0: 2940 cmp r1, #0x40 080A5BC2: D117 bne 0x080A5BF4 080A5BC4: 4908 ldr r1, =#0x00003824 080A5BC6: 1868 add r0, r5, r1 080A5BC8: 8800 ldrh r0, [r0] 080A5BCA: 2801 cmp r0, #0x01 080A5BCC: D927 bls 0x080A5C1E 080A5BCE: 2018 mov r0, #0x18 080A5BD0: F7B5 bl 080A5BD2: FCC8 bl 0x0805B564 ; - Jump SR 080A5BD4: 4905 ldr r1, =#0x00003820 080A5BD6: 1868 add r0, r5, r1 080A5BD8: 8801 ldrh r1, [r0] 080A5BDA: 3902 sub r1, #0x02 080A5BDC: 8001 strh r1, [r0] 080A5BDE: 4904 ldr r1, =#0x000037E0 080A5BE0: 1868 add r0, r5, r1 080A5BE2: F003 bl 080A5BE4: FB59 bl 0x080A9298 080A5BE6: E01A b 0x080A5C1E ;080A5BE8: 3824 sub r0, #0x24 ;080A5BEA: 0000 lsl r0, r0, #0x0 ;080A5BEC: 3820 sub r0, #0x20 ;080A5BEE: 0000 lsl r0, r0, #0x0 ;080A5BF0: 37E0 add r7, #0xE0 ;080A5BF2: 0000 lsl r0, r0, #0x0 080A5BF4: 2980 cmp r1, #0x80 080A5BF6: D112 bne 0x080A5C1E 080A5BF8: 490A ldr r1, =#0x00003824 080A5BFA: 1868 add r0, r5, r1 080A5BFC: 8801 ldrh r1, [r0] 080A5BFE: 480A ldr r0, =#0x00003820 080A5C00: 182C add r4, r5, r0 080A5C02: 8820 ldrh r0, [r4] 080A5C04: 3002 add r0, #0x02 080A5C06: 4281 cmp r1, r0 080A5C08: DD09 ble 0x080A5C1E 080A5C0A: 2018 mov r0, #0x18 080A5C0C: F7B5 bl 080A5C0E: FCAA bl 0x0805B564 ;Jump SR 080A5C10: 8820 ldrh r0, [r4] 080A5C12: 3002 add r0, #0x02 080A5C14: 8020 strh r0, [r4] 080A5C16: 4905 ldr r1, =#0x000037E0 080A5C18: 1868 add r0, r5, r1 080A5C1A: F003 bl 080A5C1C: FB3D bl 0x080A9298 080A5C1E: BC30 pop {r4, r5} 080A5C20: BC01 pop {r0} 080A5C22: 4700 bx r0 ;080A5C24: 3824 sub r0, #0x24 ;080A5C26: 0000 lsl r0, r0, #0x0 ;080A5C28: 3820 sub r0, #0x20 ;080A5C2A: 0000 lsl r0, r0, #0x0 ;080A5C2C: 37E0 add r7, #0xE0 ;080A5C2E: 0000 lsl r0, r0, #0x0
$080A6DAC - ?
080A6DAC: B510 push {r4, lr} 080A6DAE: 4B06 ldr r3, =#0x02032700 080A6DB0: 4906 ldr r1, =#0x0000944D 080A6DB2: 185C add r4, r3, r1 080A6DB4: 7821 ldrb r1, [r4] 080A6DB6: 2201 mov r2, #0x01 080A6DB8: 4311 orr r1, r2 080A6DBA: 7021 strb r1, [r4] 080A6DBC: 4904 ldr r1, =#0x00009449 080A6DBE: 185B add r3, r3, r1 080A6DC0: 7018 strb r0, [r3] 080A6DC2: BC10 pop {r4} 080A6DC4: BC01 pop {r0} 080A6DC6: 4700 bx r0 ;DATA ;============ ;080A6DC8: 2700 mov r7, #0x00 ;080A6DCA: 0203 lsl r3, r0, #0x8 ;080A6DCC: 944D str r4, [sp, #0x134] ;080A6DCE: 0000 lsl r0, r0, #0x0 ;080A6DD0: 9449 str r4, [sp, #0x124] ;080A6DD2: 0000 lsl r0, r0, #0x0
$080A6DD4 - ?
080A6DD4: B500 push {lr} 080A6DD6: 1C03 add r3, r0, #0x0 080A6DD8: 4806 ldr r0, =#0x02032700 080A6DDA: 4A07 ldr r2, =#0x00009448 080A6DDC: 1881 add r1, r0, r2 080A6DDE: 7809 ldrb r1, [r1] ; Load Byte from $0203BB48 080A6DE0: 3901 sub r1, #0x01 ; Subtract 1 from byte 080A6DE2: 1C02 add r2, r0, #0x0 ; r2 = #$02032700 080A6DE4: 2906 cmp r1, #0x06 080A6DE6: D824 bhi 0x080A6E32 ; If Byte is > #$06, exit 080A6DE8: 0088 lsl r0, r1, #0x2 ; Else, use it as index for address table... 080A6DEA: 4904 ldr r1, =#0x080A6E00 ; ... at $080A6E00 and jump to that address. 080A6DEC: 1840 add r0, r0, r1 080A6DEE: 6800 ldr r0, [r0] ; Load Address 080A6DF0: 4687 mov pc, r0 ; Store it in Program Counter ;080A6DF2: 0000 lsl r0, r0, #0x0 ;080A6DF4: 2700 mov r7, #0x00 ;080A6DF6: 0203 lsl r3, r0, #0x8 ;080A6DF8: 9448 str r4, [sp, #0x120] ;080A6DFA: 0000 lsl r0, r0, #0x0 ;080A6DFC: 6E00 ldr r0, [r0, #0x60] ;080A6DFE: 080A lsr r2, r1, #0x0 ; JUMP TABLE ; entry 0,1: $080A6E26 ; entry 2: $080A6E32 ; entry 3: $080A6E26 ; entry 4: $080A6E1C ; entry 5,6: $080A6E26 ;080A6E00: 6E26 ldr r6, [r4, #0x60] ;080A6E02: 080A lsr r2, r1, #0x0 ;080A6E04: 6E26 ldr r6, [r4, #0x60] ;080A6E06: 080A lsr r2, r1, #0x0 ;080A6E08: 6E32 ldr r2, [r6, #0x60] ;080A6E0A: 080A lsr r2, r1, #0x0 ;080A6E0C: 6E26 ldr r6, [r4, #0x60] ;080A6E0E: 080A lsr r2, r1, #0x0 ;080A6E10: 6E1C ldr r4, [r3, #0x60] ;080A6E12: 080A lsr r2, r1, #0x0 ;080A6E14: 6E26 ldr r6, [r4, #0x60] ;080A6E16: 080A lsr r2, r1, #0x0 ;080A6E18: 6E26 ldr r6, [r4, #0x60] ;080A6E1A: 080A lsr r2, r1, #0x0 ; entry 4: $080A6E1C 080A6E1C: 4906 ldr r1, =#0x00003EEC 080A6E1E: 1850 add r0, r2, r1 080A6E20: 8800 ldrh r0, [r0] 080A6E22: 2801 cmp r0, #0x01 080A6E24: D105 bne 0x080A6E32 ; entry 0,1,3,5,6: $080A6E26 080A6E26: 8858 ldrh r0, [r3, #0x02] 080A6E28: 280F cmp r0, #0x0F 080A6E2A: D102 bne 0x080A6E32 080A6E2C: 20FF mov r0, #0xFF 080A6E2E: F018 bl 080A6E30: FDC7 bl 0x080BF9C0 ; entry 2: $080A6E32 080A6E32: BC01 pop {r0} 080A6E34: 4700 bx r0 ;080A6E36: 0000 lsl r0, r0, #0x0 ;080A6E38: 3EEC sub r6, #0xEC ;080A6E3A: 0000 lsl r0, r0, #0x0
$080A6E3C - ?
080A6E3C: B530 push {r4, r5, lr} 080A6E3E: 1C04 add r4, r0, #0x0 080A6E40: 4D11 ldr r5, =#0x02032700 080A6E42: 4912 ldr r1, =#0x0000944E 080A6E44: 1868 add r0, r5, r1 ; r0 = $0203BB4E 080A6E46: 7800 ldrb r0, [r0] ; r0 = [$0203BB4E] 080A6E48: 0640 lsl r0, r0, #0x19 ; Remove everything but the lowest seven bits 080A6E4A: 2800 cmp r0, #0x00 080A6E4C: DA30 bge 0x080A6EB0 ; Exit if they're = 0 080A6E4E: 6928 ldr r0, [r5, #0x10] 080A6E50: F00F bl 080A6E52: FE2C bl 0x080B6AAC 080A6E54: 0600 lsl r0, r0, #0x18 080A6E56: 2800 cmp r0, #0x00 080A6E58: D01E beq 0x080A6E98 080A6E5A: 207B mov r0, #0x7B 080A6E5C: F7B4 bl 080A6E5E: FB82 bl 0x0805B564 ; Jump SR 080A6E60: 480B ldr r0, =#0x000037D3 080A6E62: 1822 add r2, r4, r0 080A6E64: 7811 ldrb r1, [r2] 080A6E66: 2002 mov r0, #0x02 080A6E68: 4240 neg r0, r0 080A6E6A: 4008 and r0, r1 080A6E6C: 7010 strb r0, [r2] 080A6E6E: 4909 ldr r1, =#0x00009450 080A6E70: 186A add r2, r5, r1 080A6E72: 7810 ldrb r0, [r2] 080A6E74: 2110 mov r1, #0x10 080A6E76: 4308 orr r0, r1 080A6E78: 7010 strb r0, [r2] 080A6E7A: 1C20 add r0, r4, #0x0 080A6E7C: F00B bl 080A6E7E: FFE4 bl 0x080B2E48 080A6E80: 2001 mov r0, #0x01 080A6E82: F7FF bl 080A6E84: FF93 bl 0x080A6DAC 080A6E86: E013 b 0x080A6EB0 ;080A6E88: 2700 mov r7, #0x00 ;080A6E8A: 0203 lsl r3, r0, #0x8 ;080A6E8C: 944E str r4, [sp, #0x138] ;080A6E8E: 0000 lsl r0, r0, #0x0 ;080A6E90: 37D3 add r7, #0xD3 ;080A6E92: 0000 lsl r0, r0, #0x0 ;080A6E94: 9450 str r4, [sp, #0x140] ;080A6E96: 0000 lsl r0, r0, #0x0 080A6E98: 201B mov r0, #0x1B 080A6E9A: F7B4 bl 080A6E9C: FB63 bl 0x0805B564 ; Jump SR 080A6E9E: 4806 ldr r0, =#0x000037CC 080A6EA0: 1821 add r1, r4, r0 080A6EA2: 207A mov r0, #0x7A 080A6EA4: 8008 strh r0, [r1] 080A6EA6: 1C20 add r0, r4, #0x0 080A6EA8: 2100 mov r1, #0x00 080A6EAA: 2212 mov r2, #0x12 080A6EAC: F001 bl 080A6EAE: FFFE bl 0x080A8EAC 080A6EB0: BC30 pop {r4, r5} 080A6EB2: BC01 pop {r0} 080A6EB4: 4700 bx r0 ;080A6EB6: 0000 lsl r0, r0, #0x0 ;080A6EB8: 37CC add r7, #0xCC ;080A6EBA: 0000 lsl r0, r0, #0x0
$080A6EBC - ?
080A6EBC: B530 push {r4, r5, lr} 080A6EBE: 1C04 add r4, r0, #0x0 080A6EC0: 4D0D ldr r5, =#0x02032700 080A6EC2: 490E ldr r1, =#0x0000944E 080A6EC4: 1868 add r0, r5, r1 ; r0 = $0203BB4E 080A6EC6: 7800 ldrb r0, [r0] ; r0 = [$0203BB4E] 080A6EC8: 09C0 lsr r0, r0, #0x7 ; Remove everything but the lowest seven bits 080A6ECA: 2800 cmp r0, #0x00 080A6ECC: D026 beq 0x080A6F1C ; Exit if they're = 0 080A6ECE: 6928 ldr r0, [r5, #0x10] 080A6ED0: F00F bl 080A6ED2: FDC6 bl 0x080B6A60 080A6ED4: 0600 lsl r0, r0, #0x18 080A6ED6: 2800 cmp r0, #0x00 080A6ED8: D014 beq 0x080A6F04 080A6EDA: 4809 ldr r0, =#0x000037D3 080A6EDC: 1822 add r2, r4, r0 080A6EDE: 7811 ldrb r1, [r2] 080A6EE0: 2002 mov r0, #0x02 080A6EE2: 4240 neg r0, r0 080A6EE4: 4008 and r0, r1 080A6EE6: 7010 strb r0, [r2] 080A6EE8: 6929 ldr r1, [r5, #0x10] 080A6EEA: 1C20 add r0, r4, #0x0 080A6EEC: F016 bl 080A6EEE: FD62 bl 0x080BD9B4 080A6EF0: 2002 mov r0, #0x02 080A6EF2: F7FF bl 080A6EF4: FF5B bl 0x080A6DAC 080A6EF6: E011 b 0x080A6F1C ;080A6EF8: 2700 mov r7, #0x00 ;080A6EFA: 0203 lsl r3, r0, #0x8 ;080A6EFC: 944E str r4, [sp, #0x138] ;080A6EFE: 0000 lsl r0, r0, #0x0 ;080A6F00: 37D3 add r7, #0xD3 ;080A6F02: 0000 lsl r0, r0, #0x0 080A6F04: 201B mov r0, #0x1B 080A6F06: F7B4 bl 080A6F08: FB2D bl 0x0805B564 080A6F0A: 4806 ldr r0, =#0x000037CC 080A6F0C: 1821 add r1, r4, r0 080A6F0E: 2079 mov r0, #0x79 080A6F10: 8008 strh r0, [r1] 080A6F12: 1C20 add r0, r4, #0x0 080A6F14: 2100 mov r1, #0x00 080A6F16: 2212 mov r2, #0x12 080A6F18: F001 bl 080A6F1A: FFC8 bl 0x080A8EAC 080A6F1C: BC30 pop {r4, r5} 080A6F1E: BC01 pop {r0} 080A6F20: 4700 bx r0 ;080A6F22: 0000 lsl r0, r0, #0x0 ;080A6F24: 37CC add r7, #0xCC ;080A6F26: 0000 lsl r0, r0, #0x0
$080A6F28 - ?
Both r0 and r1 contain addresses. r0 is an offset, r1 an address from where actually something is loaded.
In the end, r0 is once again used as a flag register.
080A6F28: B530 push {r4, r5, lr} 080A6F2A: 1C04 add r4, r0, #0x0 080A6F2C: 1C0B add r3, r1, #0x0 080A6F2E: 492E ldr r1, =#0x00003AD6 080A6F30: 1860 add r0, r4, r1 ; r0 = Original r0 + #$00003AD6 080A6F32: 7801 ldrb r1, [r0] 080A6F34: 2501 mov r5, #0x01 080A6F36: 1C28 add r0, r5, #0x0 ; Increment load address 080A6F38: 4008 and r0, r1 ; ??? 080A6F3A: 2800 cmp r0, #0x00 080A6F3C: D072 beq 0x080A7024 ; set r0 to #$00 and exit if equal 080A6F3E: 4A2B ldr r2, =#0x00003826 080A6F40: 18A0 add r0, r4, r2 ; r0 = Original r0 + #$00003826 080A6F42: 7802 ldrb r2, [r0] 080A6F44: 07D2 lsl r2, r2, #0x1F ; Remove everything but the LSB 080A6F46: 492A ldr r1, =#0x000037DD 080A6F48: 1860 add r0, r4, r1 ; r0 = Original r0 + #$000037DD 080A6F4A: 7801 ldrb r1, [r0] 080A6F4C: 07C9 lsl r1, r1, #0x1F ; Remove everything but the LSB 080A6F4E: 4311 orr r1, r2 ; r1 has now the MSB set if at least one of them was set before 080A6F50: 4A28 ldr r2, =#0x000037D3 080A6F52: 18A0 add r0, r4, r2 ; r0 = Original r0 + #$000037D3 080A6F54: 7800 ldrb r0, [r0] 080A6F56: 07C0 lsl r0, r0, #0x1F ; Remove everything but the LSB 080A6F58: 4308 orr r0, r1 ; r0 has now the MSB set if at least one of them was set before 080A6F5A: 2800 cmp r0, #0x00 080A6F5C: D162 bne 0x080A7024 ; Exit if one of the three LSBs was set 080A6F5E: 4826 ldr r0, =#0x02032700 080A6F60: 4A26 ldr r2, =#0x00009448 080A6F62: 1881 add r1, r0, r2 080A6F64: 7809 ldrb r1, [r1] ; r1 = [$0203BB48] 080A6F66: 1C02 add r2, r0, #0x0 080A6F68: 2905 cmp r1, #0x05 080A6F6A: D15B bne 0x080A7024 ; Exit if $0203BB48 <> #$05 080A6F6C: 8818 ldrh r0, [r3] ; r0 = [Original r1] 080A6F6E: 2808 cmp r0, #0x08 080A6F70: D158 bne 0x080A7024 ; Exit if r0 <> #$08 080A6F72: 4923 ldr r1, =#0x000037C4 080A6F74: 1860 add r0, r4, r1 ; r0 = Original r0 + #$000037C4 080A6F76: 7801 ldrb r1, [r0] 080A6F78: 1C28 add r0, r5, #0x0 ; Increment address in r0 080A6F7A: 4008 and r0, r1 ; ??? 080A6F7C: 2800 cmp r0, #0x00 080A6F7E: D008 beq 0x080A6F92 ; ??? 080A6F80: 4920 ldr r1, =#0x000037BC 080A6F82: 1860 add r0, r4, r1 ; r0 = Original r0 + #$000037BC 080A6F84: 8800 ldrh r0, [r0] 080A6F86: 2800 cmp r0, #0x00 080A6F88: DB03 blt 0x080A6F92 ; ??? 080A6F8A: 2805 cmp r0, #0x05 080A6F8C: DD4A ble 0x080A7024 ; Exit 080A6F8E: 280B cmp r0, #0x0B 080A6F90: D048 beq 0x080A7024 ; Exit 080A6F92: 491D ldr r1, =#0x0000944E 080A6F94: 1850 add r0, r2, r1 080A6F96: 7800 ldrb r0, [r0] ; r0 = [$0203BB4E] 080A6F98: 0700 lsl r0, r0, #0x1C ; Remove everything but the lowest nybble 080A6F9A: 2800 cmp r0, #0x00 080A6F9C: DA3A bge 0x080A7014 ; Branch if the original bit 3 was clear 080A6F9E: 2019 mov r0, #0x19 080A6FA0: F7B4 bl 080A6FA2: FAE0 bl 0x0805B564 ; Jump SR 080A6FA4: 4A16 ldr r2, =#0x000037C4 080A6FA6: 18A0 add r0, r4, r2 ; r0 = Original r0 + #$000037C4 080A6FA8: 7801 ldrb r1, [r0] 080A6FAA: 2001 mov r0, #0x01 080A6FAC: 4008 and r0, r1 080A6FAE: 2800 cmp r0, #0x00 080A6FB0: D009 beq 0x080A6FC6 ; ? 080A6FB2: 4914 ldr r1, =#0x000037BC 080A6FB4: 1860 add r0, r4, r1 ; r0 = Original r0 + #$000037BC 080A6FB6: 8800 ldrh r0, [r0] 080A6FB8: 2808 cmp r0, #0x08 080A6FBA: D104 bne 0x080A6FC6 ; ? 080A6FBC: 1C20 add r0, r4, #0x0 080A6FBE: 2100 mov r1, #0x00 080A6FC0: 2201 mov r2, #0x01 080A6FC2: F7F7 bl 080A6FC4: FF65 bl 0x0809EE90 ; ? 080A6FC6: 4A11 ldr r2, =#0x000037CC 080A6FC8: 18A1 add r1, r4, r2 ; r1 = Original r0 + #$000037CC 080A6FCA: 2060 mov r0, #0x60 080A6FCC: 8008 strh r0, [r1] ; ? 080A6FCE: 4910 ldr r1, =#0x00003AD0 080A6FD0: 1860 add r0, r4, r1 ; r0 = Original r0 + #$00003AD0 080A6FD2: 7800 ldrb r0, [r0] 080A6FD4: 0041 lsl r1, r0, #0x1 ; * 2 080A6FD6: 1809 add r1, r1, r0 ; 1 + 2 = 3 080A6FD8: 0109 lsl r1, r1, #0x4 ; *#16 (#$10) = #48 (#$30) 080A6FDA: 1861 add r1, r4, r1 ; Original r0 + #$00000030 080A6FDC: 1C20 add r0, r4, #0x0 080A6FDE: 2213 mov r2, #0x13 080A6FE0: F001 bl 080A6FE2: FF64 bl 0x080A8EAC ; ? 080A6FE4: E01C b 0x080A7020 ; ? ;080A6FE6: 0000 lsl r0, r0, #0x0 ;080A6FE8: 3AD6 sub r2, #0xD6 ;080A6FEA: 0000 lsl r0, r0, #0x0 ;080A6FEC: 3826 sub r0, #0x26 ;080A6FEE: 0000 lsl r0, r0, #0x0 ;080A6FF0: 37DD add r7, #0xDD ;080A6FF2: 0000 lsl r0, r0, #0x0 ;080A6FF4: 37D3 add r7, #0xD3 ;080A6FF6: 0000 lsl r0, r0, #0x0 ;080A6FF8: 2700 mov r7, #0x00 ;080A6FFA: 0203 lsl r3, r0, #0x8 ;080A6FFC: 9448 str r4, [sp, #0x120] ;080A6FFE: 0000 lsl r0, r0, #0x0 ;080A7000: 37C4 add r7, #0xC4 ;080A7002: 0000 lsl r0, r0, #0x0 ;080A7004: 37BC add r7, #0xBC ;080A7006: 0000 lsl r0, r0, #0x0 ;080A7008: 944E str r4, [sp, #0x138] ;080A700A: 0000 lsl r0, r0, #0x0 ;080A700C: 37CC add r7, #0xCC ;080A700E: 0000 lsl r0, r0, #0x0 ;080A7010: 3AD0 sub r2, #0xD0 ;080A7012: 0000 lsl r0, r0, #0x0 080A7014: 2019 mov r0, #0x19 ; ? 080A7016: F7B4 bl 080A7018: FAA5 bl 0x0805B564 ; Jump SR 080A701A: 2000 mov r0, #0x00 080A701C: F7FF bl 080A701E: FEC6 bl 0x080A6DAC ; ? 080A7020: 2001 mov r0, #0x01 080A7022: E000 b 0x080A7026 ; ? 080A7024: 2000 mov r0, #0x00 080A7026: BC30 pop {r4, r5} 080A7028: BC02 pop {r1} 080A702A: 4708 bx r1
$080A7920 - ?
This is called from $0809CC20. When it is, r0 = #$02032714. All my comments are under the assumption that r0 has this value.
080A7920: 4906 ldr r1, =#0x00003AD0 080A7922: 1842 add r2, r0, r1 ; r2 = #$020361E4 080A7924: 2100 mov r1, #0x00 080A7926: 7011 strb r1, [r2] ; $020361E4 = #$00 080A7928: 8081 strh r1, [r0, #0x04] ; $02032718/9 = #$0000 080A792A: 4905 ldr r1, =#0x02032700 080A792C: 4805 ldr r0, =#0x0000944F 080A792E: 1809 add r1, r1, r0 ; r1 = #$0203BB4F 080A7930: 7808 ldrb r0, [r1] 080A7932: 2202 mov r2, #0x02 080A7934: 4310 orr r0, r2 ; Set Bit 1 of $0203BB4F 080A7936: 7008 strb r0, [r1] ; Store back 080A7938: 4770 bx lr ;080A793A: 0000 lsl r0, r0, #0x0 ;080A793C: 3AD0 sub r2, #0xD0 ;080A793E: 0000 lsl r0, r0, #0x0 ;080A7940: 2700 mov r7, #0x00 ;080A7942: 0203 lsl r3, r0, #0x8 ;080A7944: 944F str r4, [sp, #0x13C] ;080A7946: 0000 lsl r0, r0, #0x0
$080A7AD8 - (Puts #$08 in $020361E4 and sets Bit 4 in $0203BB50)
This is called from $0809CA14. There is r0 = #$02032714. My comments are under the assumption that it is not called from somewhere else.
080A7AD8: 4905 ldr r1, =#0x00003AD0 080A7ADA: 1840 add r0, r0, r1 080A7ADC: 2108 mov r1, #0x08 080A7ADE: 7001 strb r1, [r0] ; $020361E4 = #$08 080A7AE0: 4904 ldr r1, =#0x02032700 080A7AE2: 4805 ldr r0, =#0x00009450 080A7AE4: 1809 add r1, r1, r0 ; r1 = #$0203BB50 080A7AE6: 7808 ldrb r0, [r1] 080A7AE8: 2210 mov r2, #0x10 080A7AEA: 4310 orr r0, r2 ; Add flag (store back) 080A7AEC: 7008 strb r0, [r1] 080A7AEE: 4770 bx lr ;080A7AF0: 3AD0 sub r2, #0xD0 ;080A7AF2: 0000 lsl r0, r0, #0x0 ;080A7AF4: 2700 mov r7, #0x00 ;080A7AF6: 0203 lsl r3, r0, #0x8 ;080A7AF8: 9450 str r4, [sp, #0x140] ;080A7AFA: 0000 lsl r0, r0, #0x0
$080A7AFC - ?
080A7AFC: B570 push {r4, r5, r6, lr} 080A7AFE: 1C05 add r5, r0, #0x0 080A7B00: 20D8 mov r0, #0xD8 080A7B02: 0040 lsl r0, r0, #0x1 080A7B04: 182A add r2, r5, r0 ; r2 = Original r0 + #$000001B0 080A7B06: 4C2C ldr r4, =#0x00003AD0 080A7B08: 1929 add r1, r5, r4 ; r2 = Original r0 + #$00003AD0 080A7B0A: 2300 mov r3, #0x00 080A7B0C: 2009 mov r0, #0x09 080A7B0E: 7008 strb r0, [r1] ; Store #$09 in [Original r0 + #$00003AD0] 080A7B10: 2400 mov r4, #0x00 080A7B12: 8093 strh r3, [r2, #0x04] ; Clear [Original r0 + #$00003AD4] 080A7B14: 8153 strh r3, [r2, #0x0A] ; Clear [Original r0 + #$00003ADA] 080A7B16: 4829 ldr r0, =#0x020326F0 080A7B18: 8800 ldrh r0, [r0] 080A7B1A: 4A29 ldr r2, =#0x000038EB 080A7B1C: 18A9 add r1, r5, r2 080A7B1E: 7008 strb r0, [r1] ; Store [$020326F0] in [Original r0 + #$000038EB] 080A7B20: 3201 add r2, #0x01 080A7B22: 18A8 add r0, r5, r2 080A7B24: 7004 strb r4, [r0] ; Clear [Original r0 + #$00000001] 080A7B26: 7808 ldrb r0, [r1] 080A7B28: 00C0 lsl r0, r0, #0x3 080A7B2A: 4926 ldr r1, =#0x080C225C 080A7B2C: 1840 add r0, r0, r1 080A7B2E: 8802 ldrh r2, [r0] 080A7B30: 4C25 ldr r4, =#0x00003894 080A7B32: 1929 add r1, r5, r4 080A7B34: 800A strh r2, [r1] 080A7B36: 8842 ldrh r2, [r0, #0x02] 080A7B38: 3402 add r4, #0x02 080A7B3A: 1929 add r1, r5, r4 080A7B3C: 800A strh r2, [r1] 080A7B3E: 8880 ldrh r0, [r0, #0x04] 080A7B40: 0140 lsl r0, r0, #0x5 080A7B42: 4922 ldr r1, =#0x080C209C 080A7B44: 1844 add r4, r0, r1 080A7B46: 4922 ldr r1, =#0x00003898 080A7B48: 1868 add r0, r5, r1 080A7B4A: 8003 strh r3, [r0] 080A7B4C: 2200 mov r2, #0x00 080A7B4E: 4E21 ldr r6, =#0x0000389C 080A7B50: 1C03 add r3, r0, #0x0 080A7B52: 0090 lsl r0, r2, #0x2 080A7B54: 1828 add r0, r5, r0 080A7B56: 0051 lsl r1, r2, #0x1 080A7B58: 1861 add r1, r4, r1 080A7B5A: 8809 ldrh r1, [r1] 080A7B5C: 1980 add r0, r0, r6 080A7B5E: 7001 strb r1, [r0] 080A7B60: 0609 lsl r1, r1, #0x18 080A7B62: 2900 cmp r1, #0x00 080A7B64: D007 beq 0x080A7B76 080A7B66: 8818 ldrh r0, [r3] 080A7B68: 3001 add r0, #0x01 080A7B6A: 8018 strh r0, [r3] 080A7B6C: 1C50 add r0, r2, #0x1 080A7B6E: 0400 lsl r0, r0, #0x10 080A7B70: 0C02 lsr r2, r0, #0x10 080A7B72: 2A0F cmp r2, #0x0F 080A7B74: D9ED bls 0x080A7B52 080A7B76: 1C28 add r0, r5, #0x0 080A7B78: 2101 mov r1, #0x01 080A7B7A: F010 bl 080A7B7C: FDB1 bl 0x080B86E0 080A7B7E: 1C28 add r0, r5, #0x0 080A7B80: F012 bl 080A7B82: FDD2 bl 0x080BA728 080A7B84: 4B14 ldr r3, =#0x02032700 080A7B86: 4C15 ldr r4, =#0x00009450 080A7B88: 191A add r2, r3, r4 080A7B8A: 7810 ldrb r0, [r2] ; r0 = [$0203BB50] 080A7B8C: 2108 mov r1, #0x08 080A7B8E: 4308 orr r0, r1 080A7B90: 7010 strb r0, [r2] 080A7B92: 4813 ldr r0, =#0x00009451 080A7B94: 181A add r2, r3, r0 080A7B96: 7810 ldrb r0, [r2] ; r0 = [$0203BB51] 080A7B98: 2104 mov r1, #0x04 080A7B9A: 4308 orr r0, r1 080A7B9C: 7010 strb r0, [r2] 080A7B9E: 490A ldr r1, =#0x00003894 080A7BA0: 1868 add r0, r5, r1 080A7BA2: 8800 ldrh r0, [r0] 080A7BA4: 1C01 add r1, r0, #0x0 080A7BA6: 2898 cmp r0, #0x98 080A7BA8: D900 bls 0x080A7BAC 080A7BAA: 3950 sub r1, #0x50 080A7BAC: 4A0D ldr r2, =#0x0000944A 080A7BAE: 1898 add r0, r3, r2 080A7BB0: 7001 strb r1, [r0] 080A7BB2: BC70 pop {r4, r5, r6} 080A7BB4: BC01 pop {r0} 080A7BB6: 4700 bx r0 ;080A7BB8: 3AD0 sub r2, #0xD0 ;080A7BBA: 0000 lsl r0, r0, #0x0 ;080A7BBC: 26F0 mov r6, #0xF0 ;080A7BBE: 0203 lsl r3, r0, #0x8 ;080A7BC0: 38EB sub r0, #0xEB ;080A7BC2: 0000 lsl r0, r0, #0x0 ;080A7BC4: 225C mov r2, #0x5C ;080A7BC6: 080C lsr r4, r1, #0x0 ;080A7BC8: 3894 sub r0, #0x94 ;080A7BCA: 0000 lsl r0, r0, #0x0 ;080A7BCC: 209C mov r0, #0x9C ;080A7BCE: 080C lsr r4, r1, #0x0 ;080A7BD0: 3898 sub r0, #0x98 ;080A7BD2: 0000 lsl r0, r0, #0x0 ;080A7BD4: 389C sub r0, #0x9C ;080A7BD6: 0000 lsl r0, r0, #0x0 ;080A7BD8: 2700 mov r7, #0x00 ;080A7BDA: 0203 lsl r3, r0, #0x8 ;080A7BDC: 9450 str r4, [sp, #0x140] ;080A7BDE: 0000 lsl r0, r0, #0x0 ;080A7BE0: 9451 str r4, [sp, #0x144] ;080A7BE2: 0000 lsl r0, r0, #0x0 ;080A7BE4: 944A str r4, [sp, #0x128] ;080A7BE6: 0000 lsl r0, r0, #0x0
$080A7BE8 - ?
This is called from $0809CB84. If it is, the address in r0 is $02032714.
080A7BE8: B530 push {r4, r5, lr} 080A7BEA: 1C04 add r4, r0, #0x0 ; r4 = Orig. r0 (#$02032714) 080A7BEC: 20F0 mov r0, #0xF0 080A7BEE: 0040 lsl r0, r0, #0x1 ; r0 = #$01E0 080A7BF0: 1822 add r2, r4, r0 ; r2 = Orig. r0 + #$01E0 (#$020328F4) 080A7BF2: 4816 ldr r0, =#0x00003AD0 080A7BF4: 1821 add r1, r4, r0 ; r1 = Orig. r0 + #$3AD0 (#$020361E4) 080A7BF6: 2300 mov r3, #0x00 080A7BF8: 200A mov r0, #0x0A 080A7BFA: 7008 strb r0, [r1] ; [r1] ($020361E4) = #$0A 080A7BFC: 8093 strh r3, [r2, #0x04] ; (Clear $020328F8) 080A7BFE: 4D14 ldr r5, =#0x02032700 080A7C00: 6928 ldr r0, [r5, #0x10] ; r0 = [$02032710] 080A7C02: 4914 ldr r1, =#0x00000E92 080A7C04: 1840 add r0, r0, r1 080A7C06: 7800 ldrb r0, [r0] ; r0 = [ [$02032710] + #$0E92 ] 080A7C08: 2101 mov r1, #0x01 080A7C0A: 4048 eor r0, r1 ; ? 080A7C0C: 4008 and r0, r1 ; ? 080A7C0E: 8150 strh r0, [r2, #0x0A] ; (Store r0 in $020328FE) 080A7C10: 2001 mov r0, #0x01 080A7C12: 8210 strh r0, [r2, #0x10] ; (Store #01 in $02032904) 080A7C14: 8293 strh r3, [r2, #0x14] ; (Clear $02032908) 080A7C16: 82D3 strh r3, [r2, #0x16] ; (Clear $0203290A) 080A7C18: 480F ldr r0, =#0x000038F0 080A7C1A: 1822 add r2, r4, r0 ; r2 = Orig. r0 + #$38F0 (#$02036004) 080A7C1C: 7811 ldrb r1, [r2] ; r1 = [r2] ($02036004) 080A7C1E: 2004 mov r0, #0x04 080A7C20: 4240 neg r0, r0 ; r0 = #$FFFFFFFC 080A7C22: 4008 and r0, r1 ; Remove Bits 0 and 1 from loaded byte 080A7C24: 217D mov r1, #0x7D 080A7C26: 4249 neg r1, r1 080A7C28: 4008 and r0, r1 ; Remove Bits 3 to 6 from loaded byte 080A7C2A: 7010 strb r0, [r2] ; Store byte back 080A7C2C: 1C20 add r0, r4, #0x0 ; r0 = Orig. r0 (#$02032714) 080A7C2E: 2100 mov r1, #0x00 ; r1 = #$00 080A7C30: F001 bl 080A7C32: FB72 bl 0x080A9318 ; ? 080A7C34: 1C20 add r0, r4, #0x0 ; r0 = Orig. r0 (#$02032714) 080A7C36: F001 bl 080A7C38: FBC1 bl 0x080A93BC ; ? 080A7C3A: 4908 ldr r1, =#0x00003D2C ; r1 = #$00003D2C 080A7C3C: 186D add r5, r5, r1 ; r5 = #$0203642C 080A7C3E: 1C28 add r0, r5, #0x0 ; r0 = #$0203642C 080A7C40: F7F6 bl 080A7C42: FF94 bl 0x0809EB6C ; ? 080A7C44: BC30 pop {r4, r5} 080A7C46: BC01 pop {r0} 080A7C48: 4700 bx r0 ;080A7C4A: 0000 lsl r0, r0, #0x0 ;080A7C4C: 3AD0 sub r2, #0xD0 ;080A7C4E: 0000 lsl r0, r0, #0x0 ;080A7C50: 2700 mov r7, #0x00 ;080A7C52: 0203 lsl r3, r0, #0x8 ;080A7C54: 0E92 lsr r2, r2, #0x1A ;080A7C56: 0000 lsl r0, r0, #0x0 ;080A7C58: 38F0 sub r0, #0xF0 ;080A7C5A: 0000 lsl r0, r0, #0x0 ;080A7C5C: 3D2C sub r5, #0x2C ;080A7C5E: 0000 lsl r0, r0, #0x0
$080A7C76 - ?
080A7C60: B530 push {r4, r5, lr} 080A7C62: 1C05 add r5, r0, #0x0 ; r5 = r0 080A7C64: 4C16 ldr r4, =#0x02032700 080A7C66: 4917 ldr r1, =#0x0000943E 080A7C68: 1860 add r0, r4, r1 080A7C6A: 8800 ldrh r0, [r0] ; r0 = $0203BB3E 080A7C6C: 2801 cmp r0, #0x01 080A7C6E: D914 bls 0x080A7C9A ; Leave out a whole lot if $0203BB3E < 2 080A7C70: 2000 mov r0, #0x00 080A7C72: F015 bl 080A7C74: FB55 bl 0x080BD320 ; As r0 = #$00, the address from $0203B6D0 gets loaded in r0 080A7C76: 4A14 ldr r2, =#0x0000944F 080A7C78: 18A3 add r3, r4, r2 080A7C7A: 7819 ldrb r1, [r3] ; r1 = $0203BB4F 080A7C7C: 2220 mov r2, #0x20 080A7C7E: 4311 orr r1, r2 ; Set Bit 5 in the value of $0203BB4F and store back 080A7C80: 7019 strb r1, [r3] 080A7C82: 8800 ldrh r0, [r0] ; Load from the address that was in $0203B6D0 080A7C84: 04C0 lsl r0, r0, #0x13 ; Cut off the three MSBs 080A7C86: 0E80 lsr r0, r0, #0x1A ; Only Bits 4 to twelve remain in r0, at Bit Position 0 to 8 080A7C88: 4A10 ldr r2, =#0x0000944A 080A7C8A: 18A1 add r1, r4, r2 080A7C8C: 7008 strb r0, [r1] ; Store in $0203BB4A 080A7C8E: 4810 ldr r0, =#0x00009450 080A7C90: 1822 add r2, r4, r0 080A7C92: 7810 ldrb r0, [r2] ; Set Bit 4 in $0203BB50 080A7C94: 2108 mov r1, #0x08 080A7C96: 4308 orr r0, r1 080A7C98: 7010 strb r0, [r2] 080A7C9A: 2184 mov r1, #0x84 080A7C9C: 0089 lsl r1, r1, #0x2 ; r1 = #$00000210 080A7C9E: 186C add r4, r5, r1 ; r4 = Original r0 + #$00000210 080A7CA0: 1C28 add r0, r5, #0x0 ; r0 = Original r0 080A7CA2: F011 bl 080A7CA4: FC87 bl 0x080B95B4 ; ? 080A7CA6: 4A0B ldr r2, =#0x00003AD0 080A7CA8: 18A9 add r1, r5, r2 ; r1 = Original r0 + #$00003AD0 080A7CAA: 2200 mov r2, #0x00 080A7CAC: 200B mov r0, #0x0B 080A7CAE: 7008 strb r0, [r1] ; ? 080A7CB0: 4909 ldr r1, =#0x00003ACA 080A7CB2: 1868 add r0, r5, r1 080A7CB4: 8800 ldrh r0, [r0] ; ? 080A7CB6: 8060 strh r0, [r4, #0x02] ; ? 080A7CB8: 80A2 strh r2, [r4, #0x04] ; ? 080A7CBA: BC30 pop {r4, r5} 080A7CBC: BC01 pop {r0} 080A7CBE: 4700 bx r0 ;080A7CC0: 2700 mov r7, #0x00 ;080A7CC2: 0203 lsl r3, r0, #0x8 ;080A7CC4: 943E str r4, [sp, #0x0F8] ;080A7CC6: 0000 lsl r0, r0, #0x0 ;080A7CC8: 944F str r4, [sp, #0x13C] ;080A7CCA: 0000 lsl r0, r0, #0x0 ;080A7CCC: 944A str r4, [sp, #0x128] ;080A7CCE: 0000 lsl r0, r0, #0x0 ;080A7CD0: 9450 str r4, [sp, #0x140] ;080A7CD2: 0000 lsl r0, r0, #0x0 ;080A7CD4: 3AD0 sub r2, #0xD0 ;080A7CD6: 0000 lsl r0, r0, #0x0 ;080A7CD8: 3ACA sub r2, #0xCA ;080A7CDA: 0000 lsl r0, r0, #0x0
$080A7CDC - ?
080A7CDC: B510 push {r4, lr} 080A7CDE: 219C mov r1, #0x9C 080A7CE0: 0089 lsl r1, r1, #0x2 ; r1 = #$00000270 080A7CE2: 1844 add r4, r0, r1 ; r4 = r0 + #$00000270 080A7CE4: 4911 ldr r1, =#0x00003AD0 080A7CE6: 1842 add r2, r0, r1 ; r2 = r0 + #$00003AD0 080A7CE8: 2300 mov r3, #0x00 080A7CEA: 210C mov r1, #0x0C 080A7CEC: 7011 strb r1, [r2] ; Store #$0C in r2 080A7CEE: 80A3 strh r3, [r4, #0x04] ; Store #$0000 in [r4 + #$0004] 080A7CF0: 4B0F ldr r3, =#0x02032700 080A7CF2: 4910 ldr r1, =#0x00009450 080A7CF4: 185C add r4, r3, r1 ; r4 = #$0203BB50 080A7CF6: 7821 ldrb r1, [r4] 080A7CF8: 2208 mov r2, #0x08 ; Set Bit 3 in $0203BB50 and store value back 080A7CFA: 4311 orr r1, r2 080A7CFC: 7021 strb r1, [r4] 080A7CFE: 691A ldr r2, [r3, #0x10] ; r2 = [$0203BB60] 080A7D00: 326C add r2, #0x6C 080A7D02: 8811 ldrh r1, [r2] ; r1 = [ [$0203BB60] + #$006C] 080A7D04: 0509 lsl r1, r1, #0x14 080A7D06: 0E89 lsr r1, r1, #0x1A ; Bits 6 to 11 are now bits 0 to 5 080A7D08: 4C0B ldr r4, =#0x0000944A 080A7D0A: 191B add r3, r3, r4 080A7D0C: 7019 strb r1, [r3] ; Store value in $0203BB4A 080A7D0E: 7812 ldrb r2, [r2] ; r2 = [ [$0203BB60] + #$006C] 080A7D10: 0692 lsl r2, r2, #0x1A 080A7D12: 490A ldr r1, =#0x00002F56 080A7D14: 1840 add r0, r0, r1 ; r0 = r0 + #$00002F56 080A7D16: 0F12 lsr r2, r2, #0x1C ; r2 = Bits 2 to 5 are now bits 0 to 3 080A7D18: 7803 ldrb r3, [r0] 080A7D1A: 2110 mov r1, #0x10 080A7D1C: 4249 neg r1, r1 ; r1 = #$FFFFFFEF 080A7D1E: 4019 and r1, r3 ; Remove bit 4 from loaded value 080A7D20: 4311 orr r1, r2 ; Set (maybe) bits 3 to 0 080A7D22: 7001 strb r1, [r0] ; Store value back 080A7D24: BC10 pop {r4} 080A7D26: BC01 pop {r0} 080A7D28: 4700 bx r0 ;080A7D2A: 0000 lsl r0, r0, #0x0 ;080A7D2C: 3AD0 sub r2, #0xD0 ;080A7D2E: 0000 lsl r0, r0, #0x0 ;080A7D30: 2700 mov r7, #0x00 ;080A7D32: 0203 lsl r3, r0, #0x8 ;080A7D34: 9450 str r4, [sp, #0x140] ;080A7D36: 0000 lsl r0, r0, #0x0 ;080A7D38: 944A str r4, [sp, #0x128] ;080A7D3A: 0000 lsl r0, r0, #0x0 ;080A7D3C: 2F56 cmp r7, #0x56 ;080A7D3E: 0000 lsl r0, r0, #0x0
$080A7D40 - ?
080A7D40: B510 push {r4, lr} 080A7D42: 219C mov r1, #0x9C 080A7D44: 0089 lsl r1, r1, #0x2 080A7D46: 1843 add r3, r0, r1 ; r3 = Orig. r0 + #$0270 080A7D48: 4906 ldr r1, =#0x00003AD0 080A7D4A: 1844 add r4, r0, r1 ; r4 = Orig. r0 + #$3AD0 080A7D4C: 2200 mov r2, #0x00 080A7D4E: 210D mov r1, #0x0D 080A7D50: 7021 strb r1, [r4] ; Orig. r0 + #$3AD0 = #$0D 080A7D52: 809A strh r2, [r3, #0x04] ; Orig. r0 + #$0274/5 = #$0000 080A7D54: 815A strh r2, [r3, #0x0A] ; Orig. r0 + #$027A/B = #$0000 080A7D56: 825A strh r2, [r3, #0x12] ; Orig. r0 + #$0282/3 = #$0000 080A7D58: F011 bl 080A7D5A: F8F6 bl 0x080B8F48 ; ? 080A7D5C: BC10 pop {r4} 080A7D5E: BC01 pop {r0} 080A7D60: 4700 bx r0 ;080A7D62: 0000 lsl r0, r0, #0x0 ;080A7D64: 3AD0 sub r2, #0xD0 ;080A7D66: 0000 lsl r0, r0, #0x0
$080A8EAC - ?
Note: From $080C3658 on, there seems to be data sets in 14 ($0D) bit size. The offset for this comes into this subroutine in Register r2.
080A8EAC: B5F0 push {r4, r5, r6, r7, lr} 080A8EAE: 1C03 add r3, r0, #0x0 ; r3 = r0 080A8EB0: 1C0E add r6, r1, #0x0 ; r6 = r1 080A8EB2: 0412 lsl r2, r2, #0x10 080A8EB4: 0C12 lsr r2, r2, #0x10 ; r2 AND #$0000FFFF 080A8EB6: 00D0 lsl r0, r2, #0x3 080A8EB8: 1A80 sub r0, r0, r2 ; r0 = r2 * 7 080A8EBA: 0080 lsl r0, r0, #0x2 ; r0 = r2 * #$0D (14) 080A8EBC: 4925 ldr r1, =#0x080C3658 080A8EBE: 1844 add r4, r0, r1 ; r4 = #$080C3658 + r0 (=r2 * #$0D (14), see above) 080A8EC0: 4825 ldr r0, =#0x000037C8 080A8EC2: 181F add r7, r3, r0 ; r7 = Original r0 + #$000037C8 080A8EC4: 2100 mov r1, #0x00 080A8EC6: 803A strh r2, [r7] ; Store Original r2 in [Original r0 + #$000037C8] 080A8EC8: 4A24 ldr r2, =#0x000037CE 080A8ECA: 1898 add r0, r3, r2 ; r7 = Original r0 + #$000037CE 080A8ECC: 8001 strh r1, [r0] ; Clear [Original r0 + #$000037CE] 080A8ECE: 4824 ldr r0, =#0x000037D3 080A8ED0: 181D add r5, r3, r0 080A8ED2: 7828 ldrb r0, [r5] ; Load [Original r0 + #$000037D3] 080A8ED4: 2101 mov r1, #0x01 080A8ED6: 468C mov r12, r1 080A8ED8: 4662 mov r2, r12 080A8EDA: 4310 orr r0, r2 080A8EDC: 2103 mov r1, #0x03 080A8EDE: 4249 neg r1, r1 080A8EE0: 4008 and r0, r1 080A8EE2: 3906 sub r1, #0x06 080A8EE4: 4008 and r0, r1 080A8EE6: 3908 sub r1, #0x08 080A8EE8: 4008 and r0, r1 080A8EEA: 3910 sub r1, #0x10 080A8EEC: 4008 and r0, r1 080A8EEE: 7028 strb r0, [r5] ; Store changed value back in [Original r0 + #$000037D3] 080A8EF0: 481C ldr r0, =#0x000037D5 080A8EF2: 181A add r2, r3, r0 080A8EF4: 7811 ldrb r1, [r2] ; Load [Original r0 + #$000037D5] 080A8EF6: 2002 mov r0, #0x02 080A8EF8: 4240 neg r0, r0 080A8EFA: 4008 and r0, r1 ; Remove bit 1 from that byte 080A8EFC: 7010 strb r0, [r2] ; Store Byte back in [Original r0 + #$000037D5] 080A8EFE: 2E00 cmp r6, #0x00 080A8F00: D003 beq 0x080A8F0A ; Leave next part out if Original r1 was = 0 080A8F02: 8831 ldrh r1, [r6] 080A8F04: 4A18 ldr r2, =#0x000037D2 080A8F06: 1898 add r0, r3, r2 080A8F08: 7001 strb r1, [r0] ; Store Original r1 in [Original r0 + #$000037D2] 080A8F0A: 7D21 ldrb r1, [r4, #0x14] 080A8F0C: 4A17 ldr r2, =#0x000037D0 080A8F0E: 1898 add r0, r3, r2 080A8F10: 7001 strb r1, [r0] 080A8F12: 8AE1 ldrh r1, [r4, #0x16] 080A8F14: 3A06 sub r2, #0x06 080A8F16: 1898 add r0, r3, r2 080A8F18: 8001 strh r1, [r0] 080A8F1A: 7E20 ldrb r0, [r4, #0x18] 080A8F1C: 4661 mov r1, r12 080A8F1E: 4001 and r1, r0 080A8F20: 0089 lsl r1, r1, #0x2 080A8F22: 782A ldrb r2, [r5] 080A8F24: 2005 mov r0, #0x05 080A8F26: 4240 neg r0, r0 080A8F28: 4010 and r0, r2 080A8F2A: 4308 orr r0, r1 080A8F2C: 7028 strb r0, [r5] 080A8F2E: 4810 ldr r0, =#0x00003AA0 080A8F30: 1819 add r1, r3, r0 080A8F32: 8820 ldrh r0, [r4] 080A8F34: 8008 strh r0, [r1] 080A8F36: 8860 ldrh r0, [r4, #0x02] 080A8F38: 8048 strh r0, [r1, #0x02] 080A8F3A: 88A0 ldrh r0, [r4, #0x04] 080A8F3C: 8088 strh r0, [r1, #0x04] 080A8F3E: 88E0 ldrh r0, [r4, #0x06] 080A8F40: 80C8 strh r0, [r1, #0x06] 080A8F42: 8838 ldrh r0, [r7] ; Load Jump Table Entry Number 080A8F44: 2813 cmp r0, #0x13 080A8F46: D900 bls 0x080A8F4A ; Go on if it is #$13 or less 080A8F48: E114 b 0x080A9174 ; Exit if higher (invalid value) 080A8F4A: 0080 lsl r0, r0, #0x2 080A8F4C: 4909 ldr r1, =#0x080A8F78 080A8F4E: 1840 add r0, r0, r1 080A8F50: 6800 ldr r0, [r0] 080A8F52: 4687 mov pc, r0 ; Jump to Entry of the Jump Table at $080A8F78 ;DATA ;================ ;080A8F54: 3658 add r6, #0x58 ;080A8F56: 080C lsr r4, r1, #0x0 ;080A8F58: 37C8 add r7, #0xC8 ;080A8F5A: 0000 lsl r0, r0, #0x0 ;080A8F5C: 37CE add r7, #0xCE ;080A8F5E: 0000 lsl r0, r0, #0x0 ;080A8F60: 37D3 add r7, #0xD3 ;080A8F62: 0000 lsl r0, r0, #0x0 ;080A8F64: 37D5 add r7, #0xD5 ;080A8F66: 0000 lsl r0, r0, #0x0 ;080A8F68: 37D2 add r7, #0xD2 ;080A8F6A: 0000 lsl r0, r0, #0x0 ;080A8F6C: 37D0 add r7, #0xD0 ;080A8F6E: 0000 lsl r0, r0, #0x0 ;080A8F70: 3AA0 sub r2, #0xA0 ;080A8F72: 0000 lsl r0, r0, #0x0 ;080A8F74: 8F78 ldrh r0, [r7, #0x3A] ;080A8F76: 080A lsr r2, r1, #0x0 ;Jump Table ; entry 00-02:080A8FC8 ; entry 03:080A9174 ; entry 04:080A8FC8 ; entry 05-06:080A9174 ; entry 07:080A8FD2 ; entry 08:080A8FF8 ; entry 09:080A9080 ; entry 0A-11:080A9174 ; entry 12:080A90A4 ; entry 13:080A915C ;080A8F78: 8FC8 ldrh r0, [r1, #0x3E] ;080A8F7A: 080A lsr r2, r1, #0x0 ;080A8F7C: 8FC8 ldrh r0, [r1, #0x3E] ;080A8F7E: 080A lsr r2, r1, #0x0 ;080A8F80: 8FC8 ldrh r0, [r1, #0x3E] ;080A8F82: 080A lsr r2, r1, #0x0 ;080A8F84: 9174 str r1, [sp, #0x1D0] ;080A8F86: 080A lsr r2, r1, #0x0 ;080A8F88: 8FC8 ldrh r0, [r1, #0x3E] ;080A8F8A: 080A lsr r2, r1, #0x0 ;080A8F8C: 9174 str r1, [sp, #0x1D0] ;080A8F8E: 080A lsr r2, r1, #0x0 ;080A8F90: 9174 str r1, [sp, #0x1D0] ;080A8F92: 080A lsr r2, r1, #0x0 ;080A8F94: 8FD2 ldrh r2, [r2, #0x3E] ;080A8F96: 080A lsr r2, r1, #0x0 ;080A8F98: 8FF8 ldrh r0, [r7, #0x3E] ;080A8F9A: 080A lsr r2, r1, #0x0 ;080A8F9C: 9080 str r0, [sp, #0x200] ;080A8F9E: 080A lsr r2, r1, #0x0 ;080A8FA0: 9174 str r1, [sp, #0x1D0] ;080A8FA2: 080A lsr r2, r1, #0x0 ;080A8FA4: 9174 str r1, [sp, #0x1D0] ;080A8FA6: 080A lsr r2, r1, #0x0 ;080A8FA8: 9174 str r1, [sp, #0x1D0] ;080A8FAA: 080A lsr r2, r1, #0x0 ;080A8FAC: 9174 str r1, [sp, #0x1D0] ;080A8FAE: 080A lsr r2, r1, #0x0 ;080A8FB0: 9174 str r1, [sp, #0x1D0] ;080A8FB2: 080A lsr r2, r1, #0x0 ;080A8FB4: 9174 str r1, [sp, #0x1D0] ;080A8FB6: 080A lsr r2, r1, #0x0 ;080A8FB8: 9174 str r1, [sp, #0x1D0] ;080A8FBA: 080A lsr r2, r1, #0x0 ;080A8FBC: 9174 str r1, [sp, #0x1D0] ;080A8FBE: 080A lsr r2, r1, #0x0 ;080A8FC0: 90A4 str r0, [sp, #0x290] ;080A8FC2: 080A lsr r2, r1, #0x0 ;080A8FC4: 915C str r1, [sp, #0x170] ;080A8FC6: 080A lsr r2, r1, #0x0 ; entry 00-02,04:080A8FC8 080A8FC8: 8971 ldrh r1, [r6, #0x0A] 080A8FCA: 0049 lsl r1, r1, #0x1 080A8FCC: 1C30 add r0, r6, #0x0 080A8FCE: 3010 add r0, #0x10 080A8FD0: E05C b 0x080A908C ; entry 07:080A8FD2 080A8FD2: 88B1 ldrh r1, [r6, #0x04] 080A8FD4: 4A05 ldr r2, =#0x000037D1 080A8FD6: 1898 add r0, r3, r2 080A8FD8: 7001 strb r1, [r0] 080A8FDA: 4805 ldr r0, =#0x02032700 080A8FDC: 4905 ldr r1, =#0x00009448 080A8FDE: 1840 add r0, r0, r1 080A8FE0: 7800 ldrb r0, [r0] 080A8FE2: 2800 cmp r0, #0x00 080A8FE4: D000 beq 0x080A8FE8 080A8FE6: E0C5 b 0x080A9174 080A8FE8: E0BF b 0x080A916A ;080A8FEA: 0000 lsl r0, r0, #0x0 ;080A8FEC: 37D1 add r7, #0xD1 ;080A8FEE: 0000 lsl r0, r0, #0x0 ;080A8FF0: 2700 mov r7, #0x00 ;080A8FF2: 0203 lsl r3, r0, #0x8 ;080A8FF4: 9448 str r4, [sp, #0x120] ;080A8FF6: 0000 lsl r0, r0, #0x0 ; entry 08:080A8FF8 080A8FF8: 4915 ldr r1, =#0x000038EC 080A8FFA: 1858 add r0, r3, r1 080A8FFC: 7801 ldrb r1, [r0] 080A8FFE: 0049 lsl r1, r1, #0x1 080A9000: 4A14 ldr r2, =#0x000038DC 080A9002: 1898 add r0, r3, r2 080A9004: 1840 add r0, r0, r1 080A9006: 8801 ldrh r1, [r0] 080A9008: 4A13 ldr r2, =#0x000037D1 080A900A: 1898 add r0, r3, r2 080A900C: 7001 strb r1, [r0] 080A900E: 7800 ldrb r0, [r0] 080A9010: 0080 lsl r0, r0, #0x2 080A9012: 1818 add r0, r3, r0 080A9014: 4911 ldr r1, =#0x0000389C 080A9016: 1840 add r0, r0, r1 080A9018: 7800 ldrb r0, [r0] 080A901A: 4911 ldr r1, =#0x080FF4A8 080A901C: 00C0 lsl r0, r0, #0x3 080A901E: 1840 add r0, r0, r1 080A9020: 7800 ldrb r0, [r0] 080A9022: 06C0 lsl r0, r0, #0x1B 080A9024: 0EC0 lsr r0, r0, #0x1B 080A9026: 280A cmp r0, #0x0A 080A9028: DC20 bgt 0x080A906C 080A902A: 2806 cmp r0, #0x06 080A902C: DB1E blt 0x080A906C 080A902E: 480D ldr r0, =#0x000037D3 080A9030: 181A add r2, r3, r0 080A9032: 7810 ldrb r0, [r2] 080A9034: 2108 mov r1, #0x08 080A9036: 4308 orr r0, r1 080A9038: 7010 strb r0, [r2] 080A903A: 4A0B ldr r2, =#0x00003AA0 080A903C: 1899 add r1, r3, r2 080A903E: 2018 mov r0, #0x18 080A9040: 8008 strh r0, [r1] 080A9042: 2038 mov r0, #0x38 080A9044: 8048 strh r0, [r1, #0x02] 080A9046: 20C0 mov r0, #0xC0 080A9048: 8088 strh r0, [r1, #0x04] 080A904A: 2060 mov r0, #0x60 080A904C: 80C8 strh r0, [r1, #0x06] 080A904E: E091 b 0x080A9174 ;080A9050: 38EC sub r0, #0xEC ;080A9052: 0000 lsl r0, r0, #0x0 ;080A9054: 38DC sub r0, #0xDC ;080A9056: 0000 lsl r0, r0, #0x0 ;080A9058: 37D1 add r7, #0xD1 ;080A905A: 0000 lsl r0, r0, #0x0 ;080A905C: 389C sub r0, #0x9C ;080A905E: 0000 lsl r0, r0, #0x0 ;080A9060: F4A8 bl ;080A9062: 080F lsr r7, r1, #0x0 ;080A9064: 37D3 add r7, #0xD3 ;080A9066: 0000 lsl r0, r0, #0x0 ;080A9068: 3AA0 sub r2, #0xA0 ;080A906A: 0000 lsl r0, r0, #0x0 080A906C: 4803 ldr r0, =#0x000037D3 080A906E: 181A add r2, r3, r0 080A9070: 7811 ldrb r1, [r2] 080A9072: 2009 mov r0, #0x09 080A9074: 4240 neg r0, r0 080A9076: 4008 and r0, r1 080A9078: 7010 strb r0, [r2] 080A907A: E07B b 0x080A9174 080A907C: 37D3 add r7, #0xD3 080A907E: 0000 lsl r0, r0, #0x0 ; entry 09:080A9080 080A9080: 4905 ldr r1, =#0x000038EC 080A9082: 1858 add r0, r3, r1 080A9084: 7801 ldrb r1, [r0] 080A9086: 0049 lsl r1, r1, #0x1 080A9088: 4A04 ldr r2, =#0x000038DC 080A908A: 1898 add r0, r3, r2 080A908C: 1840 add r0, r0, r1 080A908E: 8801 ldrh r1, [r0] 080A9090: 4A03 ldr r2, =#0x000037D1 080A9092: 1898 add r0, r3, r2 080A9094: 7001 strb r1, [r0] 080A9096: E06D b 0x080A9174 080A9098: 38EC sub r0, #0xEC 080A909A: 0000 lsl r0, r0, #0x0 080A909C: 38DC sub r0, #0xDC 080A909E: 0000 lsl r0, r0, #0x0 080A90A0: 37D1 add r7, #0xD1 080A90A2: 0000 lsl r0, r0, #0x0 080A90A4: 4905 ldr r1, =#0x000037CC 080A90A6: 1858 add r0, r3, r1 080A90A8: 8800 ldrh r0, [r0] 080A90AA: 3863 sub r0, #0x63 080A90AC: 2818 cmp r0, #0x18 080A90AE: D861 bhi 0x080A9174 080A90B0: 0080 lsl r0, r0, #0x2 080A90B2: 4903 ldr r1, =#0x080A90C4 080A90B4: 1840 add r0, r0, r1 080A90B6: 6800 ldr r0, [r0] 080A90B8: 4687 mov pc, r0 ;080A90BA: 0000 lsl r0, r0, #0x0 ;080A90BC: 37CC add r7, #0xCC ;080A90BE: 0000 lsl r0, r0, #0x0 ;080A90C0: 90C4 str r0, [sp, #0x310] ;080A90C2: 080A lsr r2, r1, #0x0 ; JUMP TABLE ; entry a00:080A9128 ; entry a01-a12:080A9174 exit ; entry a13:080A8FDA ; entry a14:080A916A ; entry a15:080A9174 exit ;080A90C4: 9128 str r1, [sp, #0x0A0] ;080A90C6: 080A lsr r2, r1, #0x0 ;080A90C8: 9174 str r1, [sp, #0x1D0] ;080A90CA: 080A lsr r2, r1, #0x0 ;080A90CC: 9174 str r1, [sp, #0x1D0] ;080A90CE: 080A lsr r2, r1, #0x0 ;080A90D0: 9174 str r1, [sp, #0x1D0] ;080A90D2: 080A lsr r2, r1, #0x0 ;080A90D4: 9174 str r1, [sp, #0x1D0] ;080A90D6: 080A lsr r2, r1, #0x0 ;080A90D8: 9174 str r1, [sp, #0x1D0] ;080A90DA: 080A lsr r2, r1, #0x0 ;080A90DC: 9174 str r1, [sp, #0x1D0] ;080A90DE: 080A lsr r2, r1, #0x0 ;080A90E0: 9174 str r1, [sp, #0x1D0] ;080A90E2: 080A lsr r2, r1, #0x0 ;080A90E4: 9174 str r1, [sp, #0x1D0] ;080A90E6: 080A lsr r2, r1, #0x0 ;080A90E8: 9174 str r1, [sp, #0x1D0] ;080A90EA: 080A lsr r2, r1, #0x0 ;080A90EC: 9174 str r1, [sp, #0x1D0] ;080A90EE: 080A lsr r2, r1, #0x0 ;080A90F0: 9174 str r1, [sp, #0x1D0] ;080A90F2: 080A lsr r2, r1, #0x0 ;080A90F4: 9174 str r1, [sp, #0x1D0] ;080A90F6: 080A lsr r2, r1, #0x0 ;080A90F8: 9174 str r1, [sp, #0x1D0] ;080A90FA: 080A lsr r2, r1, #0x0 ;080A90FC: 9174 str r1, [sp, #0x1D0] ;080A90FE: 080A lsr r2, r1, #0x0 ;080A9100: 9174 str r1, [sp, #0x1D0] ;080A9102: 080A lsr r2, r1, #0x0 ;080A9104: 9174 str r1, [sp, #0x1D0] ;080A9106: 080A lsr r2, r1, #0x0 ;080A9108: 9174 str r1, [sp, #0x1D0] ;080A910A: 080A lsr r2, r1, #0x0 ;080A910C: 9174 str r1, [sp, #0x1D0] ;080A910E: 080A lsr r2, r1, #0x0 ;080A9110: 8FDA ldrh r2, [r3, #0x3E] ;080A9112: 080A lsr r2, r1, #0x0 ;080A9114: 916A str r1, [sp, #0x1A8] ;080A9116: 080A lsr r2, r1, #0x0 ;080A9118: 9174 str r1, [sp, #0x1D0] ;080A911A: 080A lsr r2, r1, #0x0 080A911C: 8FDA ldrh r2, [r3, #0x3E] 080A911E: 080A lsr r2, r1, #0x0 080A9120: 8FDA ldrh r2, [r3, #0x3E] 080A9122: 080A lsr r2, r1, #0x0 080A9124: 9140 str r1, [sp, #0x100] 080A9126: 080A lsr r2, r1, #0x0 ; entry a00: 080A9128: 4904 ldr r1, =#0x020361B4 080A912A: 201C mov r0, #0x1C 080A912C: 8008 strh r0, [r1] 080A912E: 2038 mov r0, #0x38 080A9130: 8048 strh r0, [r1, #0x02] 080A9132: 20C0 mov r0, #0xC0 080A9134: 8088 strh r0, [r1, #0x04] 080A9136: 2030 mov r0, #0x30 080A9138: 80C8 strh r0, [r1, #0x06] 080A913A: E01B b 0x080A9174 080A913C: 61B4 str r4, [r6, #0x18] 080A913E: 0203 lsl r3, r0, #0x8 080A9140: 4804 ldr r0, =#0x00003AA0 080A9142: 1819 add r1, r3, r0 080A9144: 8808 ldrh r0, [r1] 080A9146: 3810 sub r0, #0x10 080A9148: 8008 strh r0, [r1] 080A914A: 4A03 ldr r2, =#0x00003AA4 080A914C: 1899 add r1, r3, r2 080A914E: 8808 ldrh r0, [r1] 080A9150: 3010 add r0, #0x10 080A9152: E00E b 0x080A9172 080A9154: 3AA0 sub r2, #0xA0 080A9156: 0000 lsl r0, r0, #0x0 080A9158: 3AA4 sub r2, #0xA4 080A915A: 0000 lsl r0, r0, #0x0 080A915C: 4907 ldr r1, =#0x000037CC 080A915E: 1858 add r0, r3, r1 080A9160: 8800 ldrh r0, [r0] 080A9162: 285F cmp r0, #0x5F 080A9164: D001 beq 0x080A916A 080A9166: 2861 cmp r0, #0x61 080A9168: D104 bne 0x080A9174 080A916A: 4A05 ldr r2, =#0x00003AA0 080A916C: 1899 add r1, r3, r2 080A916E: 8808 ldrh r0, [r1] 080A9170: 3808 sub r0, #0x08 080A9172: 8008 strh r0, [r1] ; entry 03,05,06:080A9174 ; entry a01-a12:080A9174 exit ; entry a15:080A9174 080A9174: BCF0 pop {r4, r5, r6, r7} 080A9176: BC01 pop {r0} 080A9178: 4700 bx r0 ;080A917A: 0000 lsl r0, r0, #0x0 ;080A917C: 37CC add r7, #0xCC ;080A917E: 0000 lsl r0, r0, #0x0 ;080A9180: 3AA0 sub r2, #0xA0 ;080A9182: 0000 lsl r0, r0, #0x0
$080A9318 - ?
This is called from $080A7BE8 (maybe from others, later, too). Coming from $080A7BE8, r0 contains the address $02032714 and r1 = #$00.
In that case, this subroutine does the following:
- It stores #$FFFF in $02036120-F
- It stores #$0001 in $02036130-F
- It stores #$00 in $02036156
- It stores the value that was originally in r1 in $02036157 (here: #$00)
- It stores #$00 in $02036158
- It clears Bit 0 in $02036159
- It stores #$0000 in $02036140-7
080A9318: B5F0 push {r4, r5, r6, r7, lr} 080A931A: 464F mov r7, r9 080A931C: 4646 mov r6, r8 080A931E: B4C0 push {r6, r7} 080A9320: 1C04 add r4, r0, #0x0 ; r4 = Orig. r0 (#$02032714) 080A9322: 0409 lsl r1, r1, #0x10 ; r1 AND #$0000FFFF 080A9324: 0C09 lsr r1, r1, #0x10 080A9326: 4688 mov r8, r1 ; r8 = Orig. r1 080A9328: 2300 mov r3, #0x00 ; Setup Loop Counter 080A932A: 481D ldr r0, =#0x00003A0C 080A932C: 1826 add r6, r4, r0 ; r6 = Orig. r0 + #$3A0C (#$02036120) 080A932E: 491D ldr r1, =#0x0000FFFF 080A9330: 468C mov r12, r1 ; r12 = #$0000FFFF 080A9332: 4A1D ldr r2, =#0x00003A1C 080A9334: 18A5 add r5, r4, r2 ; r5 = Orig. r0 + #$3A1C (#$02036130) 080A9336: 2701 mov r7, #0x01 080A9338: 46B9 mov r9, r7 080A933A: 0059 lsl r1, r3, #0x1 ; r1 = Loop Counter * 2 080A933C: 1872 add r2, r6, r1 ; r2 = r6 + Loop Counter * 2 (#$02036120 + LC*2) 080A933E: 8810 ldrh r0, [r2] ; Load value from r2 080A9340: 4667 mov r7, r12 ; r7 = #$0000FFFF 080A9342: 4338 orr r0, r7 ; Set Lower Bits of the Double Byte(?) 080A9344: 8010 strh r0, [r2] ; Store #$FFFF back(?) 080A9346: 1869 add r1, r5, r1 ; r1 = r5 + Loop Counter * 2 (#$02036130 + LC*2) 080A9348: 4648 mov r0, r9 ; r0 = #$0001 080A934A: 8008 strh r0, [r1] ; Store #$0001 back 080A934C: 1C58 add r0, r3, #0x1 ; INC Loop Counter 080A934E: 0400 lsl r0, r0, #0x10 ; Loop Counter AND #$0000FFFF 080A9350: 0C03 lsr r3, r0, #0x10 080A9352: 2B07 cmp r3, #0x07 080A9354: D9F1 bls 0x080A933A ; Loop until Loop Counter > #$07 080A9356: 4915 ldr r1, =#0x00003A42 080A9358: 1860 add r0, r4, r1 ; r0 = Orig. r0 + #$3A42 (#$02036156) 080A935A: 2100 mov r1, #0x00 080A935C: 7001 strb r1, [r0] ; (Clear $02036156) 080A935E: 4A14 ldr r2, =#0x00003A43 080A9360: 18A0 add r0, r4, r2 ; r0 = Orig. r0 + #$3A43 (#$02036157) 080A9362: 4647 mov r7, r8 080A9364: 7007 strb r7, [r0] ; Store Original r1 in r0 ($02036157) 080A9366: 3201 add r2, #0x01 080A9368: 18A0 add r0, r4, r2 ; r0 = Orig. r0 + #$3A44 (#$02036158) 080A936A: 7001 strb r1, [r0] ; (Clear $02036158) 080A936C: 4F11 ldr r7, =#0x00003A45 080A936E: 19E2 add r2, r4, r7 ; r0 = Orig. r0 + #$3A45 (#$02036159) 080A9370: 7811 ldrb r1, [r2] 080A9372: 2002 mov r0, #0x02 080A9374: 4240 neg r0, r0 080A9376: 4008 and r0, r1 ; Remove Bit 0 080A9378: 7010 strb r0, [r2] ; Store value back (in #$02036159) 080A937A: 2300 mov r3, #0x00 080A937C: 480E ldr r0, =#0x00003A2C 080A937E: 1822 add r2, r4, r0 ; r2 = Orig. r0 + #$3A2C (#$02036140) 080A9380: 2100 mov r1, #0x00 ; r1 = #$00000000 080A9382: 0058 lsl r0, r3, #0x1 ; r0 = Loop Counter * 2 080A9384: 1810 add r0, r2, r0 080A9386: 8001 strh r1, [r0] ; Store #$0000 in r0 080A9388: 1C58 add r0, r3, #0x1 ; Increment Loop Counter 080A938A: 0400 lsl r0, r0, #0x10 ; Loop Counter AND #$0000FFFF 080A938C: 0C03 lsr r3, r0, #0x10 080A938E: 2B04 cmp r3, #0x04 080A9390: D9F7 bls 0x080A9382 ; Loop until Loop Counter > #$04 080A9392: BC18 pop {r3, r4} 080A9394: 4698 mov r8, r3 080A9396: 46A1 mov r9, r4 080A9398: BCF0 pop {r4, r5, r6, r7} 080A939A: BC01 pop {r0} 080A939C: 4700 bx r0 ;080A939E: 0000 lsl r0, r0, #0x0 ;080A93A0: 3A0C sub r2, #0x0C ;080A93A2: 0000 lsl r0, r0, #0x0 ;080A93A4: FFFF bl 0x080AA3A4 ;080A93A6: 0000 lsl r0, r0, #0x0 ;080A93A8: 3A1C sub r2, #0x1C ;080A93AA: 0000 lsl r0, r0, #0x0 ;080A93AC: 3A42 sub r2, #0x42 ;080A93AE: 0000 lsl r0, r0, #0x0 ;080A93B0: 3A43 sub r2, #0x43 ;080A93B2: 0000 lsl r0, r0, #0x0 ;080A93B4: 3A45 sub r2, #0x45 ;080A93B6: 0000 lsl r0, r0, #0x0 ;080A93B8: 3A2C sub r2, #0x2C ;080A93BA: 0000 lsl r0, r0, #0x0
$080A93BC - ?
This is called from $080A7BE8. If it is, the address in r0 is $02032714.
In that case, this changes the registers between $02036018 and $02036057. It sets two byte to #$FFFF, leaves two byte out, sets two byte to #$FFFF again and so on. After that, it jumps to an address from a jump table.
080A93BC: B510 push {r4, lr} 080A93BE: 1C03 add r3, r0, #0x0 ; r3 = Orig. r0 (#$02032714) 080A93C0: 4810 ldr r0, =#0x00003904 080A93C2: 1819 add r1, r3, r0 ; r1 = Orig. r0 + #$3904 (#$02036018) 080A93C4: 2200 mov r2, #0x00 ; Set up Loop Counter 080A93C6: 4810 ldr r0, =#0x0000FFFF 080A93C8: 1C04 add r4, r0, #0x0 080A93CA: 8808 ldrh r0, [r1] 080A93CC: 4320 orr r0, r4 080A93CE: 8008 strh r0, [r1] ; Store #$FFFF in r1 (#$02036018 + Loop Counter * 4) 080A93D0: 1C50 add r0, r2, #0x1 ; INC Loop Counter 080A93D2: 0400 lsl r0, r0, #0x10 ; Loop Counter AND #$0000FFFF 080A93D4: 0C02 lsr r2, r0, #0x10 080A93D6: 3104 add r1, #0x04 ; INC Load Store address 080A93D8: 2A41 cmp r2, #0x41 080A93DA: D9F6 bls 0x080A93CA 080A93DC: 490B ldr r1, =#0x00003A44 080A93DE: 1858 add r0, r3, r1 ; r1 = Orig. r0 + #$3A44 (#$02036158) 080A93E0: 7800 ldrb r0, [r0] ; Load the Index for the jump Table. Bits 4 to 6 of the loaded Byte form the Index. 080A93E2: 0601 lsl r1, r0, #0x18 ; If Bit 7 is set, the value is invalid and the Jump Table-segment is left out. 080A93E4: 0F08 lsr r0, r1, #0x1C 080A93E6: 2804 cmp r0, #0x04 080A93E8: D808 bhi 0x080A93FC ; Exit if r0 > #$04 080A93EA: 4809 ldr r0, =#0x086996E0 ; Address Table address 080A93EC: 0F09 lsr r1, r1, #0x1C ; Above the >>#$1C was done for comparison (r0), here it is done with the real value (r1) 080A93EE: 0089 lsl r1, r1, #0x2 ; multiplied by 4 (each entry in the table is an 32-bit-address) 080A93F0: 1809 add r1, r1, r0 ; r1 = Offset + Index 080A93F2: 4A08 ldr r2, =#0x000038F4 080A93F4: 1898 add r0, r3, r2 ; r0 = Orig. r0 + #$38F4 (#$02036008) 080A93F6: 6809 ldr r1, [r1] ; Load the address where to jump in r1 080A93F8: F017 bl 080A93FA: F8B6 bl 0x080C0568 ; bx r1 080A93FC: BC10 pop {r4} 080A93FE: BC01 pop {r0} 080A9400: 4700 bx r0 ;080A9402: 0000 lsl r0, r0, #0x0 ;080A9404: 3904 sub r1, #0x04 ;080A9406: 0000 lsl r0, r0, #0x0 ;080A9408: FFFF bl 0x080AA408 ;080A940A: 0000 lsl r0, r0, #0x0 ;080A940C: 3A44 sub r2, #0x44 ;080A940E: 0000 lsl r0, r0, #0x0 ;080A9410: 96E0 str r6, [sp, #0x380] ;080A9412: 0869 lsr r1, r5, #0x1 ;080A9414: 38F4 sub r0, #0xF4 ;080A9416: 0000 lsl r0, r0, #0x0
$080AFD60 - ?
080AFD60: B5F0 push {r4, r5, r6, r7, lr} 080AFD62: 4657 mov r7, r10 080AFD64: 464E mov r6, r9 080AFD66: 4645 mov r5, r8 080AFD68: B4E0 push {r5, r6, r7} 080AFD6A: B088 add sp, #-0x020 080AFD6C: 1C07 add r7, r0, #0x0 ; r7 = r0 080AFD6E: 0409 lsl r1, r1, #0x10 080AFD70: 0C09 lsr r1, r1, #0x10 ; r1 AND #$0000FFFF 080AFD72: 9106 str r1, [sp, #0x018] 080AFD74: 4898 ldr r0, =#0x080C3348 080AFD76: F001 bl 080AFD78: F9AB bl 0x080B10D0 ; ? 080AFD7A: 2002 mov r0, #0x02 080AFD7C: 2100 mov r1, #0x00 080AFD7E: F00D bl 080AFD80: FCD5 bl 0x080BD72C ; ? 080AFD82: 4996 ldr r1, =#0x00003820 080AFD84: 1878 add r0, r7, r1 080AFD86: 8800 ldrh r0, [r0] ; r0 = [Orig. r0 + #$3820] 080AFD88: 2801 cmp r0, #0x01 080AFD8A: D800 bhi 0x080AFD8E 080AFD8C: E138 b 0x080B0000 080AFD8E: 4A94 ldr r2, =#0x00003826 080AFD90: 18B8 add r0, r7, r2 080AFD92: 7801 ldrb r1, [r0] 080AFD94: 2004 mov r0, #0x04 080AFD96: 4008 and r0, r1 080AFD98: 2800 cmp r0, #0x00 ; Is Bit 2 of [Orig. r0 + #$3826] set? 080AFD9A: D100 bne 0x080AFD9E 080AFD9C: E130 b 0x080B0000 080AFD9E: 4B91 ldr r3, =#0x02032700 080AFDA0: 6858 ldr r0, [r3, #0x04] ; r0 = $02032704 (Tilemap buffer address?) 080AFDA2: 4D91 ldr r5, =#0x00001F04 080AFDA4: 1940 add r0, r0, r5 080AFDA6: 8800 ldrh r0, [r0] 080AFDA8: 9007 str r0, [sp, #0x01C] 080AFDAA: 4C90 ldr r4, =#0x080C2EAC 080AFDAC: 4890 ldr r0, =#0x00003AB0 080AFDAE: 183E add r6, r7, r0 080AFDB0: 8831 ldrh r1, [r6] ; r1 = [Orig. r0 + #$3AB0] 080AFDB2: 311E add r1, #0x1E 080AFDB4: 0409 lsl r1, r1, #0x10 080AFDB6: 0C09 lsr r1, r1, #0x10 ; r1 AND #$0000FFFF 080AFDB8: 4A8E ldr r2, =#0x00003AB2 080AFDBA: 18BD add r5, r7, r2 080AFDBC: 882A ldrh r2, [r5] ; r2 = [Orig. r0 + #$3AB2] 080AFDBE: 3207 add r2, #0x07 080AFDC0: 0412 lsl r2, r2, #0x10 080AFDC2: 0C12 lsr r2, r2, #0x10 ; r2 AND #$0000FFFF 080AFDC4: 1C20 add r0, r4, #0x0 ; r0 = #$080C2EAC 080AFDC6: 2320 mov r3, #0x20 080AFDC8: F001 bl 080AFDCA: F916 bl 0x080B0FF8 ; ? 080AFDCC: 1C20 add r0, r4, #0x0 ; r0 = #$080C2EAC 080AFDCE: 3020 add r0, #0x20 ; r0 = #$080C2ECC 080AFDD0: 8831 ldrh r1, [r6] ; r1 = [Orig. r0 + #$3AB0] 080AFDD2: 3150 add r1, #0x50 080AFDD4: 0409 lsl r1, r1, #0x10 080AFDD6: 0C09 lsr r1, r1, #0x10 ; r1 AND #$0000FFFF 080AFDD8: 882A ldrh r2, [r5] ; r2 = [Orig. r0 + #$3AB2] 080AFDDA: 3207 add r2, #0x07 080AFDDC: 0412 lsl r2, r2, #0x10 080AFDDE: 0C12 lsr r2, r2, #0x10 ; r2 AND #$0000FFFF 080AFDE0: 2320 mov r3, #0x20 080AFDE2: F001 bl 080AFDE4: F909 bl 0x080B0FF8 ; ? 080AFDE6: 1C20 add r0, r4, #0x0 ; r0 = #$080C2EAC 080AFDE8: 3010 add r0, #0x10 ; r0 = #$080C2EBC 080AFDEA: 8831 ldrh r1, [r6] ; r1 = [Orig. r0 + #$3AB0] 080AFDEC: 311E add r1, #0x1E 080AFDEE: 0409 lsl r1, r1, #0x10 080AFDF0: 0C09 lsr r1, r1, #0x10 ; r1 AND #$0000FFFF 080AFDF2: 882A ldrh r2, [r5] ; r2 = [Orig. r0 + #$3AB2] 080AFDF4: 3218 add r2, #0x18 080AFDF6: 0412 lsl r2, r2, #0x10 080AFDF8: 0C12 lsr r2, r2, #0x10 ; r2 AND #$0000FFFF 080AFDFA: 2320 mov r3, #0x20 080AFDFC: F001 bl 080AFDFE: F8FC bl 0x080B0FF8 ; ? 080AFE00: 1C20 add r0, r4, #0x0 ; r0 = #$080C2EAC 080AFE02: 3030 add r0, #0x30 ; r0 = #$080C2EDC 080AFE04: 8831 ldrh r1, [r6] ; r1 = [Orig. r0 + #$3AB0] 080AFE06: 3150 add r1, #0x50 080AFE08: 0409 lsl r1, r1, #0x10 080AFE0A: 0C09 lsr r1, r1, #0x10 ; r1 AND #$0000FFFF 080AFE0C: 882A ldrh r2, [r5] ; r2 = [Orig. r0 + #$3AB2] 080AFE0E: 3218 add r2, #0x18 080AFE10: 0412 lsl r2, r2, #0x10 080AFE12: 0C12 lsr r2, r2, #0x10 ; r2 AND #$0000FFFF 080AFE14: 2320 mov r3, #0x20 080AFE16: F001 bl 080AFE18: F8EF bl 0x080B0FF8 ; ? 080AFE1A: 1C20 add r0, r4, #0x0 ; r0 = #$080C2EAC 080AFE1C: 3040 add r0, #0x40 ; r0 = #$080C2EEC 080AFE1E: 8831 ldrh r1, [r6] ; r1 = [Orig. r0 + #$3AB0] 080AFE20: 3182 add r1, #0x82 080AFE22: 0409 lsl r1, r1, #0x10 080AFE24: 0C09 lsr r1, r1, #0x10 ; r1 AND #$0000FFFF 080AFE26: 882A ldrh r2, [r5] ; r2 = [Orig. r0 + #$3AB2] 080AFE28: 3218 add r2, #0x18 080AFE2A: 0412 lsl r2, r2, #0x10 080AFE2C: 0C12 lsr r2, r2, #0x10 ; r2 AND #$0000FFFF 080AFE2E: 2320 mov r3, #0x20 080AFE30: F001 bl 080AFE32: F8E2 bl 0x080B0FF8 ; ? 080AFE34: 1C20 add r0, r4, #0x0 ; r0 = #$080C2EAC 080AFE36: 3860 sub r0, #0x60 ; r0 = #$080C2F0C 080AFE38: 8831 ldrh r1, [r6] ; r1 = [Orig. r0 + #$3AB0] 080AFE3A: 31A4 add r1, #0xA4 080AFE3C: 0409 lsl r1, r1, #0x10 080AFE3E: 0C09 lsr r1, r1, #0x10 ; r1 AND #$0000FFFF 080AFE40: 882A ldrh r2, [r5] ; r2 = [Orig. r0 + #$3AB2] 080AFE42: 3216 add r2, #0x16 080AFE44: 0412 lsl r2, r2, #0x10 080AFE46: 0C12 lsr r2, r2, #0x10 ; r2 AND #$0000FFFF 080AFE48: 2320 mov r3, #0x20 080AFE4A: F001 bl 080AFE4C: F8D5 bl 0x080B0FF8 ; ? 080AFE4E: 4B6A ldr r3, =#0x00003822 080AFE50: 19DB add r3, r3, r7 ; r3 = Orig. r0 + #$3822 080AFE52: 4698 mov r8, r3 ; r8 = Orig. r0 + #$3822 080AFE54: 8818 ldrh r0, [r3] ; r0 = [Orig. r0 + #$3822] (Some Table Index) 080AFE56: 00C0 lsl r0, r0, #0x3 ; Each Table Entry is 8 Bytes in Size 080AFE58: 4968 ldr r1, =#0x080FF4A8 ; Table Address 080AFE5A: 1840 add r0, r0, r1 080AFE5C: 8800 ldrh r0, [r0] ; Load first double byte 080AFE5E: 04C0 lsl r0, r0, #0x13 080AFE60: 0E02 lsr r2, r0, #0x18 080AFE62: 230C mov r3, #0x0C 080AFE64: 2A00 cmp r2, #0x00 080AFE66: D100 bne 0x080AFE6A 080AFE68: 2307 mov r3, #0x07 080AFE6A: 8830 ldrh r0, [r6] 080AFE6C: 3030 add r0, #0x30 080AFE6E: 0400 lsl r0, r0, #0x10 080AFE70: 0C00 lsr r0, r0, #0x10 080AFE72: 8829 ldrh r1, [r5] 080AFE74: 3105 add r1, #0x05 080AFE76: 0409 lsl r1, r1, #0x10 080AFE78: 0C09 lsr r1, r1, #0x10 080AFE7A: 468C mov r12, r1 080AFE7C: 2402 mov r4, #0x02 080AFE7E: 9400 str r4, [sp] 080AFE80: 21A0 mov r1, #0xA0 080AFE82: 0089 lsl r1, r1, #0x2 080AFE84: 9101 str r1, [sp, #0x004] 080AFE86: 9302 str r3, [sp, #0x008] 080AFE88: 9403 str r4, [sp, #0x00C] 080AFE8A: 2300 mov r3, #0x00 080AFE8C: 469A mov r10, r3 080AFE8E: 9304 str r3, [sp, #0x010] 080AFE90: 2101 mov r1, #0x01 080AFE92: 4689 mov r9, r1 080AFE94: 9105 str r1, [sp, #0x014] 080AFE96: 4661 mov r1, r12 080AFE98: 2302 mov r3, #0x02 080AFE9A: F002 bl 080AFE9C: FBEB bl 0x080B2674 080AFE9E: 4642 mov r2, r8 080AFEA0: 8810 ldrh r0, [r2] 080AFEA2: 00C0 lsl r0, r0, #0x3 080AFEA4: 4B55 ldr r3, =#0x080FF4A8 080AFEA6: 18C0 add r0, r0, r3 080AFEA8: 78C2 ldrb r2, [r0, #0x03] 080AFEAA: 0952 lsr r2, r2, #0x5 080AFEAC: 7900 ldrb r0, [r0, #0x04] 080AFEAE: 211F mov r1, #0x1F 080AFEB0: 4008 and r0, r1 080AFEB2: 00C3 lsl r3, r0, #0x3 080AFEB4: 4313 orr r3, r2 080AFEB6: 220C mov r2, #0x0C 080AFEB8: 2B00 cmp r3, #0x00 080AFEBA: D100 bne 0x080AFEBE 080AFEBC: 2207 mov r2, #0x07 080AFEBE: 8830 ldrh r0, [r6] 080AFEC0: 3062 add r0, #0x62 080AFEC2: 0400 lsl r0, r0, #0x10 080AFEC4: 0C00 lsr r0, r0, #0x10 080AFEC6: 8829 ldrh r1, [r5] 080AFEC8: 3105 add r1, #0x05 080AFECA: 0409 lsl r1, r1, #0x10 080AFECC: 0C09 lsr r1, r1, #0x10 080AFECE: 468C mov r12, r1 080AFED0: 9400 str r4, [sp] 080AFED2: 21A0 mov r1, #0xA0 080AFED4: 0089 lsl r1, r1, #0x2 080AFED6: 9101 str r1, [sp, #0x004] 080AFED8: 9202 str r2, [sp, #0x008] 080AFEDA: 9403 str r4, [sp, #0x00C] 080AFEDC: 4652 mov r2, r10 080AFEDE: 9204 str r2, [sp, #0x010] 080AFEE0: 4649 mov r1, r9 080AFEE2: 9105 str r1, [sp, #0x014] 080AFEE4: 4661 mov r1, r12 080AFEE6: 1C1A add r2, r3, #0x0 080AFEE8: 2302 mov r3, #0x02 080AFEEA: F002 bl 080AFEEC: FBC3 bl 0x080B2674 080AFEEE: 4642 mov r2, r8 080AFEF0: 8810 ldrh r0, [r2] 080AFEF2: 00C0 lsl r0, r0, #0x3 080AFEF4: 4B41 ldr r3, =#0x080FF4A8 080AFEF6: 18C0 add r0, r0, r3 080AFEF8: 8840 ldrh r0, [r0, #0x02] 080AFEFA: 04C0 lsl r0, r0, #0x13 080AFEFC: 0E02 lsr r2, r0, #0x18 080AFEFE: 230C mov r3, #0x0C 080AFF00: 2A00 cmp r2, #0x00 080AFF02: D100 bne 0x080AFF06 080AFF04: 2307 mov r3, #0x07 080AFF06: 8830 ldrh r0, [r6] 080AFF08: 3030 add r0, #0x30 080AFF0A: 0400 lsl r0, r0, #0x10 080AFF0C: 0C00 lsr r0, r0, #0x10 080AFF0E: 8829 ldrh r1, [r5] 080AFF10: 3116 add r1, #0x16 080AFF12: 0409 lsl r1, r1, #0x10 080AFF14: 0C09 lsr r1, r1, #0x10 080AFF16: 468C mov r12, r1 080AFF18: 9400 str r4, [sp] 080AFF1A: 21A0 mov r1, #0xA0 080AFF1C: 0089 lsl r1, r1, #0x2 080AFF1E: 9101 str r1, [sp, #0x004] 080AFF20: 9302 str r3, [sp, #0x008] 080AFF22: 9403 str r4, [sp, #0x00C] 080AFF24: 4653 mov r3, r10 080AFF26: 9304 str r3, [sp, #0x010] 080AFF28: 4649 mov r1, r9 080AFF2A: 9105 str r1, [sp, #0x014] 080AFF2C: 4661 mov r1, r12 080AFF2E: 2302 mov r3, #0x02 080AFF30: F002 bl 080AFF32: FBA0 bl 0x080B2674 080AFF34: 4642 mov r2, r8 080AFF36: 8810 ldrh r0, [r2] 080AFF38: 00C0 lsl r0, r0, #0x3 080AFF3A: 4B30 ldr r3, =#0x080FF4A8 080AFF3C: 18C0 add r0, r0, r3 080AFF3E: 6800 ldr r0, [r0] 080AFF40: 02C0 lsl r0, r0, #0xB 080AFF42: 0E02 lsr r2, r0, #0x18 080AFF44: 230C mov r3, #0x0C 080AFF46: 2A00 cmp r2, #0x00 080AFF48: D100 bne 0x080AFF4C 080AFF4A: 2307 mov r3, #0x07 080AFF4C: 8830 ldrh r0, [r6] 080AFF4E: 3062 add r0, #0x62 080AFF50: 0400 lsl r0, r0, #0x10 080AFF52: 0C00 lsr r0, r0, #0x10 080AFF54: 8829 ldrh r1, [r5] 080AFF56: 3116 add r1, #0x16 080AFF58: 0409 lsl r1, r1, #0x10 080AFF5A: 0C09 lsr r1, r1, #0x10 080AFF5C: 468C mov r12, r1 080AFF5E: 9400 str r4, [sp] 080AFF60: 21A0 mov r1, #0xA0 080AFF62: 0089 lsl r1, r1, #0x2 080AFF64: 9101 str r1, [sp, #0x004] 080AFF66: 9302 str r3, [sp, #0x008] 080AFF68: 9403 str r4, [sp, #0x00C] 080AFF6A: 4653 mov r3, r10 080AFF6C: 9304 str r3, [sp, #0x010] 080AFF6E: 4649 mov r1, r9 080AFF70: 9105 str r1, [sp, #0x014] 080AFF72: 4661 mov r1, r12 080AFF74: 2302 mov r3, #0x02 080AFF76: F002 bl 080AFF78: FB7D bl 0x080B2674 080AFF7A: 4642 mov r2, r8 080AFF7C: 8810 ldrh r0, [r2] 080AFF7E: 00C0 lsl r0, r0, #0x3 080AFF80: 4B1E ldr r3, =#0x080FF4A8 080AFF82: 18C0 add r0, r0, r3 080AFF84: 8880 ldrh r0, [r0, #0x04] 080AFF86: 04C0 lsl r0, r0, #0x13 080AFF88: 0E02 lsr r2, r0, #0x18 080AFF8A: 230C mov r3, #0x0C 080AFF8C: 2A00 cmp r2, #0x00 080AFF8E: D100 bne 0x080AFF92 080AFF90: 2307 mov r3, #0x07 080AFF92: 8830 ldrh r0, [r6] 080AFF94: 3094 add r0, #0x94 080AFF96: 0400 lsl r0, r0, #0x10 080AFF98: 0C00 lsr r0, r0, #0x10 080AFF9A: 8829 ldrh r1, [r5] 080AFF9C: 3116 add r1, #0x16 080AFF9E: 0409 lsl r1, r1, #0x10 080AFFA0: 0C09 lsr r1, r1, #0x10 080AFFA2: 9400 str r4, [sp] 080AFFA4: 25A0 mov r5, #0xA0 080AFFA6: 00AD lsl r5, r5, #0x2 080AFFA8: 9501 str r5, [sp, #0x004] 080AFFAA: 9302 str r3, [sp, #0x008] 080AFFAC: 9403 str r4, [sp, #0x00C] 080AFFAE: 4653 mov r3, r10 080AFFB0: 9304 str r3, [sp, #0x010] 080AFFB2: 464D mov r5, r9 080AFFB4: 9505 str r5, [sp, #0x014] 080AFFB6: 2302 mov r3, #0x02 080AFFB8: F002 bl 080AFFBA: FB5C bl 0x080B2674 080AFFBC: 4909 ldr r1, =#0x02032700 080AFFBE: 6848 ldr r0, [r1, #0x04] 080AFFC0: 4A09 ldr r2, =#0x00001F04 080AFFC2: 1880 add r0, r0, r2 080AFFC4: 8800 ldrh r0, [r0] 080AFFC6: 9B07 ldr r3, [sp, #0x01C] 080AFFC8: 1AC0 sub r0, r0, r3 080AFFCA: 0400 lsl r0, r0, #0x10 080AFFCC: 0C00 lsr r0, r0, #0x10 080AFFCE: 2100 mov r1, #0x00 080AFFD0: F00D bl 080AFFD2: FBAC bl 0x080BD72C 080AFFD4: E02D b 0x080B0032 ;080AFFD6: 0000 lsl r0, r0, #0x0 ;080AFFD8: 3348 add r3, #0x48 ;080AFFDA: 080C lsr r4, r1, #0x0 ;080AFFDC: 3820 sub r0, #0x20 ;080AFFDE: 0000 lsl r0, r0, #0x0 ;080AFFE0: 3826 sub r0, #0x26 ;080AFFE2: 0000 lsl r0, r0, #0x0 ;080AFFE4: 2700 mov r7, #0x00 ;080AFFE6: 0203 lsl r3, r0, #0x8 ;080AFFE8: 1F04 sub r4, r0, #0x4 ;080AFFEA: 0000 lsl r0, r0, #0x0 ;080AFFEC: 2EAC cmp r6, #0xAC ;080AFFEE: 080C lsr r4, r1, #0x0 ;080AFFF0: 3AB0 sub r2, #0xB0 ;080AFFF2: 0000 lsl r0, r0, #0x0 ;080AFFF4: 3AB2 sub r2, #0xB2 ;080AFFF6: 0000 lsl r0, r0, #0x0 ;080AFFF8: 3822 sub r0, #0x22 ;080AFFFA: 0000 lsl r0, r0, #0x0 ;080AFFFC: F4A8 bl ;080AFFFE: 080F lsr r7, r1, #0x0 080B0000: 4D2C ldr r5, =#0x00003AB0 080B0002: 1978 add r0, r7, r5 080B0004: 8800 ldrh r0, [r0] 080B0006: 300E add r0, #0x0E 080B0008: 0400 lsl r0, r0, #0x10 080B000A: 0C00 lsr r0, r0, #0x10 080B000C: 4A2A ldr r2, =#0x00003AB2 080B000E: 18B9 add r1, r7, r2 080B0010: 8809 ldrh r1, [r1] 080B0012: 310A add r1, #0x0A 080B0014: 0409 lsl r1, r1, #0x10 080B0016: 0C09 lsr r1, r1, #0x10 080B0018: 4B28 ldr r3, =#0x000037E0 080B001A: 18FA add r2, r7, r3 080B001C: 2301 mov r3, #0x01 080B001E: 425B neg r3, r3 080B0020: 24E4 mov r4, #0xE4 080B0022: 9400 str r4, [sp] 080B0024: 240F mov r4, #0x0F 080B0026: 9401 str r4, [sp, #0x004] 080B0028: 2400 mov r4, #0x00 080B002A: 9402 str r4, [sp, #0x008] 080B002C: 9403 str r4, [sp, #0x00C] 080B002E: F005 bl 080B0030: FC5F bl 0x080B58F0 080B0032: 4D23 ldr r5, =#0x00003820 080B0034: 197C add r4, r7, r5 080B0036: 8820 ldrh r0, [r4] 080B0038: 2800 cmp r0, #0x00 080B003A: D015 beq 0x080B0068 080B003C: 4821 ldr r0, =#0x080C307C 080B003E: 4A1D ldr r2, =#0x00003AB0 080B0040: 18B9 add r1, r7, r2 080B0042: 8809 ldrh r1, [r1] 080B0044: 31B2 add r1, #0xB2 080B0046: 0409 lsl r1, r1, #0x10 080B0048: 0C09 lsr r1, r1, #0x10 080B004A: 4D1B ldr r5, =#0x00003AB2 080B004C: 197B add r3, r7, r5 080B004E: 9A06 ldr r2, [sp, #0x018] 080B0050: 3208 add r2, #0x08 080B0052: 881B ldrh r3, [r3] 080B0054: 18D2 add r2, r2, r3 080B0056: 0412 lsl r2, r2, #0x10 080B0058: 0C12 lsr r2, r2, #0x10 080B005A: 2320 mov r3, #0x20 080B005C: F000 bl 080B005E: FFCC bl 0x080B0FF8 080B0060: 2001 mov r0, #0x01 080B0062: 2100 mov r1, #0x00 080B0064: F00D bl 080B0066: FB62 bl 0x080BD72C 080B0068: 8820 ldrh r0, [r4] 080B006A: 3002 add r0, #0x02 080B006C: 4A16 ldr r2, =#0x00003824 080B006E: 18B9 add r1, r7, r2 080B0070: 8809 ldrh r1, [r1] 080B0072: 4288 cmp r0, r1 080B0074: DA15 bge 0x080B00A2 080B0076: 4815 ldr r0, =#0x080C308C 080B0078: 4B0E ldr r3, =#0x00003AB0 080B007A: 18F9 add r1, r7, r3 080B007C: 8809 ldrh r1, [r1] 080B007E: 31B2 add r1, #0xB2 080B0080: 0409 lsl r1, r1, #0x10 080B0082: 0C09 lsr r1, r1, #0x10 080B0084: 4D0C ldr r5, =#0x00003AB2 080B0086: 197B add r3, r7, r5 080B0088: 9A06 ldr r2, [sp, #0x018] 080B008A: 3220 add r2, #0x20 080B008C: 881B ldrh r3, [r3] 080B008E: 18D2 add r2, r2, r3 080B0090: 0412 lsl r2, r2, #0x10 080B0092: 0C12 lsr r2, r2, #0x10 080B0094: 2320 mov r3, #0x20 080B0096: F000 bl 080B0098: FFAF bl 0x080B0FF8 080B009A: 2001 mov r0, #0x01 080B009C: 2100 mov r1, #0x00 080B009E: F00D bl 080B00A0: FB45 bl 0x080BD72C 080B00A2: B008 add sp, #0x020 080B00A4: BC38 pop {r3, r4, r5} 080B00A6: 4698 mov r8, r3 080B00A8: 46A1 mov r9, r4 080B00AA: 46AA mov r10, r5 080B00AC: BCF0 pop {r4, r5, r6, r7} 080B00AE: BC01 pop {r0} 080B00B0: 4700 bx r0 ;080B00B2: 0000 lsl r0, r0, #0x0 ;080B00B4: 3AB0 sub r2, #0xB0 ;080B00B6: 0000 lsl r0, r0, #0x0 ;080B00B8: 3AB2 sub r2, #0xB2 ;080B00BA: 0000 lsl r0, r0, #0x0 ;080B00BC: 37E0 add r7, #0xE0 ;080B00BE: 0000 lsl r0, r0, #0x0 ;080B00C0: 3820 sub r0, #0x20 ;080B00C2: 0000 lsl r0, r0, #0x0 ;080B00C4: 307C add r0, #0x7C ;080B00C6: 080C lsr r4, r1, #0x0 ;080B00C8: 3824 sub r0, #0x24 ;080B00CA: 0000 lsl r0, r0, #0x0 ;080B00CC: 308C add r0, #0x8C ;080B00CE: 080C lsr r4, r1, #0x0
$080B0FF8 - ?
r0 contains an address, r2 and r3 contain double-byte-sized values.
080B0FF8: B5F0 push {r4, r5, r6, r7, lr} 080B0FFA: B084 add sp, #-0x010 ; Add bytes to stack 080B0FFC: 0409 lsl r1, r1, #0x10 080B0FFE: 0C0C lsr r4, r1, #0x10 ; r4 = Original r1 AND #$0000FFFF 080B1000: 0412 lsl r2, r2, #0x10 080B1002: 0C12 lsr r2, r2, #0x10 ; r2 AND #$0000FFFF 080B1004: 041B lsl r3, r3, #0x10 080B1006: 0C1B lsr r3, r3, #0x10 ; r3 AND #$0000FFFF 080B1008: 4669 mov r1, sp 080B100A: C8E0 ldmia r0!, {r5, r6, r7} 080B100C: C1E0 stmia r1!, {r5, r6, r7} 080B100E: 6800 ldr r0, [r0] 080B1010: 6008 str r0, [r1] 080B1012: 2B1F cmp r3, #0x1F 080B1014: D801 bhi 0x080B101A 080B1016: 4668 mov r0, sp 080B1018: 8083 strh r3, [r0, #0x04] 080B101A: 4668 mov r0, sp 080B101C: 8184 strh r4, [r0, #0x0C] 080B101E: 81C2 strh r2, [r0, #0x0E] 080B1020: F000 bl 080B1022: F856 bl 0x080B10D0 080B1024: B004 add sp, #0x010 ; Remove additional bytes on stack 080B1026: BCF0 pop {r4, r5, r6, r7} 080B1028: BC01 pop {r0} 080B102A: 4700 bx r0
$080B10D0 - ?
080B10D0: B5F0 push {r4, r5, r6, r7, lr} 080B10D2: 1C04 add r4, r0, #0x0 080B10D4: 8820 ldrh r0, [r4] 080B10D6: F00C bl 080B10D8: FAD5 bl 0x080BD684 080B10DA: 1C03 add r3, r0, #0x0 080B10DC: 2500 mov r5, #0x00 080B10DE: 8820 ldrh r0, [r4] 080B10E0: 4285 cmp r5, r0 080B10E2: D242 bcs 0x080B116A 080B10E4: 4922 ldr r1, =#0xFFFFFE00 080B10E6: 468C mov r12, r1 080B10E8: 4F22 ldr r7, =#0xFFFFFC00 080B10EA: 263F mov r6, #0x3F 080B10EC: 7A20 ldrb r0, [r4, #0x08] 080B10EE: 1C01 add r1, r0, #0x0 080B10F0: 4369 mul r1, r5 080B10F2: 89A2 ldrh r2, [r4, #0x0C] 080B10F4: 1889 add r1, r1, r2 080B10F6: 4A20 ldr r2, =#0x000001FF 080B10F8: 1C10 add r0, r2, #0x0 080B10FA: 4001 and r1, r0 080B10FC: 885A ldrh r2, [r3, #0x02] 080B10FE: 4660 mov r0, r12 080B1100: 4010 and r0, r2 080B1102: 4308 orr r0, r1 080B1104: 8058 strh r0, [r3, #0x02] 080B1106: 7A60 ldrb r0, [r4, #0x09] 080B1108: 4368 mul r0, r5 080B110A: 7BA1 ldrb r1, [r4, #0x0E] 080B110C: 1840 add r0, r0, r1 080B110E: 7018 strb r0, [r3] 080B1110: 79A0 ldrb r0, [r4, #0x06] 080B1112: 1C29 add r1, r5, #0x0 080B1114: 4341 mul r1, r0 080B1116: 8862 ldrh r2, [r4, #0x02] 080B1118: 1889 add r1, r1, r2 080B111A: 4A18 ldr r2, =#0x000003FF 080B111C: 1C10 add r0, r2, #0x0 080B111E: 4001 and r1, r0 080B1120: 889A ldrh r2, [r3, #0x04] 080B1122: 1C38 add r0, r7, #0x0 080B1124: 4010 and r0, r2 080B1126: 4308 orr r0, r1 080B1128: 8098 strh r0, [r3, #0x04] 080B112A: 79E0 ldrb r0, [r4, #0x07] 080B112C: 1C29 add r1, r5, #0x0 080B112E: 4341 mul r1, r0 080B1130: 88A0 ldrh r0, [r4, #0x04] 080B1132: 1809 add r1, r1, r0 080B1134: 0109 lsl r1, r1, #0x4 080B1136: 795A ldrb r2, [r3, #0x05] 080B1138: 200F mov r0, #0x0F 080B113A: 4010 and r0, r2 080B113C: 4308 orr r0, r1 080B113E: 7158 strb r0, [r3, #0x05] 080B1140: 7AA1 ldrb r1, [r4, #0x0A] 080B1142: 0189 lsl r1, r1, #0x6 080B1144: 785A ldrb r2, [r3, #0x01] 080B1146: 1C30 add r0, r6, #0x0 080B1148: 4010 and r0, r2 080B114A: 4308 orr r0, r1 080B114C: 7058 strb r0, [r3, #0x01] 080B114E: 7AE1 ldrb r1, [r4, #0x0B] 080B1150: 0189 lsl r1, r1, #0x6 080B1152: 78DA ldrb r2, [r3, #0x03] 080B1154: 1C30 add r0, r6, #0x0 080B1156: 4010 and r0, r2 080B1158: 4308 orr r0, r1 080B115A: 70D8 strb r0, [r3, #0x03] 080B115C: 1C68 add r0, r5, #0x1 080B115E: 0400 lsl r0, r0, #0x10 080B1160: 0C05 lsr r5, r0, #0x10 080B1162: 3308 add r3, #0x08 080B1164: 8821 ldrh r1, [r4] 080B1166: 428D cmp r5, r1 080B1168: D3C0 bcc 0x080B10EC 080B116A: BCF0 pop {r4, r5, r6, r7} 080B116C: BC01 pop {r0} 080B116E: 4700 bx r0 ;DATA ;============= ;080B1170: FE00 bl 0x07FB1D72 ;080B1172: FFFF bl 0x07EB2172 ;080B1174: FC00 bl 0x080B0976 ;080B1176: FFFF bl 0x07CB2176 ;080B1178: 01FF lsl r7, r7, #0x7 ;080B117A: 0000 lsl r0, r0, #0x0 ;080B117C: 03FF lsl r7, r7, #0xF ;080B117E: 0000 lsl r0, r0, #0x0
$080B1180 - ?
This is calling a subroutine and then does many Load-AND-OR-Store back things.
If r0 is = #$00, a whole lot gets left out here.
080B1180: B5F0 push {r4, r5, r6, r7, lr} 080B1182: 464F mov r7, r9 080B1184: 4646 mov r6, r8 080B1186: B4C0 push {r6, r7} 080B1188: 0400 lsl r0, r0, #0x10 080B118A: 0C04 lsr r4, r0, #0x10 ; r4 = r0 AND #$0000FFFF 080B118C: 0409 lsl r1, r1, #0x10 080B118E: 0C0D lsr r5, r1, #0x10 ; r5 = r1 AND #$0000FFFF 080B1190: 0412 lsl r2, r2, #0x10 080B1192: 0C12 lsr r2, r2, #0x10 ; r2 AND #$0000FFFF 080B1194: 4690 mov r8, r2 ; r8 = r2 080B1196: 2002 mov r0, #0x02 080B1198: F00C bl 080B119A: FA74 bl 0x080BD684 ; ? 080B119C: 1C03 add r3, r0, #0x0 ; ? (an address) 080B119E: 2C00 cmp r4, #0x00 080B11A0: D035 beq 0x080B120E ; Exit if Original r0 was 0 080B11A2: 04A0 lsl r0, r4, #0x12 ; Pushs out the two MSBs from the double-byte-value in r4. 080B11A4: 21F0 mov r1, #0xF0 080B11A6: 0389 lsl r1, r1, #0xE ; r1 = #$003C0000 080B11A8: 1840 add r0, r0, r1 ; So, now the four bits "under" the log.shifted value of r4/Original r0 are set. 080B11AA: 0C07 lsr r7, r0, #0x10 ; r7 = #%00000000.00000000.xxxxxxxx.xx111100 x = Ten LSBs of Original r0 080B11AC: 2400 mov r4, #0x00 ; Set up Loop Counter 080B11AE: 4A1B ldr r2, =#0x000001FF 080B11B0: 1C10 add r0, r2, #0x0 ; r0 = #%xxxxxxxx.xx111100.00000001.11111111 x = Ten LSBs of Original r0 080B11B2: 4005 and r5, r0 ; Original r1 AND r0 080B11B4: 481A ldr r0, =#0xFFFFFE00 080B11B6: 4681 mov r9, r0 080B11B8: 491A ldr r1, =#0xFFFFFC00 080B11BA: 468C mov r12, r1 080B11BC: 263F mov r6, #0x3F 080B11BE: 8859 ldrh r1, [r3, #0x02] ; ? 080B11C0: 4648 mov r0, r9 ; Transfer AND-Mask in r0 080B11C2: 4008 and r0, r1 ; AND #$FE00 080B11C4: 4328 orr r0, r5 ; ? 080B11C6: 8058 strh r0, [r3, #0x02] ; Store back 080B11C8: 00E0 lsl r0, r4, #0x3 080B11CA: 4440 add r0, r8 080B11CC: 7018 strb r0, [r3] 080B11CE: 0061 lsl r1, r4, #0x1 080B11D0: 1879 add r1, r7, r1 080B11D2: 4A15 ldr r2, =#0x000003FF 080B11D4: 1C10 add r0, r2, #0x0 080B11D6: 4001 and r1, r0 080B11D8: 889A ldrh r2, [r3, #0x04] 080B11DA: 4660 mov r0, r12 080B11DC: 4010 and r0, r2 080B11DE: 4308 orr r0, r1 080B11E0: 8098 strh r0, [r3, #0x04] 080B11E2: 7959 ldrb r1, [r3, #0x05] 080B11E4: 200F mov r0, #0x0F 080B11E6: 4008 and r0, r1 080B11E8: 2170 mov r1, #0x70 080B11EA: 4308 orr r0, r1 080B11EC: 7158 strb r0, [r3, #0x05] 080B11EE: 7859 ldrb r1, [r3, #0x01] 080B11F0: 1C30 add r0, r6, #0x0 080B11F2: 4008 and r0, r1 080B11F4: 2140 mov r1, #0x40 080B11F6: 4308 orr r0, r1 080B11F8: 7058 strb r0, [r3, #0x01] 080B11FA: 78D9 ldrb r1, [r3, #0x03] 080B11FC: 1C30 add r0, r6, #0x0 080B11FE: 4008 and r0, r1 080B1200: 70D8 strb r0, [r3, #0x03] 080B1202: 1C60 add r0, r4, #0x1 ; Increment Loop Counter 080B1204: 0400 lsl r0, r0, #0x10 ; Loop Counter AND #$0000FFFF 080B1206: 0C04 lsr r4, r0, #0x10 080B1208: 3308 add r3, #0x08 080B120A: 2C01 cmp r4, #0x01 080B120C: D9D7 bls 0x080B11BE ; Loop until r4 = #$01 080B120E: BC18 pop {r3, r4} 080B1210: 4698 mov r8, r3 080B1212: 46A1 mov r9, r4 080B1214: BCF0 pop {r4, r5, r6, r7} 080B1216: BC01 pop {r0} 080B1218: 4700 bx r0 ;080B121A: 0000 lsl r0, r0, #0x0 ;080B121C: 01FF lsl r7, r7, #0x7 ;080B121E: 0000 lsl r0, r0, #0x0 ;080B1220: FE00 bl 0x080B1E22 ;080B1222: FFFF bl 0x07EB2222 ;080B1224: FC00 bl 0x080B0A26 ;080B1226: FFFF bl 0x07CB2226 ;080B1228: 03FF lsl r7, r7, #0xF ;080B122A: 0000 lsl r0, r0, #0x0
$080B1A4C - ?
080B1A4C: B510 push {r4, lr} 080B1A4E: 1C04 add r4, r0, #0x0 ; r4 = Orig. r0 080B1A50: 2001 mov r0, #0x01 080B1A52: F00B bl 080B1A54: FE17 bl 0x080BD684 ; ? 080B1A56: 88A2 ldrh r2, [r4, #0x04] ; r2 = [Orig. r0 + #$04] 080B1A58: 4B12 ldr r3, =#0x000001FF 080B1A5A: 1C19 add r1, r3, #0x0 080B1A5C: 400A and r2, r1 ; r2 = Bits 0 to 8 of [Orig. r0 + #$04] 080B1A5E: 8843 ldrh r3, [r0, #0x02] ; ? 080B1A60: 4911 ldr r1, =#0xFFFFFE00 080B1A62: 4019 and r1, r3 ; r1 = Bits 9 to 31 of ? 080B1A64: 4311 orr r1, r2 ; Add both to each other 080B1A66: 8041 strh r1, [r0, #0x02] ; Store back at ? 080B1A68: 88E1 ldrh r1, [r4, #0x06] 080B1A6A: 7001 strb r1, [r0] ; ? = [Orig. r0 + #$06] 080B1A6C: 8821 ldrh r1, [r4] ; r2 = [Orig. r0] 080B1A6E: 4A0F ldr r2, =#0x000003FF 080B1A70: 400A and r2, r1 ; r2 = Bits 0 to 9 of [Orig. r0] 080B1A72: 8883 ldrh r3, [r0, #0x04] ; ? 080B1A74: 490E ldr r1, =#0xFFFFFC00 080B1A76: 4019 and r1, r3 ; r1 = Bits 10 to 31 of ? 080B1A78: 4311 orr r1, r2 ; Add both to each other 080B1A7A: 8081 strh r1, [r0, #0x04] ; Store back at ? 080B1A7C: 78A2 ldrb r2, [r4, #0x02] 080B1A7E: 0112 lsl r2, r2, #0x4 080B1A80: 7943 ldrb r3, [r0, #0x05] ; ? 080B1A82: 210F mov r1, #0x0F 080B1A84: 4019 and r1, r3 080B1A86: 4311 orr r1, r2 080B1A88: 7141 strb r1, [r0, #0x05] 080B1A8A: 7843 ldrb r3, [r0, #0x01] 080B1A8C: 223F mov r2, #0x3F 080B1A8E: 1C11 add r1, r2, #0x0 080B1A90: 4019 and r1, r3 080B1A92: 7041 strb r1, [r0, #0x01] 080B1A94: 78C1 ldrb r1, [r0, #0x03] 080B1A96: 400A and r2, r1 080B1A98: 2140 mov r1, #0x40 080B1A9A: 430A orr r2, r1 080B1A9C: 70C2 strb r2, [r0, #0x03] 080B1A9E: BC10 pop {r4} 080B1AA0: BC01 pop {r0} 080B1AA2: 4700 bx r0 ;080B1AA4: 01FF lsl r7, r7, #0x7 ;080B1AA6: 0000 lsl r0, r0, #0x0 ;080B1AA8: FE00 bl 0x080B26AA ;080B1AAA: FFFF bl 0x07EB2AAA ;080B1AAC: 03FF lsl r7, r7, #0xF ;080B1AAE: 0000 lsl r0, r0, #0x0 ;080B1AB0: FC00 bl 0x080B22B2 ;080B1AB2: FFFF bl 0x07CB2AB2
$080B1EDC - ?
080B1EDC: B510 push {r4, lr} 080B1EDE: B082 add sp, #-0x008 080B1EE0: 1C04 add r4, r0, #0x0 080B1EE2: 0409 lsl r1, r1, #0x10 080B1EE4: 0C08 lsr r0, r1, #0x10 080B1EE6: 280F cmp r0, #0x0F 080B1EE8: D81E bhi 0x080B1F28 080B1EEA: 0102 lsl r2, r0, #0x4 080B1EEC: 480B ldr r0, =#0x0203632C 080B1EEE: 1812 add r2, r2, r0 080B1EF0: 8893 ldrh r3, [r2, #0x04] 080B1EF2: 480B ldr r0, =#0xFFFF0000 080B1EF4: 9900 ldr r1, [sp] 080B1EF6: 4001 and r1, r0 080B1EF8: 4319 orr r1, r3 080B1EFA: 9100 str r1, [sp] 080B1EFC: 88D2 ldrh r2, [r2, #0x06] 080B1EFE: 0412 lsl r2, r2, #0x10 080B1F00: 4808 ldr r0, =#0x0000FFFF 080B1F02: 4008 and r0, r1 080B1F04: 4310 orr r0, r2 080B1F06: 9000 str r0, [sp] 080B1F08: 4669 mov r1, sp 080B1F0A: 8820 ldrh r0, [r4] 080B1F0C: 8088 strh r0, [r1, #0x04] 080B1F0E: 8860 ldrh r0, [r4, #0x02] 080B1F10: 80C8 strh r0, [r1, #0x06] 080B1F12: 4668 mov r0, sp 080B1F14: F7FF bl 080B1F16: FD9A bl 0x080B1A4C 080B1F18: E00E b 0x080B1F38 ;080B1F1A: 0000 lsl r0, r0, #0x0 ;080B1F1C: 632C str r4, [r5, #0x30] ;080B1F1E: 0203 lsl r3, r0, #0x8 ;080B1F20: 0000 lsl r0, r0, #0x0 ;080B1F22: FFFF bl 0x080B2F22 ;080B1F24: FFFF bl 0x080B1F24 ;080B1F26: 0000 lsl r0, r0, #0x0 080B1F28: 4905 ldr r1, =#0x0000FFF1 080B1F2A: 1840 add r0, r0, r1 080B1F2C: 0400 lsl r0, r0, #0x10 080B1F2E: 0C00 lsr r0, r0, #0x10 080B1F30: 8821 ldrh r1, [r4] 080B1F32: 8862 ldrh r2, [r4, #0x02] 080B1F34: F7FF bl 080B1F36: F924 bl 0x080B1180 080B1F38: B002 add sp, #0x008 080B1F3A: BC10 pop {r4} 080B1F3C: BC01 pop {r0} 080B1F3E: 4700 bx r0 ;080B1F40: FFF1 bl 0x07FB2F24 ;080B1F42: 0000 lsl r0, r0, #0x0
$080B2E48 - ?
This subroutine is called from the following subroutine and has the following register address in r0
- $0809CA14 (r0 = #$02032714)
- $0809CB84 (r0 = ?)
- $080A41F0 (r0 = ?)
- $080A6E3C (r0 = ?)
- $080B7F00 (r0 = ?)
I just presume that it is always $02032714
080B2E48: B5F0 push {r4, r5, r6, r7, lr} 080B2E4A: B084 add sp, #-0x010 080B2E4C: 1C06 add r6, r0, #0x0 ; r6 = Orig. r0 080B2E4E: 480A ldr r0, =#0x00003AD6 080B2E50: 1832 add r2, r6, r0 ; r2 = #$020361EA (Orig. r0 + #$3AD6) 080B2E52: 7811 ldrb r1, [r2] ; r1 = $020361EA 080B2E54: 2008 mov r0, #0x08 080B2E56: 4008 and r0, r1 080B2E58: 0600 lsl r0, r0, #0x18 080B2E5A: 0E07 lsr r7, r0, #0x18 080B2E5C: 2F00 cmp r7, #0x00 080B2E5E: D163 bne 0x080B2F28 ; Branch if Bit 7 of $020361EA is set 080B2E60: 2008 mov r0, #0x08 080B2E62: 4308 orr r0, r1 080B2E64: 7010 strb r0, [r2] ; Set Bit 7 of $020361EA 080B2E66: 4905 ldr r1, =#0x00003AD0 080B2E68: 1870 add r0, r6, r1 ; $020361E4 080B2E6A: 7800 ldrb r0, [r0] 080B2E6C: 2809 cmp r0, #0x09 080B2E6E: D009 beq 0x080B2E84 080B2E70: 280A cmp r0, #0x0A 080B2E72: D023 beq 0x080B2EBC 080B2E74: 4802 ldr r0, =#0x020361AC 080B2E76: E022 b 0x080B2EBE ;080B2E78: 3AD6 sub r2, #0xD6 ;080B2E7A: 0000 lsl r0, r0, #0x0 ;080B2E7C: 3AD0 sub r2, #0xD0 ;080B2E7E: 0000 lsl r0, r0, #0x0 ;080B2E80: 61AC str r4, [r5, #0x18] ;080B2E82: 0203 lsl r3, r0, #0x8 080B2E84: 4D0C ldr r5, =#0xFFFF0000 080B2E86: 9800 ldr r0, [sp] 080B2E88: 4028 and r0, r5 080B2E8A: 9000 str r0, [sp] 080B2E8C: 4669 mov r1, sp 080B2E8E: 2430 mov r4, #0x30 080B2E90: 804C strh r4, [r1, #0x02] 080B2E92: 20F0 mov r0, #0xF0 080B2E94: 8088 strh r0, [r1, #0x04] 080B2E96: 2070 mov r0, #0x70 080B2E98: 80C8 strh r0, [r1, #0x06] 080B2E9A: 4668 mov r0, sp 080B2E9C: 2101 mov r1, #0x01 080B2E9E: 2200 mov r2, #0x00 080B2EA0: F002 bl 080B2EA2: FC0E bl 0x080B56C0 080B2EA4: 9802 ldr r0, [sp, #0x008] 080B2EA6: 4028 and r0, r5 080B2EA8: 4320 orr r0, r4 080B2EAA: 9002 str r0, [sp, #0x008] 080B2EAC: A802 add r0, sp, #0x008 080B2EAE: 8047 strh r7, [r0, #0x02] 080B2EB0: 21C0 mov r1, #0xC0 080B2EB2: 8081 strh r1, [r0, #0x04] 080B2EB4: 80C4 strh r4, [r0, #0x06] 080B2EB6: E002 b 0x080B2EBE ;080B2EB8: 0000 lsl r0, r0, #0x0 ;080B2EBA: FFFF bl 0x080B3EBA 080B2EBC: 480E ldr r0, =#0x0203619C 080B2EBE: 2101 mov r1, #0x01 080B2EC0: 2200 mov r2, #0x00 080B2EC2: F002 bl 080B2EC4: FBFD bl 0x080B56C0 080B2EC6: F001 bl 080B2EC8: FDF1 bl 0x080B4AAC 080B2ECA: 4A0C ldr r2, =#0x000037C4 080B2ECC: 18B0 add r0, r6, r2 080B2ECE: 7801 ldrb r1, [r0] 080B2ED0: 2001 mov r0, #0x01 080B2ED2: 4008 and r0, r1 080B2ED4: 2800 cmp r0, #0x00 080B2ED6: D017 beq 0x080B2F08 080B2ED8: 4809 ldr r0, =#0x000037BC 080B2EDA: 1832 add r2, r6, r0 080B2EDC: 8810 ldrh r0, [r2] 080B2EDE: 280B cmp r0, #0x0B 080B2EE0: D822 bhi 0x080B2F28 080B2EE2: 4908 ldr r1, =#0x08699930 080B2EE4: 0080 lsl r0, r0, #0x2 080B2EE6: 1840 add r0, r0, r1 080B2EE8: 22A8 mov r2, #0xA8 080B2EEA: 0092 lsl r2, r2, #0x2 080B2EEC: 18B1 add r1, r6, r2 080B2EEE: 6802 ldr r2, [r0] 080B2EF0: 1C30 add r0, r6, #0x0 080B2EF2: F00D bl 080B2EF4: FB3B bl 0x080C056C ; bx r2 080B2EF6: E017 b 0x080B2F28 ;080B2EF8: 619C str r4, [r3, #0x18] ;080B2EFA: 0203 lsl r3, r0, #0x8 ;080B2EFC: 37C4 add r7, #0xC4 ;080B2EFE: 0000 lsl r0, r0, #0x0 ;080B2F00: 37BC add r7, #0xBC ;080B2F02: 0000 lsl r0, r0, #0x0 ;080B2F04: 9930 ldr r1, [sp, #0x0C0] ;080B2F06: 0869 lsr r1, r5, #0x1 080B2F08: 4809 ldr r0, =#0x00003AD0 080B2F0A: 1832 add r2, r6, r0 080B2F0C: 7810 ldrb r0, [r2] 080B2F0E: 280D cmp r0, #0x0D 080B2F10: D80A bhi 0x080B2F28 080B2F12: 4908 ldr r1, =#0x0869988C 080B2F14: 0082 lsl r2, r0, #0x2 080B2F16: 1852 add r2, r2, r1 080B2F18: 0041 lsl r1, r0, #0x1 080B2F1A: 1809 add r1, r1, r0 080B2F1C: 0109 lsl r1, r1, #0x4 080B2F1E: 1871 add r1, r6, r1 080B2F20: 6812 ldr r2, [r2] 080B2F22: 1C30 add r0, r6, #0x0 080B2F24: F00D bl 080B2F26: FB22 bl 0x080C056C ; bx r2 080B2F28: B004 add sp, #0x010 080B2F2A: BCF0 pop {r4, r5, r6, r7} 080B2F2C: BC01 pop {r0} 080B2F2E: 4700 bx r0 ;080B2F30: 3AD0 sub r2, #0xD0 ;080B2F32: 0000 lsl r0, r0, #0x0 ;080B2F34: 988C ldr r0, [sp, #0x230] ;080B2F36: 0869 lsr r1, r5, #0x1
$080B52C8 - ?
080B52C8: B510 push {r4, lr} 080B52CA: 1C04 add r4, r0, #0x0 ; r4 = Orig. r0 080B52CC: 4813 ldr r0, =#0x00003826 080B52CE: 1822 add r2, r4, r0 080B52D0: 7811 ldrb r1, [r2] ; r1 = [Orig. r0 + #$3826] 080B52D2: 2001 mov r0, #0x01 080B52D4: 4008 and r0, r1 080B52D6: 2800 cmp r0, #0x00 080B52D8: D01C beq 0x080B5314 ; Exit if Bit 0 of [Orig. r0 + #$3826] is clear 080B52DA: 2002 mov r0, #0x02 080B52DC: 4008 and r0, r1 080B52DE: 2800 cmp r0, #0x00 080B52E0: D10F bne 0x080B5302 ; Branch if Bit 1 of [Orig. r0 + #$3826] is set 080B52E2: 2002 mov r0, #0x02 080B52E4: 4308 orr r0, r1 ; Set Bit 1 of [Orig. r0 + #$3826] 080B52E6: 7010 strb r0, [r2] ; Store value back 080B52E8: 490D ldr r1, =#0x00003A88 080B52EA: 1860 add r0, r4, r1 ; r0 = Orig. r0 + #$3A88 080B52EC: 2100 mov r1, #0x00 080B52EE: 2200 mov r2, #0x00 080B52F0: F000 bl 080B52F2: F9E6 bl 0x080B56C0 ; ? 080B52F4: 4B0B ldr r3, =#0x00003AB0 080B52F6: 18E0 add r0, r4, r3 ; r0 = Orig. r0 + #$3AB0 080B52F8: 2100 mov r1, #0x00 080B52FA: 2200 mov r2, #0x00 080B52FC: 2301 mov r3, #0x01 080B52FE: F000 bl 080B5300: F815 bl 0x080B532C ; ? 080B5302: 4809 ldr r0, =#0x02032700 080B5304: 6801 ldr r1, [r0] ; r1 = [$02032700] 080B5306: 890A ldrh r2, [r1, #0x08] ; r2 = [ [$02032700] + #$08] 080B5308: 2380 mov r3, #0x80 080B530A: 005B lsl r3, r3, #0x1 080B530C: 1C18 add r0, r3, #0x0 ; r0 = #$0100 080B530E: 890B ldrh r3, [r1, #0x08] ; r3 = [ [$02032700] + #$08] 080B5310: 4310 orr r0, r2 ; Set Bit 8 in the value of [ [$02032700] + #$08] 080B5312: 8108 strh r0, [r1, #0x08] ; Store value back 080B5314: BC10 pop {r4} 080B5316: BC01 pop {r0} 080B5318: 4700 bx r0 ;080B531A: 0000 lsl r0, r0, #0x0 ;080B531C: 3826 sub r0, #0x26 ;080B531E: 0000 lsl r0, r0, #0x0 ;080B5320: 3A88 sub r2, #0x88 ;080B5322: 0000 lsl r0, r0, #0x0 ;080B5324: 3AB0 sub r2, #0xB0 ;080B5326: 0000 lsl r0, r0, #0x0 ;080B5328: 2700 mov r7, #0x00 ;080B532A: 0203 lsl r3, r0, #0x8
$080B5494 - ?
080B5494: B5F0 push {r4, r5, r6, r7, lr} 080B5496: 4647 mov r7, r8 080B5498: B480 push {r7} 080B549A: B082 add sp, #-0x008 ; Added two new stack entries 080B549C: 1C0E add r6, r1, #0x0 ; r6 = Orig. r1 080B549E: 0412 lsl r2, r2, #0x10 080B54A0: 0C17 lsr r7, r2, #0x10 ; r7 = Orig. r2 AND #$0000FFFF 080B54A2: 041B lsl r3, r3, #0x10 080B54A4: 0C1B lsr r3, r3, #0x10 ; r3 = Orig. r3 AND #$0000FFFF 080B54A6: 4698 mov r8, r3 ; r8 = Orig. r2 AND #$0000FFFF 080B54A8: 8802 ldrh r2, [r0] 080B54AA: 08D2 lsr r2, r2, #0x3 080B54AC: 4B54 ldr r3, =#0xFFFF0000 080B54AE: 9900 ldr r1, [sp] 080B54B0: 4019 and r1, r3 080B54B2: 4311 orr r1, r2 080B54B4: 9100 str r1, [sp] 080B54B6: 8841 ldrh r1, [r0, #0x02] 080B54B8: 08C9 lsr r1, r1, #0x3 080B54BA: 466C mov r4, sp 080B54BC: 8061 strh r1, [r4, #0x02] 080B54BE: 8881 ldrh r1, [r0, #0x04] 080B54C0: 08C9 lsr r1, r1, #0x3 080B54C2: 80A1 strh r1, [r4, #0x04] 080B54C4: 88C0 ldrh r0, [r0, #0x06] 080B54C6: 08C0 lsr r0, r0, #0x3 080B54C8: 80E0 strh r0, [r4, #0x06] 080B54CA: 4668 mov r0, sp 080B54CC: 8801 ldrh r1, [r0] 080B54CE: 3101 add r1, #0x01 080B54D0: 8862 ldrh r2, [r4, #0x02] 080B54D2: 0409 lsl r1, r1, #0x10 080B54D4: 0C09 lsr r1, r1, #0x10 080B54D6: 1C38 add r0, r7, #0x0 080B54D8: F008 bl 080B54DA: F882 bl 0x080BD5E0 080B54DC: 1C02 add r2, r0, #0x0 080B54DE: 2300 mov r3, #0x00 080B54E0: 88A0 ldrh r0, [r4, #0x04] 080B54E2: 3802 sub r0, #0x02 080B54E4: 4283 cmp r3, r0 080B54E6: DA11 bge 0x080B550C 080B54E8: 4640 mov r0, r8 080B54EA: 0305 lsl r5, r0, #0xC 080B54EC: 466C mov r4, sp 080B54EE: 8871 ldrh r1, [r6, #0x02] 080B54F0: 1C28 add r0, r5, #0x0 080B54F2: 4308 orr r0, r1 080B54F4: 8010 strh r0, [r2] 080B54F6: 0419 lsl r1, r3, #0x10 080B54F8: 2080 mov r0, #0x80 080B54FA: 0240 lsl r0, r0, #0x9 080B54FC: 1809 add r1, r1, r0 080B54FE: 3202 add r2, #0x02 080B5500: 0C0B lsr r3, r1, #0x10 080B5502: 1409 asr r1, r1, #0x10 080B5504: 88A0 ldrh r0, [r4, #0x04] 080B5506: 3802 sub r0, #0x02 080B5508: 4281 cmp r1, r0 080B550A: DBF0 blt 0x080B54EE 080B550C: 4668 mov r0, sp 080B550E: 8801 ldrh r1, [r0] 080B5510: 3101 add r1, #0x01 080B5512: 466C mov r4, sp 080B5514: 4A3B ldr r2, =#0x0000FFFF 080B5516: 1C10 add r0, r2, #0x0 080B5518: 88E2 ldrh r2, [r4, #0x06] 080B551A: 1880 add r0, r0, r2 080B551C: 8862 ldrh r2, [r4, #0x02] 080B551E: 1812 add r2, r2, r0 080B5520: 0409 lsl r1, r1, #0x10 080B5522: 0C09 lsr r1, r1, #0x10 080B5524: 0412 lsl r2, r2, #0x10 080B5526: 0C12 lsr r2, r2, #0x10 080B5528: 1C38 add r0, r7, #0x0 080B552A: F008 bl 080B552C: F859 bl 0x080BD5E0 080B552E: 1C02 add r2, r0, #0x0 080B5530: 2300 mov r3, #0x00 080B5532: 88A0 ldrh r0, [r4, #0x04] 080B5534: 3802 sub r0, #0x02 080B5536: 4283 cmp r3, r0 080B5538: DA11 bge 0x080B555E 080B553A: 4640 mov r0, r8 080B553C: 0305 lsl r5, r0, #0xC 080B553E: 466C mov r4, sp 080B5540: 89F1 ldrh r1, [r6, #0x0E] 080B5542: 1C28 add r0, r5, #0x0 080B5544: 4308 orr r0, r1 080B5546: 8010 strh r0, [r2] 080B5548: 0419 lsl r1, r3, #0x10 080B554A: 2080 mov r0, #0x80 080B554C: 0240 lsl r0, r0, #0x9 080B554E: 1809 add r1, r1, r0 080B5550: 3202 add r2, #0x02 080B5552: 0C0B lsr r3, r1, #0x10 080B5554: 1409 asr r1, r1, #0x10 080B5556: 88A0 ldrh r0, [r4, #0x04] 080B5558: 3802 sub r0, #0x02 080B555A: 4281 cmp r1, r0 080B555C: DBF0 blt 0x080B5540 080B555E: 4668 mov r0, sp 080B5560: 466C mov r4, sp 080B5562: 8862 ldrh r2, [r4, #0x02] 080B5564: 3201 add r2, #0x01 080B5566: 8801 ldrh r1, [r0] 080B5568: 0412 lsl r2, r2, #0x10 080B556A: 0C12 lsr r2, r2, #0x10 080B556C: 1C38 add r0, r7, #0x0 080B556E: F008 bl 080B5570: F837 bl 0x080BD5E0 080B5572: 1C02 add r2, r0, #0x0 080B5574: 2300 mov r3, #0x00 080B5576: 88E0 ldrh r0, [r4, #0x06] 080B5578: 3802 sub r0, #0x02 080B557A: 4283 cmp r3, r0 080B557C: DA11 bge 0x080B55A2 080B557E: 4641 mov r1, r8 080B5580: 030D lsl r5, r1, #0xC 080B5582: 466C mov r4, sp 080B5584: 88F1 ldrh r1, [r6, #0x06] 080B5586: 1C28 add r0, r5, #0x0 080B5588: 4308 orr r0, r1 080B558A: 8010 strh r0, [r2] 080B558C: 0419 lsl r1, r3, #0x10 080B558E: 2080 mov r0, #0x80 080B5590: 0240 lsl r0, r0, #0x9 080B5592: 1809 add r1, r1, r0 080B5594: 323C add r2, #0x3C 080B5596: 0C0B lsr r3, r1, #0x10 080B5598: 1409 asr r1, r1, #0x10 080B559A: 88E0 ldrh r0, [r4, #0x06] 080B559C: 3802 sub r0, #0x02 080B559E: 4281 cmp r1, r0 080B55A0: DBF0 blt 0x080B5584 080B55A2: 466C mov r4, sp 080B55A4: 4917 ldr r1, =#0x0000FFFF 080B55A6: 1C08 add r0, r1, #0x0 080B55A8: 88A2 ldrh r2, [r4, #0x04] 080B55AA: 1880 add r0, r0, r2 080B55AC: 4669 mov r1, sp 080B55AE: 8809 ldrh r1, [r1] 080B55B0: 1809 add r1, r1, r0 080B55B2: 8862 ldrh r2, [r4, #0x02] 080B55B4: 3201 add r2, #0x01 080B55B6: 0409 lsl r1, r1, #0x10 080B55B8: 0C09 lsr r1, r1, #0x10 080B55BA: 0412 lsl r2, r2, #0x10 080B55BC: 0C12 lsr r2, r2, #0x10 080B55BE: 1C38 add r0, r7, #0x0 080B55C0: F008 bl 080B55C2: F80E bl 0x080BD5E0 080B55C4: 1C02 add r2, r0, #0x0 080B55C6: 2300 mov r3, #0x00 080B55C8: 88E0 ldrh r0, [r4, #0x06] 080B55CA: 3802 sub r0, #0x02 080B55CC: 4283 cmp r3, r0 080B55CE: DA11 bge 0x080B55F4 080B55D0: 4640 mov r0, r8 080B55D2: 0305 lsl r5, r0, #0xC 080B55D4: 466C mov r4, sp 080B55D6: 8971 ldrh r1, [r6, #0x0A] 080B55D8: 1C28 add r0, r5, #0x0 080B55DA: 4308 orr r0, r1 080B55DC: 8010 strh r0, [r2] 080B55DE: 0419 lsl r1, r3, #0x10 080B55E0: 2080 mov r0, #0x80 080B55E2: 0240 lsl r0, r0, #0x9 080B55E4: 1809 add r1, r1, r0 080B55E6: 323C add r2, #0x3C 080B55E8: 0C0B lsr r3, r1, #0x10 080B55EA: 1409 asr r1, r1, #0x10 080B55EC: 88E0 ldrh r0, [r4, #0x06] 080B55EE: 3802 sub r0, #0x02 080B55F0: 4281 cmp r1, r0 080B55F2: DBF0 blt 0x080B55D6 080B55F4: B002 add sp, #0x008 080B55F6: BC08 pop {r3} 080B55F8: 4698 mov r8, r3 080B55FA: BCF0 pop {r4, r5, r6, r7} 080B55FC: BC01 pop {r0} 080B55FE: 4700 bx r0 ;080B5600: 0000 lsl r0, r0, #0x0 ;080B5602: FFFF bl 0x080B6602 ;080B5604: FFFF bl 0x080B5604 ;080B5606: 0000 lsl r0, r0, #0x0
$080B6388 - ?
r0 contains a load address, a source address for small DMAs (#$10 and #$20 double bytes)
r1 and r2 contain the destination addresses for Clear DMAs (each #$30 Double Bytes)
r3 contains an comparison value
080B6388: B570 push {r4, r5, r6, lr} 080B638A: B081 add sp, #-0x004 ; Manually add another stack entry 080B638C: 4684 mov r12, r0 080B638E: 1C0C add r4, r1, #0x0 080B6390: 1C15 add r5, r2, #0x0 080B6392: 041B lsl r3, r3, #0x10 080B6394: 0C1E lsr r6, r3, #0x10 080B6396: 4669 mov r1, sp 080B6398: 2000 mov r0, #0x00 080B639A: 8008 strh r0, [r1] ; Clear newly add Stack Entry 080B639C: 4826 ldr r0, =#0x040000D4 080B639E: 6001 str r1, [r0] ; Stack Entry is DMA Source (for a fixed Transfer) 080B63A0: 6044 str r4, [r0, #0x04] ; Original r1 is the Destination address 080B63A2: 4926 ldr r1, =#0x81000030 080B63A4: 6081 str r1, [r0, #0x08] ; Start DMA 080B63A6: 6881 ldr r1, [r0, #0x08] ; Check if DMA is done 080B63A8: 1C02 add r2, r0, #0x0 080B63AA: 6890 ldr r0, [r2, #0x08] 080B63AC: 2180 mov r1, #0x80 080B63AE: 0609 lsl r1, r1, #0x18 080B63B0: 2800 cmp r0, #0x00 080B63B2: DA03 bge 0x080B63BC 080B63B4: 6890 ldr r0, [r2, #0x08] 080B63B6: 4008 and r0, r1 080B63B8: 2800 cmp r0, #0x00 080B63BA: D1FB bne 0x080B63B4 080B63BC: 4669 mov r1, sp 080B63BE: 2000 mov r0, #0x00 080B63C0: 8008 strh r0, [r1] ; Clear newy added Stack Entry again 080B63C2: 481D ldr r0, =#0x040000D4 080B63C4: 6001 str r1, [r0] ; Stack Entry is DMA Source (for a fixed Transfer) 080B63C6: 6045 str r5, [r0, #0x04] ; Original r2 is the Destination address 080B63C8: 491C ldr r1, =#0x81000030 ; Fixed DMA, #$30 Double Bytes 080B63CA: 6081 str r1, [r0, #0x08] ; Start DMA 080B63CC: 6881 ldr r1, [r0, #0x08] 080B63CE: 1C01 add r1, r0, #0x0 080B63D0: 6888 ldr r0, [r1, #0x08] 080B63D2: 2280 mov r2, #0x80 080B63D4: 0612 lsl r2, r2, #0x18 080B63D6: 4663 mov r3, r12 ; restore Original r0 in r3 080B63D8: 33C0 add r3, #0xC0 ; Increment address in r3 by #$C0 080B63DA: 2800 cmp r0, #0x00 080B63DC: DA03 bge 0x080B63E6 080B63DE: 6888 ldr r0, [r1, #0x08] 080B63E0: 4010 and r0, r2 080B63E2: 2800 cmp r0, #0x00 080B63E4: D1FB bne 0x080B63DE 080B63E6: 8819 ldrh r1, [r3] ; ? 080B63E8: 1C48 add r0, r1, #0x1 ; r0 = INC r1 080B63EA: 42B0 cmp r0, r6 ; Compare r0 to the Original r3 080B63EC: D12A bne 0x080B6444 ; Leave the whole stuff out if values are the same 080B63EE: 4912 ldr r1, =#0x040000D4 080B63F0: 4660 mov r0, r12 080B63F2: 3020 add r0, #0x20 080B63F4: 6008 str r0, [r1] 080B63F6: 604C str r4, [r1, #0x04] 080B63F8: 4811 ldr r0, =#0x80000020 080B63FA: 6088 str r0, [r1, #0x08] 080B63FC: 6888 ldr r0, [r1, #0x08] 080B63FE: 6888 ldr r0, [r1, #0x08] 080B6400: 2380 mov r3, #0x80 080B6402: 061B lsl r3, r3, #0x18 080B6404: 4662 mov r2, r12 080B6406: 3280 add r2, #0x80 080B6408: 2800 cmp r0, #0x00 080B640A: DA03 bge 0x080B6414 080B640C: 6888 ldr r0, [r1, #0x08] 080B640E: 4018 and r0, r3 080B6410: 2800 cmp r0, #0x00 080B6412: D1FB bne 0x080B640C 080B6414: 4808 ldr r0, =#0x040000D4 080B6416: 6002 str r2, [r0] 080B6418: 6045 str r5, [r0, #0x04] 080B641A: 4909 ldr r1, =#0x80000020 080B641C: 6081 str r1, [r0, #0x08] 080B641E: 6881 ldr r1, [r0, #0x08] 080B6420: 1C02 add r2, r0, #0x0 080B6422: 6890 ldr r0, [r2, #0x08] 080B6424: 2180 mov r1, #0x80 080B6426: 0609 lsl r1, r1, #0x18 080B6428: 2800 cmp r0, #0x00 080B642A: DA31 bge 0x080B6490 080B642C: 6890 ldr r0, [r2, #0x08] 080B642E: 4008 and r0, r1 080B6430: 2800 cmp r0, #0x00 080B6432: D1FB bne 0x080B642C 080B6434: E02C b 0x080B6490 ;DATA ;============ ;080B6436: 0000 lsl r0, r0, #0x0 ;080B6438: 00D4 lsl r4, r2, #0x3 ;080B643A: 0400 lsl r0, r0, #0x10 ;080B643C: 0030 lsl r0, r6, #0x0 ;080B643E: 8100 strh r0, [r0, #0x08] ;080B6440: 0020 lsl r0, r4, #0x0 ;080B6442: 8000 strh r0, [r0] 080B6444: 1C88 add r0, r1, #0x2 ; r0 = Double INC r1 080B6446: 42B0 cmp r0, r6 080B6448: D122 bne 0x080B6490 ; Exit if equal 080B644A: 4913 ldr r1, =#0x040000D4 080B644C: 4660 mov r0, r12 080B644E: 3040 add r0, #0x40 080B6450: 6008 str r0, [r1] 080B6452: 604C str r4, [r1, #0x04] 080B6454: 4811 ldr r0, =#0x80000010 ; #$10 Double Bytes 080B6456: 6088 str r0, [r1, #0x08] ; Start DMA 080B6458: 6888 ldr r0, [r1, #0x08] 080B645A: 6888 ldr r0, [r1, #0x08] 080B645C: 2380 mov r3, #0x80 080B645E: 061B lsl r3, r3, #0x18 080B6460: 4662 mov r2, r12 080B6462: 32A0 add r2, #0xA0 080B6464: 2800 cmp r0, #0x00 080B6466: DA03 bge 0x080B6470 080B6468: 6888 ldr r0, [r1, #0x08] 080B646A: 4018 and r0, r3 080B646C: 2800 cmp r0, #0x00 080B646E: D1FB bne 0x080B6468 080B6470: 4809 ldr r0, =#0x040000D4 080B6472: 6002 str r2, [r0] 080B6474: 6045 str r5, [r0, #0x04] 080B6476: 4909 ldr r1, =#0x80000010 080B6478: 6081 str r1, [r0, #0x08] 080B647A: 6881 ldr r1, [r0, #0x08] 080B647C: 1C02 add r2, r0, #0x0 080B647E: 6890 ldr r0, [r2, #0x08] 080B6480: 2180 mov r1, #0x80 080B6482: 0609 lsl r1, r1, #0x18 080B6484: 2800 cmp r0, #0x00 080B6486: DA03 bge 0x080B6490 080B6488: 6890 ldr r0, [r2, #0x08] 080B648A: 4008 and r0, r1 080B648C: 2800 cmp r0, #0x00 080B648E: D1FB bne 0x080B6488 080B6490: B001 add sp, #0x004 080B6492: BC70 pop {r4, r5, r6} 080B6494: BC01 pop {r0} 080B6496: 4700 bx r0 ;080B6498: 00D4 lsl r4, r2, #0x3 ;080B649A: 0400 lsl r0, r0, #0x10 ;080B649C: 0010 lsl r0, r2, #0x0 ;080B649E: 8000 strh r0, [r0]
$080B64D0 - ?
080B64D0: B5F0 push {r4, r5, r6, r7, lr} 080B64D2: 4657 mov r7, r10 080B64D4: 464E mov r6, r9 080B64D6: 4645 mov r5, r8 080B64D8: B4E0 push {r5, r6, r7} 080B64DA: B095 add sp, #-0x054 080B64DC: 9004 str r0, [sp, #0x010] 080B64DE: 4A0A ldr r2, =#0x000050C7 080B64E0: 1881 add r1, r0, r2 ; r1 = Orig. r0 + #$50C7 080B64E2: 2000 mov r0, #0x00 080B64E4: 7008 strb r0, [r1] ; Orig. r0 + #$50C7 = #$00 080B64E6: 9B04 ldr r3, [sp, #0x010] ; r3 = Orig. r0 080B64E8: 4E08 ldr r6, =#0x00004694 080B64EA: 1998 add r0, r3, r6 080B64EC: 6800 ldr r0, [r0] ; r0 = Orig. r0 + #$4694 080B64EE: 6841 ldr r1, [r0, #0x04] 080B64F0: 468A mov r10, r1 080B64F2: 4A07 ldr r2, =#0x00001BD0 080B64F4: 189B add r3, r3, r2 080B64F6: 4698 mov r8, r3 080B64F8: 4B06 ldr r3, =#0x06015800 080B64FA: 9305 str r3, [sp, #0x014] 080B64FC: 26B0 mov r6, #0xB0 080B64FE: 00B6 lsl r6, r6, #0x2 080B6500: 9608 str r6, [sp, #0x020] 080B6502: 2400 mov r4, #0x00 080B6504: E1AD b 0x080B6862 ;080B6506: 0000 lsl r0, r0, #0x0 ;080B6508: 50C7 str r7, [r0, r3] ;080B650A: 0000 lsl r0, r0, #0x0 ;080B650C: 4694 mov r12, r2 ;080B650E: 0000 lsl r0, r0, #0x0 ;080B6510: 1BD0 sub r0, r2, r7 ;080B6512: 0000 lsl r0, r0, #0x0 ;080B6514: 5800 ldr r0, [r0, r0] ;080B6516: 0601 lsl r1, r0, #0x18 080B6518: 4650 mov r0, r10 080B651A: 8882 ldrh r2, [r0, #0x04] 080B651C: 491C ldr r1, =#0xFFFF0000 080B651E: 9802 ldr r0, [sp, #0x008] 080B6520: 4008 and r0, r1 080B6522: 4310 orr r0, r2 080B6524: 9002 str r0, [sp, #0x008] 080B6526: 4651 mov r1, r10 080B6528: 88CA ldrh r2, [r1, #0x06] 080B652A: 0412 lsl r2, r2, #0x10 080B652C: 4919 ldr r1, =#0x0000FFFF 080B652E: 4008 and r0, r1 080B6530: 4310 orr r0, r2 080B6532: 9002 str r0, [sp, #0x008] 080B6534: 4652 mov r2, r10 080B6536: 6810 ldr r0, [r2] 080B6538: 9003 str r0, [sp, #0x00C] 080B653A: 2308 mov r3, #0x08 080B653C: 5ED1 ldsh r1, [r2, r3] 080B653E: F008 bl 080B6540: FCA7 bl 0x080BEE90 080B6542: 0400 lsl r0, r0, #0x10 080B6544: 0C00 lsr r0, r0, #0x10 080B6546: 9007 str r0, [sp, #0x01C] 080B6548: 2600 mov r6, #0x00 080B654A: 9606 str r6, [sp, #0x018] 080B654C: 3401 add r4, #0x01 080B654E: 9411 str r4, [sp, #0x044] 080B6550: 4650 mov r0, r10 080B6552: 300C add r0, #0x0C 080B6554: 9013 str r0, [sp, #0x04C] 080B6556: 9907 ldr r1, [sp, #0x01C] 080B6558: 428E cmp r6, r1 080B655A: D300 bcc 0x080B655E 080B655C: E178 b 0x080B6850 080B655E: 466A mov r2, sp 080B6560: 3208 add r2, #0x08 080B6562: 920B str r2, [sp, #0x02C] 080B6564: 9803 ldr r0, [sp, #0x00C] 080B6566: 8801 ldrh r1, [r0] 080B6568: 0A0B lsr r3, r1, #0x8 080B656A: 20FF mov r0, #0xFF 080B656C: 4008 and r0, r1 080B656E: 0200 lsl r0, r0, #0x8 080B6570: 4303 orr r3, r0 080B6572: 4699 mov r9, r3 080B6574: 2B0E cmp r3, #0x0E 080B6576: D80F bhi 0x080B6598 080B6578: 4642 mov r2, r8 080B657A: 3287 add r2, #0x87 080B657C: 7810 ldrb r0, [r2] 080B657E: 2108 mov r1, #0x08 080B6580: 4308 orr r0, r1 080B6582: 7010 strb r0, [r2] 080B6584: 9804 ldr r0, [sp, #0x010] 080B6586: A902 add r1, sp, #0x008 080B6588: 464A mov r2, r9 080B658A: F000 bl 080B658C: F9DF bl 0x080B694C 080B658E: E014 b 0x080B65BA ;080B6590: 0000 lsl r0, r0, #0x0 ;080B6592: FFFF bl 0x080B7592 ;080B6594: FFFF bl 0x080B6594 ;080B6596: 0000 lsl r0, r0, #0x0 080B6598: 4E09 ldr r6, =#0x00000FFF 080B659A: 45B1 cmp r9, r6 080B659C: D912 bls 0x080B65C4 080B659E: 4642 mov r2, r8 080B65A0: 3287 add r2, #0x87 080B65A2: 7810 ldrb r0, [r2] 080B65A4: 2108 mov r1, #0x08 080B65A6: 4308 orr r0, r1 080B65A8: 7010 strb r0, [r2] 080B65AA: 4648 mov r0, r9 080B65AC: 9000 str r0, [sp] 080B65AE: 9804 ldr r0, [sp, #0x010] 080B65B0: 4651 mov r1, r10 080B65B2: AA03 add r2, sp, #0x00C 080B65B4: AB02 add r3, sp, #0x008 080B65B6: F000 bl 080B65B8: F96F bl 0x080B6898 080B65BA: 9C06 ldr r4, [sp, #0x018] 080B65BC: 3401 add r4, #0x01 080B65BE: E13C b 0x080B683A ;080B65C0: 0FFF lsr r7, r7, #0x1F ;080B65C2: 0000 lsl r0, r0, #0x0 080B65C4: 4652 mov r2, r10 080B65C6: 7AD1 ldrb r1, [r2, #0x0B] 080B65C8: 2440 mov r4, #0x40 080B65CA: 2040 mov r0, #0x40 080B65CC: 4008 and r0, r1 080B65CE: 2800 cmp r0, #0x00 080B65D0: D014 beq 0x080B65FC 080B65D2: 9B0B ldr r3, [sp, #0x02C] 080B65D4: 8818 ldrh r0, [r3] 080B65D6: 300C add r0, #0x0C 080B65D8: 8018 strh r0, [r3] 080B65DA: 0400 lsl r0, r0, #0x10 080B65DC: 0C00 lsr r0, r0, #0x10 080B65DE: 466E mov r6, sp 080B65E0: 3608 add r6, #0x08 080B65E2: 960F str r6, [sp, #0x03C] 080B65E4: 9C06 ldr r4, [sp, #0x018] 080B65E6: 3401 add r4, #0x01 080B65E8: 7A91 ldrb r1, [r2, #0x0A] 080B65EA: 4288 cmp r0, r1 080B65EC: D800 bhi 0x080B65F0 080B65EE: E124 b 0x080B683A 080B65F0: 8890 ldrh r0, [r2, #0x04] 080B65F2: 8030 strh r0, [r6] 080B65F4: 8858 ldrh r0, [r3, #0x02] 080B65F6: 3010 add r0, #0x10 080B65F8: 8058 strh r0, [r3, #0x02] 080B65FA: E11E b 0x080B683A 080B65FC: 2001 mov r0, #0x01 080B65FE: F007 bl 080B6600: F841 bl 0x080BD684 080B6602: 1C07 add r7, r0, #0x0 080B6604: 9B0B ldr r3, [sp, #0x02C] 080B6606: 881A ldrh r2, [r3] 080B6608: 4E3F ldr r6, =#0x000001FF 080B660A: 1C30 add r0, r6, #0x0 080B660C: 4002 and r2, r0 080B660E: 8878 ldrh r0, [r7, #0x02] 080B6610: 4B3E ldr r3, =#0xFFFFFE00 080B6612: 1C19 add r1, r3, #0x0 080B6614: 4008 and r0, r1 080B6616: 4310 orr r0, r2 080B6618: 8078 strh r0, [r7, #0x02] 080B661A: 9E0B ldr r6, [sp, #0x02C] 080B661C: 8870 ldrh r0, [r6, #0x02] 080B661E: 7038 strb r0, [r7] 080B6620: 797A ldrb r2, [r7, #0x05] 080B6622: 20F0 mov r0, #0xF0 080B6624: 4302 orr r2, r0 080B6626: 717A strb r2, [r7, #0x05] 080B6628: 787B ldrb r3, [r7, #0x01] 080B662A: 213F mov r1, #0x3F 080B662C: 1C08 add r0, r1, #0x0 080B662E: 4018 and r0, r3 080B6630: 7078 strb r0, [r7, #0x01] 080B6632: 78F8 ldrb r0, [r7, #0x03] 080B6634: 4001 and r1, r0 080B6636: 4321 orr r1, r4 080B6638: 70F9 strb r1, [r7, #0x03] 080B663A: 4651 mov r1, r10 080B663C: 7AC8 ldrb r0, [r1, #0x0B] 080B663E: 0680 lsl r0, r0, #0x1A 080B6640: 0F80 lsr r0, r0, #0x1E 080B6642: 0080 lsl r0, r0, #0x2 080B6644: 230D mov r3, #0x0D 080B6646: 425B neg r3, r3 080B6648: 1C19 add r1, r3, #0x0 080B664A: 400A and r2, r1 080B664C: 4302 orr r2, r0 080B664E: 717A strb r2, [r7, #0x05] 080B6650: 4644 mov r4, r8 080B6652: 3484 add r4, #0x84 080B6654: 8822 ldrh r2, [r4] 080B6656: 0516 lsl r6, r2, #0x14 080B6658: 9614 str r6, [sp, #0x050] 080B665A: 4643 mov r3, r8 080B665C: 3385 add r3, #0x85 080B665E: 7818 ldrb r0, [r3] 080B6660: 0900 lsr r0, r0, #0x4 080B6662: 9009 str r0, [sp, #0x024] 080B6664: 4645 mov r5, r8 080B6666: 3586 add r5, #0x86 080B6668: 8828 ldrh r0, [r5] 080B666A: 0580 lsl r0, r0, #0x16 080B666C: 0D80 lsr r0, r0, #0x16 080B666E: 900A str r0, [sp, #0x028] 080B6670: 4649 mov r1, r9 080B6672: 4827 ldr r0, =#0x00000FFF 080B6674: 4001 and r1, r0 080B6676: 4E27 ldr r6, =#0xFFFFF000 080B6678: 1C30 add r0, r6, #0x0 080B667A: 4002 and r2, r0 080B667C: 430A orr r2, r1 080B667E: 8022 strh r2, [r4] 080B6680: 4650 mov r0, r10 080B6682: 7AC1 ldrb r1, [r0, #0x0B] 080B6684: 0709 lsl r1, r1, #0x1C 080B6686: 0E09 lsr r1, r1, #0x18 080B6688: 781A ldrb r2, [r3] 080B668A: 200F mov r0, #0x0F 080B668C: 4010 and r0, r2 080B668E: 4308 orr r0, r1 080B6690: 7018 strb r0, [r3] 080B6692: 4642 mov r2, r8 080B6694: 3287 add r2, #0x87 080B6696: 7810 ldrb r0, [r2] 080B6698: 2609 mov r6, #0x09 080B669A: 4276 neg r6, r6 080B669C: 1C31 add r1, r6, #0x0 080B669E: 4008 and r0, r1 080B66A0: 7010 strb r0, [r2] 080B66A2: 8820 ldrh r0, [r4] 080B66A4: 0500 lsl r0, r0, #0x14 080B66A6: 4694 mov r12, r2 080B66A8: 4669 mov r1, sp 080B66AA: 3108 add r1, #0x08 080B66AC: 910F str r1, [sp, #0x03C] 080B66AE: 930D str r3, [sp, #0x034] 080B66B0: 9A14 ldr r2, [sp, #0x050] 080B66B2: 4290 cmp r0, r2 080B66B4: D134 bne 0x080B6720 080B66B6: 7818 ldrb r0, [r3] 080B66B8: 0900 lsr r0, r0, #0x4 080B66BA: 9B09 ldr r3, [sp, #0x024] 080B66BC: 4298 cmp r0, r3 080B66BE: D12F bne 0x080B6720 080B66C0: 9E08 ldr r6, [sp, #0x020] 080B66C2: 980A ldr r0, [sp, #0x028] 080B66C4: 4286 cmp r6, r0 080B66C6: D12B bne 0x080B6720 080B66C8: 4913 ldr r1, =#0x000003FF 080B66CA: 1C08 add r0, r1, #0x0 080B66CC: 1C31 add r1, r6, #0x0 080B66CE: 4001 and r1, r0 080B66D0: 882A ldrh r2, [r5] 080B66D2: 4812 ldr r0, =#0xFFFFFC00 080B66D4: 4010 and r0, r2 080B66D6: 4308 orr r0, r1 080B66D8: 8028 strh r0, [r5] 080B66DA: 490F ldr r1, =#0x000003FF 080B66DC: 4031 and r1, r6 080B66DE: 88BA ldrh r2, [r7, #0x04] 080B66E0: 480E ldr r0, =#0xFFFFFC00 080B66E2: 4010 and r0, r2 080B66E4: 4308 orr r0, r1 080B66E6: 80B8 strh r0, [r7, #0x04] 080B66E8: 4662 mov r2, r12 080B66EA: 7810 ldrb r0, [r2] 080B66EC: 2104 mov r1, #0x04 080B66EE: 4308 orr r0, r1 080B66F0: 7010 strb r0, [r2] 080B66F2: 4643 mov r3, r8 080B66F4: 3388 add r3, #0x88 080B66F6: 930E str r3, [sp, #0x038] 080B66F8: 3602 add r6, #0x02 080B66FA: 9612 str r6, [sp, #0x048] 080B66FC: 9E05 ldr r6, [sp, #0x014] 080B66FE: 3640 add r6, #0x40 080B6700: 960C str r6, [sp, #0x030] 080B6702: 9C06 ldr r4, [sp, #0x018] 080B6704: 3401 add r4, #0x01 080B6706: E069 b 0x080B67DC ;080B6708: 01FF lsl r7, r7, #0x7 ;080B670A: 0000 lsl r0, r0, #0x0 ;080B670C: FE00 bl 0x080B730E ;080B670E: FFFF bl 0x07EB770E ;080B6710: 0FFF lsr r7, r7, #0x1F ;080B6712: 0000 lsl r0, r0, #0x0 ;080B6714: F000 bl ;080B6716: FFFF bl 0x080B7716 ;080B6718: 03FF lsl r7, r7, #0xF ;080B671A: 0000 lsl r0, r0, #0x0 ;080B671C: FC00 bl 0x080B6F1E ;080B671E: FFFF bl 0x07CB771E 080B6720: A901 add r1, sp, #0x004 080B6722: 2000 mov r0, #0x00 080B6724: 8008 strh r0, [r1] 080B6726: 4855 ldr r0, =#0x040000D4 080B6728: 6001 str r1, [r0] 080B672A: 4641 mov r1, r8 080B672C: 3104 add r1, #0x04 080B672E: 6041 str r1, [r0, #0x04] 080B6730: 4853 ldr r0, =#0x81000020 080B6732: 4A52 ldr r2, =#0x040000D4 080B6734: 6090 str r0, [r2, #0x08] 080B6736: 6890 ldr r0, [r2, #0x08] 080B6738: 1C13 add r3, r2, #0x0 080B673A: 6890 ldr r0, [r2, #0x08] 080B673C: 2280 mov r2, #0x80 080B673E: 0612 lsl r2, r2, #0x18 080B6740: 9110 str r1, [sp, #0x040] 080B6742: 4646 mov r6, r8 080B6744: 3644 add r6, #0x44 080B6746: 3184 add r1, #0x84 080B6748: 910E str r1, [sp, #0x038] 080B674A: 9908 ldr r1, [sp, #0x020] 080B674C: 3102 add r1, #0x02 080B674E: 9112 str r1, [sp, #0x048] 080B6750: 9905 ldr r1, [sp, #0x014] 080B6752: 3140 add r1, #0x40 080B6754: 910C str r1, [sp, #0x030] 080B6756: 9C06 ldr r4, [sp, #0x018] 080B6758: 3401 add r4, #0x01 080B675A: 2800 cmp r0, #0x00 080B675C: DA04 bge 0x080B6768 080B675E: 1C11 add r1, r2, #0x0 080B6760: 6898 ldr r0, [r3, #0x08] 080B6762: 4008 and r0, r1 080B6764: 2800 cmp r0, #0x00 080B6766: D1FB bne 0x080B6760 080B6768: A901 add r1, sp, #0x004 080B676A: 2000 mov r0, #0x00 080B676C: 8008 strh r0, [r1] 080B676E: 4A43 ldr r2, =#0x040000D4 080B6770: 6011 str r1, [r2] 080B6772: 6056 str r6, [r2, #0x04] 080B6774: 4842 ldr r0, =#0x81000020 080B6776: 6090 str r0, [r2, #0x08] 080B6778: 6890 ldr r0, [r2, #0x08] 080B677A: 6890 ldr r0, [r2, #0x08] 080B677C: 2180 mov r1, #0x80 080B677E: 0609 lsl r1, r1, #0x18 080B6780: 2800 cmp r0, #0x00 080B6782: DA03 bge 0x080B678C 080B6784: 6890 ldr r0, [r2, #0x08] 080B6786: 4008 and r0, r1 080B6788: 2800 cmp r0, #0x00 080B678A: D1FB bne 0x080B6784 080B678C: 4B3D ldr r3, =#0x000003FF 080B678E: 1C18 add r0, r3, #0x0 080B6790: 9908 ldr r1, [sp, #0x020] 080B6792: 4001 and r1, r0 080B6794: 882A ldrh r2, [r5] 080B6796: 483C ldr r0, =#0xFFFFFC00 080B6798: 4010 and r0, r2 080B679A: 4308 orr r0, r1 080B679C: 8028 strh r0, [r5] 080B679E: 1C18 add r0, r3, #0x0 080B67A0: 9908 ldr r1, [sp, #0x020] 080B67A2: 4001 and r1, r0 080B67A4: 9108 str r1, [sp, #0x020] 080B67A6: 88B9 ldrh r1, [r7, #0x04] 080B67A8: 4837 ldr r0, =#0xFFFFFC00 080B67AA: 4008 and r0, r1 080B67AC: 9A08 ldr r2, [sp, #0x020] 080B67AE: 4310 orr r0, r2 080B67B0: 80B8 strh r0, [r7, #0x04] 080B67B2: 9B05 ldr r3, [sp, #0x014] 080B67B4: 4640 mov r0, r8 080B67B6: 6003 str r3, [r0] 080B67B8: 4661 mov r1, r12 080B67BA: 7808 ldrb r0, [r1] 080B67BC: 2205 mov r2, #0x05 080B67BE: 4252 neg r2, r2 080B67C0: 1C11 add r1, r2, #0x0 080B67C2: 4008 and r0, r1 080B67C4: 4663 mov r3, r12 080B67C6: 7018 strb r0, [r3] 080B67C8: 990D ldr r1, [sp, #0x034] 080B67CA: 7808 ldrb r0, [r1] 080B67CC: 0900 lsr r0, r0, #0x4 080B67CE: 9000 str r0, [sp] 080B67D0: 482E ldr r0, =#0x086035AC 080B67D2: 9910 ldr r1, [sp, #0x040] 080B67D4: 1C32 add r2, r6, #0x0 080B67D6: 464B mov r3, r9 080B67D8: F008 bl 080B67DA: F9FE bl 0x080BEBD8 080B67DC: 9A04 ldr r2, [sp, #0x010] 080B67DE: 4B2C ldr r3, =#0x000050C7 080B67E0: 18D1 add r1, r2, r3 080B67E2: 7808 ldrb r0, [r1] 080B67E4: 3001 add r0, #0x01 080B67E6: 7008 strb r0, [r1] 080B67E8: 9E0E ldr r6, [sp, #0x038] 080B67EA: 46B0 mov r8, r6 080B67EC: 9A12 ldr r2, [sp, #0x048] 080B67EE: 0410 lsl r0, r2, #0x10 080B67F0: 0C00 lsr r0, r0, #0x10 080B67F2: 9008 str r0, [sp, #0x020] 080B67F4: 9B0C ldr r3, [sp, #0x030] 080B67F6: 9305 str r3, [sp, #0x014] 080B67F8: 7808 ldrb r0, [r1] 080B67FA: 2110 mov r1, #0x10 080B67FC: F009 bl 080B67FE: F8D6 bl 0x080BF9AC 080B6800: 2800 cmp r0, #0x00 080B6802: D109 bne 0x080B6818 080B6804: 9808 ldr r0, [sp, #0x020] 080B6806: 3020 add r0, #0x20 080B6808: 0400 lsl r0, r0, #0x10 080B680A: 0C00 lsr r0, r0, #0x10 080B680C: 9008 str r0, [sp, #0x020] 080B680E: 2080 mov r0, #0x80 080B6810: 00C0 lsl r0, r0, #0x3 080B6812: 9E0C ldr r6, [sp, #0x030] 080B6814: 1830 add r0, r6, r0 080B6816: 9005 str r0, [sp, #0x014] 080B6818: 990F ldr r1, [sp, #0x03C] 080B681A: 8808 ldrh r0, [r1] 080B681C: 300C add r0, #0x0C 080B681E: 9A0B ldr r2, [sp, #0x02C] 080B6820: 8010 strh r0, [r2] 080B6822: 0400 lsl r0, r0, #0x10 080B6824: 0C00 lsr r0, r0, #0x10 080B6826: 4653 mov r3, r10 080B6828: 7A9B ldrb r3, [r3, #0x0A] 080B682A: 4298 cmp r0, r3 080B682C: D905 bls 0x080B683A 080B682E: 4656 mov r6, r10 080B6830: 88B0 ldrh r0, [r6, #0x04] 080B6832: 8008 strh r0, [r1] 080B6834: 8850 ldrh r0, [r2, #0x02] 080B6836: 3010 add r0, #0x10 080B6838: 8050 strh r0, [r2, #0x02] 080B683A: 0420 lsl r0, r4, #0x10 080B683C: 0C00 lsr r0, r0, #0x10 080B683E: 9006 str r0, [sp, #0x018] 080B6840: 9803 ldr r0, [sp, #0x00C] 080B6842: 3002 add r0, #0x02 080B6844: 9003 str r0, [sp, #0x00C] 080B6846: 9806 ldr r0, [sp, #0x018] 080B6848: 9907 ldr r1, [sp, #0x01C] 080B684A: 4288 cmp r0, r1 080B684C: D200 bcs 0x080B6850 080B684E: E689 b 0x080B6564 080B6850: 9A11 ldr r2, [sp, #0x044] 080B6852: 0410 lsl r0, r2, #0x10 080B6854: 0C04 lsr r4, r0, #0x10 080B6856: 9B13 ldr r3, [sp, #0x04C] 080B6858: 469A mov r10, r3 080B685A: 9E04 ldr r6, [sp, #0x010] 080B685C: 490D ldr r1, =#0x00004694 080B685E: 1870 add r0, r6, r1 080B6860: 6800 ldr r0, [r0] 080B6862: 7A40 ldrb r0, [r0, #0x09] 080B6864: 4284 cmp r4, r0 080B6866: D200 bcs 0x080B686A 080B6868: E656 b 0x080B6518 080B686A: B015 add sp, #0x054 080B686C: BC38 pop {r3, r4, r5} 080B686E: 4698 mov r8, r3 080B6870: 46A1 mov r9, r4 080B6872: 46AA mov r10, r5 080B6874: BCF0 pop {r4, r5, r6, r7} 080B6876: BC01 pop {r0} 080B6878: 4700 bx r0 ;080B687A: 0000 lsl r0, r0, #0x0 ;080B687C: 00D4 lsl r4, r2, #0x3 ;080B687E: 0400 lsl r0, r0, #0x10 ;080B6880: 0020 lsl r0, r4, #0x0 ;080B6882: 8100 strh r0, [r0, #0x08] ;080B6884: 03FF lsl r7, r7, #0xF ;080B6886: 0000 lsl r0, r0, #0x0 ;080B6888: FC00 bl 0x080B708A ;080B688A: FFFF bl 0x07CB788A ;080B688C: 35AC add r5, #0xAC ;080B688E: 0860 lsr r0, r4, #0x1 ;080B6890: 50C7 str r7, [r0, r3] ;080B6892: 0000 lsl r0, r0, #0x0 ;080B6894: 4694 mov r12, r2 ;080B6896: 0000 lsl r0, r0, #0x0
$080B694C - ?
080B694C: B510 push {r4, lr} 080B694E: 1C0C add r4, r1, #0x0 ; r4 = Orig. r1 080B6950: 0411 lsl r1, r2, #0x10 080B6952: 2080 mov r0, #0x80 080B6954: 0340 lsl r0, r0, #0xD ; r0 = #$00100000 080B6956: 1809 add r1, r1, r0 080B6958: 0C09 lsr r1, r1, #0x10 ; r1 = Orig. r2 + #$10 AND #$0000FFFF 080B695A: 1C20 add r0, r4, #0x0 ; r0 = Orig. r1 080B695C: F7FB bl 080B695E: FABE bl 0x080B1EDC ; ? 080B6960: 8820 ldrh r0, [r4] 080B6962: 300C add r0, #0x0C 080B6964: 8020 strh r0, [r4] ; Orig. r1 = Orig. r1 + #$0C 080B6966: BC10 pop {r4} 080B6968: BC01 pop {r0} 080B696A: 4700 bx r0
$080B6970 - ?
Whenever this is called in the intro, r0 = #$0203BC10
Other register values on the first call are:
r1 = #$00000001
r2 = #$00000001
r3 = #$00000000
This subroutine does:
- Add a new entry on stack, temp store r2 and r3 there
- Clear Bits 1 and 2 of $0203CABC (r0 + #$0EAC)
- Clear #$E94 bytes from $0203BC10 (r0) on
- LEFT OUT IF r2 = #$00: Call of $080B74E0 (SRAM-related)
- LEFT OUT IF r2 = #$00: Set Bit 0 of $0203CABC (r0 + $00000EAC)
- LEFT OUT IF r2 = ? (Some weird is-Bit-Set-testing and branching)
- LEFT OUT IF r2 = Transfer #$18 bytes from the address in $0203F3C4 to $0203CAA4 (r0 + E94)
- Check if $020000E4 = #$0800170D or #$08001719. If it is, leave out next point
- MAYBE LEFT OUT: $0203F3AC = r0 (#$02), $0203F3B4-7 = #$04000108, $020000E4 = #$080BFB0D
- .....NOT FINISHED.....
080B6970: B570 push {r4, r5, r6, lr} 080B6972: B081 add sp, #-0x004 ; Add new stack entry 080B6974: 1C05 add r5, r0, #0x0 ; r5 = Orig. r0 080B6976: 4668 mov r0, sp 080B6978: 7002 strb r2, [r0] ; Store r2 in new Stack Entry (BYTE) 080B697A: 466C mov r4, sp 080B697C: 3401 add r4, #0x01 ; INC r4 (store address) 080B697E: 7023 strb r3, [r4] ; Store r3 in new Stack Entry, second byte (BYTE) 080B6980: 4819 ldr r0, =#0x00000EAC 080B6982: 182A add r2, r5, r0 080B6984: 7811 ldrb r1, [r2] ; r1 = [Orig. r0 + #$0EAC] ($0203CABC) 080B6986: 2003 mov r0, #0x03 080B6988: 4240 neg r0, r0 ; r0 = #$FFFFFFFD = %... 1111.1101 080B698A: 4008 and r0, r1 080B698C: 2105 mov r1, #0x05 080B698E: 4249 neg r1, r1 ; r0 = #$FFFFFFFB = %... 1111.1011 080B6990: 4008 and r0, r1 080B6992: 7010 strb r0, [r2] ; Store back 080B6994: 4669 mov r1, sp 080B6996: 3102 add r1, #0x02 080B6998: 2000 mov r0, #0x00 080B699A: 8008 strh r0, [r1] ; Store #$0000 on Stack (DOUBLEBYTE) ; Thus, it forms a 4-byte-value with the r2 and r3 values 080B699C: 4813 ldr r0, =#0x040000D4 080B699E: 6001 str r1, [r0] ; Store that stack address as DMA Source Address 080B69A0: 6045 str r5, [r0, #0x04] ; Original r0 is the destination address 080B69A2: 4913 ldr r1, =#0x8100074A ; Fixed transfer for #$E94 bytes 080B69A4: 6081 str r1, [r0, #0x08] ; ACTIVATE DMA 080B69A6: 6881 ldr r1, [r0, #0x08] 080B69A8: 1C01 add r1, r0, #0x0 080B69AA: 6888 ldr r0, [r1, #0x08] 080B69AC: 2280 mov r2, #0x80 080B69AE: 0612 lsl r2, r2, #0x18 080B69B0: 2800 cmp r0, #0x00 080B69B2: DA03 bge 0x080B69BC ; Branch if DMA is finished 080B69B4: 6888 ldr r0, [r1, #0x08] 080B69B6: 4010 and r0, r2 080B69B8: 2800 cmp r0, #0x00 080B69BA: D1FB bne 0x080B69B4 ; Loop if DMA isn't finished 080B69BC: 4668 mov r0, sp 080B69BE: 7800 ldrb r0, [r0] 080B69C0: 2800 cmp r0, #0x00 080B69C2: D01F beq 0x080B6A04 ; branch if last byte on stack (Original r2 value) = #$00 080B69C4: F000 bl 080B69C6: FD8C bl 0x080B74E0 ; Load a set of values according to two SRAM bytes, compare one value, set r0 to 1 or 0 080B69C8: 4907 ldr r1, =#0x00000EAC 080B69CA: 186B add r3, r5, r1 ; Originally r0 + $00000EAC (This is the same address as above, we ANDed something there) 080B69CC: 2101 mov r1, #0x01 080B69CE: 4001 and r1, r0 ; r1 = r0 (r0 can only be 01 or 00, and with this AND, r1 only remains 01 if r0 was it, too) 080B69D0: 781A ldrb r2, [r3] ; Load the already ANDed value 080B69D2: 2002 mov r0, #0x02 080B69D4: 4240 neg r0, r0 080B69D6: 4010 and r0, r2 ; AND it with #$FFFFFFFE (remove LSB) 080B69D8: 4308 orr r0, r1 ; Add LSB according to r1 080B69DA: 7018 strb r0, [r3] ; Store back 080B69DC: 2101 mov r1, #0x01 080B69DE: 4008 and r0, r1 ; Set the may-be-set LSB free from all the other stuff again 080B69E0: 2800 cmp r0, #0x00 080B69E2: D107 bne 0x080B69F4 ; Branch if it was set 080B69E4: 2000 mov r0, #0x00 ;... useless? I mean, r0 must be empty anyways...? 080B69E6: E02B b 0x080B6A40 ; Exit ;080B69E8: 0EAC lsr r4, r5, #0x1A ;080B69EA: 0000 lsl r0, r0, #0x0 ;080B69EC: 00D4 lsl r4, r2, #0x3 ;080B69EE: 0400 lsl r0, r0, #0x10 ;080B69F0: 074A lsl r2, r1, #0x1D ;080B69F2: 8100 strh r0, [r0, #0x08] ; TRANSFER 6 x 4 BYTES 080B69F4: 4814 ldr r0, =#0x0203F3C4 080B69F6: 4A15 ldr r2, =#0x00000E94 080B69F8: 18A9 add r1, r5, r2 ; Original r0 + $00000E94 080B69FA: 6800 ldr r0, [r0] ; Load value in $0203F3C4 080B69FC: C84C ldmia r0!, {r2, r3, r6} ; Load first 4 bytes in r2, second 4 bytes in r3, third 4 bytes in r6 080B69FE: C14C stmia r1!, {r2, r3, r6} 080B6A00: C84C ldmia r0!, {r2, r3, r6} 080B6A02: C14C stmia r1!, {r2, r3, r6} ; CHECK IF [$020000E4] IS #$0800170D OR #$08001719 080B6A04: 4912 ldr r1, =#0x020000D0 080B6A06: 694A ldr r2, [r1, #0x14] ; r2 = [$020000E4] 080B6A08: 4812 ldr r0, =#0x0800170D 080B6A0A: 4282 cmp r2, r0 080B6A0C: D006 beq 0x080B6A1C ; branch if [$020000E4] = #$0800170D 080B6A0E: 4812 ldr r0, =#0x08001719 080B6A10: 4282 cmp r2, r0 080B6A12: D003 beq 0x080B6A1C ; branch if [$020000E4] = #$08001719 080B6A14: 3114 add r1, #0x14 ; r1 = $020000E4 080B6A16: 2002 mov r0, #0x02 ; r0 = $00000002 - Timer 2 ( $0400108) 080B6A18: F009 bl 080B6A1A: F88A bl 0x080BFB30 ; $0203F3AC = r0 (#$02), $0203F3B4-7 = #$04000108, $020000E4 = #$080BFB0D 080B6A1C: 7821 ldrb r1, [r4] ; r4 = sp, 0x01 = Original r3 080B6A1E: 1C28 add r0, r5, #0x0 ; r0 = r5 = Original r0 080B6A20: F000 bl 080B6A22: F866 bl 0x080B6AF0 ; Stack clear DMA, clear DMA for r0 (74A doublebytes) 080B6A24: 0600 lsl r0, r0, #0x18 080B6A26: 2800 cmp r0, #0x00 080B6A28: D109 bne 0x080B6A3E 080B6A2A: 4B0C ldr r3, =#0x00000EAC 080B6A2C: 18E9 add r1, r5, r3 080B6A2E: 780C ldrb r4, [r1] 080B6A30: 2002 mov r0, #0x02 080B6A32: 4020 and r0, r4 080B6A34: 2800 cmp r0, #0x00 080B6A36: D102 bne 0x080B6A3E 080B6A38: 2004 mov r0, #0x04 080B6A3A: 4320 orr r0, r4 080B6A3C: 7008 strb r0, [r1] 080B6A3E: 2001 mov r0, #0x01 080B6A40: B001 add sp, #0x004 080B6A42: BC70 pop {r4, r5, r6} 080B6A44: BC02 pop {r1} 080B6A46: 4708 bx r1 080B6A48: F3C4 bl ;DATA ;========= ;080B6A4A: 0203 lsl r3, r0, #0x8 ;080B6A4C: 0E94 lsr r4, r2, #0x1A ;080B6A4E: 0000 lsl r0, r0, #0x0 ;080B6A50: 00D0 lsl r0, r2, #0x3 ;080B6A52: 0200 lsl r0, r0, #0x8 ;080B6A54: 170D asr r5, r1, #0x1C ;080B6A56: 0800 lsr r0, r0, #0x0 ;080B6A58: 1719 asr r1, r3, #0x1C ;080B6A5A: 0800 lsr r0, r0, #0x0 ;080B6A5C: 0EAC lsr r4, r5, #0x1A ;080B6A5E: 0000 lsl r0, r0, #0x0
$080B6AAC - ?
080B6AAC: B510 push {r4, lr} 080B6AAE: 1C04 add r4, r0, #0x0 080B6AB0: 1C22 add r2, r4, #0x0 080B6AB2: 326D add r2, #0x6D 080B6AB4: 7811 ldrb r1, [r2] 080B6AB6: 2011 mov r0, #0x11 080B6AB8: 4240 neg r0, r0 080B6ABA: 4008 and r0, r1 080B6ABC: 7010 strb r0, [r2] 080B6ABE: F000 bl 080B6AC0: FB81 bl 0x080B71C4 080B6AC2: 1C20 add r0, r4, #0x0 080B6AC4: 2104 mov r1, #0x04 080B6AC6: F000 bl 080B6AC8: FBAF bl 0x080B7228 080B6ACA: 1C20 add r0, r4, #0x0 080B6ACC: 2109 mov r1, #0x09 080B6ACE: F000 bl 080B6AD0: FBAB bl 0x080B7228 080B6AD2: 1C20 add r0, r4, #0x0 080B6AD4: 2101 mov r1, #0x01 080B6AD6: 2201 mov r2, #0x01 080B6AD8: F000 bl 080B6ADA: F99C bl 0x080B6E14 080B6ADC: 2001 mov r0, #0x01 080B6ADE: BC10 pop {r4} 080B6AE0: BC02 pop {r1} 080B6AE2: 4708 bx r1
$080B6AF0 - ?
; Setting up a fixed DMA to clear $1000 bytes of stack 080B6AF0: B530 push {r4, r5, lr} 080B6AF2: 4C20 ldr r4, =#0xFFFFEFF8 080B6AF4: 44A5 add sp, r4 ; add #$FFFFEFF8 to sp = sp - #$0001008 (gets removed at the end) 080B6AF6: 1C04 add r4, r0, #0x0 ; r4 = r0 080B6AF8: 4668 mov r0, sp ; r0 = sp 080B6AFA: 7001 strb r1, [r0] ; [sp] = r1 080B6AFC: 4A1E ldr r2, =#0x00001004 080B6AFE: 446A add r2, sp ; r1 = sp + #$00001004 080B6B00: 2000 mov r0, #0x00 080B6B02: 8010 strh r0, [r2] ; clear sp + #$00001004 080B6B04: 491D ldr r1, =#0x040000D4 ; FIXED DMA TO CLEAR THE NEW STACK AREA 080B6B06: 600A str r2, [r1] ; DMA Source Address: sp + #$00001004 080B6B08: AA01 add r2, sp, #0x004 080B6B0A: 604A str r2, [r1, #0x04] ; DMA Destination Address: Stack Pointer + 4 080B6B0C: 481C ldr r0, =#0x81000800 ; Fixed DMA, transfer 800 doublebytes 080B6B0E: 6088 str r0, [r1, #0x08] ; ENABLE DMA 080B6B10: 6888 ldr r0, [r1, #0x08] 080B6B12: 6888 ldr r0, [r1, #0x08] 080B6B14: 2380 mov r3, #0x80 080B6B16: 061B lsl r3, r3, #0x18 080B6B18: 1C15 add r5, r2, #0x0 080B6B1A: 2800 cmp r0, #0x00 080B6B1C: DA04 bge 0x080B6B28 ; Branch if DMA is done 080B6B1E: 1C1A add r2, r3, #0x0 080B6B20: 6888 ldr r0, [r1, #0x08] 080B6B22: 4010 and r0, r2 080B6B24: 2800 cmp r0, #0x00 080B6B26: D1FB bne 0x080B6B20 ; Loop if DMA isn't done ; Clear $74A doublebytes at the address in r0 080B6B28: 4913 ldr r1, =#0x00001004 080B6B2A: 4469 add r1, sp ; r1 = sp + #$00001004 080B6B2C: 2000 mov r0, #0x00 080B6B2E: 8008 strh r0, [r1] ; clear sp + #$00001004 080B6B30: 4812 ldr r0, =#0x040000D4 080B6B32: 6001 str r1, [r0] ; DMA Source Address: sp + #$00001004 (CLEAR) 080B6B34: 6044 str r4, [r0, #0x04] ; DMA Destination Address: Original r0 080B6B36: 4913 ldr r1, =#0x8100074A ; Fixed DMA, #$74A doublebytes (= #$E94 Bytes) 080B6B38: 6081 str r1, [r0, #0x08] ; ENABLE DMA 080B6B3A: 6881 ldr r1, [r0, #0x08] 080B6B3C: 1C02 add r2, r0, #0x0 080B6B3E: 6890 ldr r0, [r2, #0x08] 080B6B40: 2180 mov r1, #0x80 080B6B42: 0609 lsl r1, r1, #0x18 080B6B44: 2800 cmp r0, #0x00 080B6B46: DA03 bge 0x080B6B50 ; branch if DMA is done 080B6B48: 6890 ldr r0, [r2, #0x08] 080B6B4A: 4008 and r0, r1 080B6B4C: 2800 cmp r0, #0x00 080B6B4E: D1FB bne 0x080B6B48 ; Loop if DMA isn't done 080B6B50: 2000 mov r0, #0x00 080B6B52: 1C29 add r1, r5, #0x0 080B6B54: 2201 mov r2, #0x01 080B6B56: F000 bl 080B6B58: FCCF bl 0x080B74F8 ; Load some data from SRAM to WRAM, check if the transfer was flawless 080B6B5A: 1C20 add r0, r4, #0x0 080B6B5C: 1C29 add r1, r5, #0x0 080B6B5E: F000 bl 080B6B60: F829 bl 0x080B6BB4 080B6B62: 0600 lsl r0, r0, #0x18 080B6B64: 2800 cmp r0, #0x00 080B6B66: D10F bne 0x080B6B88 080B6B68: 1C20 add r0, r4, #0x0 080B6B6A: F000 bl 080B6B6C: FC53 bl 0x080B7414 080B6B6E: 2000 mov r0, #0x00 080B6B70: E017 b 0x080B6BA2 ; Exit ;DATA ;============= ;080B6B72: 0000 lsl r0, r0, #0x0 ;080B6B74: EFF8 ??? ;080B6B76: FFFF bl 0x080AFB76 ;080B6B78: 1004 asr r4, r0, #0x0 ;080B6B7A: 0000 lsl r0, r0, #0x0 ;080B6B7C: 00D4 lsl r4, r2, #0x3 ;080B6B7E: 0400 lsl r0, r0, #0x10 ;080B6B80: 0800 lsr r0, r0, #0x0 ;080B6B82: 8100 strh r0, [r0, #0x08] ;080B6B84: 074A lsl r2, r1, #0x1D ;080B6B86: 8100 strh r0, [r0, #0x08] 080B6B88: 4A08 ldr r2, =#0x00000E94 ; Number of Bytes to transfer 080B6B8A: 1C20 add r0, r4, #0x0 ; Destination Address 080B6B8C: 1C29 add r1, r5, #0x0 ; Source Address 080B6B8E: F00B bl 080B6B90: FA29 bl 0x080C1FE4 ; Data Transfer 080B6B92: 4668 mov r0, sp 080B6B94: 7800 ldrb r0, [r0] 080B6B96: 2800 cmp r0, #0x00 080B6B98: D002 beq 0x080B6BA0 080B6B9A: 1C20 add r0, r4, #0x0 080B6B9C: F000 bl 080B6B9E: F83A bl 0x080B6C14 080B6BA0: 2001 mov r0, #0x01 080B6BA2: 4B03 ldr r3, =#0x00001008 080B6BA4: 449D add sp, r3 ; restore old stack (see above) and registers, exit 080B6BA6: BC30 pop {r4, r5} 080B6BA8: BC02 pop {r1} 080B6BAA: 4708 bx r1 ;DATA ;============= ;080B6BAC: 0E94 lsr r4, r2, #0x1A ;080B6BAE: 0000 lsl r0, r0, #0x0 ;080B6BB0: 1008 asr r0, r1, #0x0 ;080B6BB2: 0000 lsl r0, r0, #0x0
$080B6BB4 - ?
This subroutine is left with a "flag value" in bit 0 of r0.
080B6BB4: B530 push {r4, r5, lr} 080B6BB6: B081 add sp, #-0x004 080B6BB8: 1C05 add r5, r0, #0x0 080B6BBA: 1C0C add r4, r1, #0x0 080B6BBC: 2180 mov r1, #0x80 080B6BBE: 0149 lsl r1, r1, #0x5 ; r1 = $00010000 (Counter value for following subroutine) 080B6BC0: 1C20 add r0, r4, #0x0 ; r0 = r4 = original r1 (Address for following subroutine) 080B6BC2: F007 bl 080B6BC4: FFF1 bl 0x080BEBA8 ; Checksum calculation!?! 080B6BC6: 9000 str r0, [sp] 080B6BC8: 9900 ldr r1, [sp] 080B6BCA: 4809 ldr r0, =#0x07FFF800 080B6BCC: 4281 cmp r1, r0 080B6BCE: D013 beq 0x080B6BF8 080B6BD0: 9800 ldr r0, [sp] 080B6BD2: 0400 lsl r0, r0, #0x10 080B6BD4: 1400 asr r0, r0, #0x10 ; Load result of SR $080BEBA8 and remove upper two bytes 080B6BD6: 2101 mov r1, #0x01 080B6BD8: 4249 neg r1, r1 080B6BDA: 4288 cmp r0, r1 ; Are the lower two bytes = #$FFFE? 080B6BDC: D112 bne 0x080B6C04 ; If not, exit with r0 = #$00000000 080B6BDE: 8820 ldrh r0, [r4] 080B6BE0: 2807 cmp r0, #0x07 ; Is the lower half of the original r1 = #$0007? 080B6BE2: D10F bne 0x080B6C04 ; If not, exit with r0 = #$00000000 080B6BE4: 8861 ldrh r1, [r4, #0x02] 080B6BE6: 4803 ldr r0, =#0x0000564D 080B6BE8: 4281 cmp r1, r0 ; Is the upper half of the original r1 = #$564D? 080B6BEA: D10B bne 0x080B6C04 ; If not, exit with r0 = #$00000000 080B6BEC: 2001 mov r0, #0x01 080B6BEE: E00A b 0x080B6C06 ; Else, exit with r0 = #$00000001 ;080B6BF0: F800 bl 0x080C0BF2 ;080B6BF2: 07FF lsl r7, r7, #0x1F ;080B6BF4: 564D ldsb r5, [r1, r1] ;080B6BF6: 0000 lsl r0, r0, #0x0 080B6BF8: 4905 ldr r1, =#0x00000EAC 080B6BFA: 1868 add r0, r5, r1 080B6BFC: 7801 ldrb r1, [r0] 080B6BFE: 2202 mov r2, #0x02 080B6C00: 4311 orr r1, r2 080B6C02: 7001 strb r1, [r0] 080B6C04: 2000 mov r0, #0x00 080B6C06: B001 add sp, #0x004 080B6C08: BC30 pop {r4, r5} 080B6C0A: BC02 pop {r1} 080B6C0C: 4708 bx r1 ;080B6C0E: 0000 lsl r0, r0, #0x0 ;080B6C10: 0EAC lsr r4, r5, #0x1A ;080B6C12: 0000 lsl r0, r0, #0x0
$080B6C14 - (Data Transfer to $0202C990)
r0 contains an address. #$80 are added to that address and it is used as the Source address for the Data Transfer. From that address #$E10 Bytes are transferred to $0202C990
080B6C14: B500 push {lr} 080B6C16: 1C01 add r1, r0, #0x0 080B6C18: 4803 ldr r0, =#0x0202C990 ; Data Transfer Destination address: $0202C990 080B6C1A: 3180 add r1, #0x80 080B6C1C: 22E1 mov r2, #0xE1 ; Data Transfer Source address: Original r0 + #$00000080 080B6C1E: 0112 lsl r2, r2, #0x4 ; Data Transfer Data Size: #$00000E10 Bytes 080B6C20: F00B bl 080B6C22: F9E0 bl 0x080C1FE4 ; Data Transfer 080B6C24: BC01 pop {r0} 080B6C26: 4700 bx r0 ;DATA ;============== ;080B6C28: C990 ldmia r1!, {r4, r7} ;080B6C2A: 0202 lsl r2, r0, #0x8
$080B6E14 - ?
080B6E14: B570 push {r4, r5, r6, lr} 080B6E16: 4C1A ldr r4, =#0xFFFFEFF8 080B6E18: 44A5 add sp, r4 ; Add #$1008 Bytes to stack 080B6E1A: 1C05 add r5, r0, #0x0 ; Tempstore Original r0 080B6E1C: 4668 mov r0, sp 080B6E1E: 7001 strb r1, [r0] ; Store r1 (byte sized) on Stack 080B6E20: 466B mov r3, sp 080B6E22: 3301 add r3, #0x01 080B6E24: 701A strb r2, [r3] ; Store r2 (byte sized) on Stack, right next to r1 080B6E26: 4A17 ldr r2, =#0x00001004 080B6E28: 446A add r2, sp ; Calculate "old" start point of stack 080B6E2A: 2000 mov r0, #0x00 ; CLEAR THE #$1000 BYTES ON STACK VIA FIXED DMA 080B6E2C: 8010 strh r0, [r2] 080B6E2E: 4916 ldr r1, =#0x040000D4 080B6E30: 600A str r2, [r1] 080B6E32: AA01 add r2, sp, #0x004 080B6E34: 604A str r2, [r1, #0x04] 080B6E36: 4815 ldr r0, =#0x81000800 080B6E38: 6088 str r0, [r1, #0x08] 080B6E3A: 6888 ldr r0, [r1, #0x08] 080B6E3C: 6888 ldr r0, [r1, #0x08] 080B6E3E: 2480 mov r4, #0x80 080B6E40: 0624 lsl r4, r4, #0x18 080B6E42: 1C16 add r6, r2, #0x0 080B6E44: 2800 cmp r0, #0x00 080B6E46: DA04 bge 0x080B6E52 ; Branch if DMA is complete 080B6E48: 1C22 add r2, r4, #0x0 080B6E4A: 6888 ldr r0, [r1, #0x08] 080B6E4C: 4010 and r0, r2 080B6E4E: 2800 cmp r0, #0x00 080B6E50: D1FB bne 0x080B6E4A ; Loop if DMA isn't complete 080B6E52: 4668 mov r0, sp 080B6E54: 7801 ldrb r1, [r0] ; r1 = Original r1 080B6E56: 781A ldrb r2, [r3] ; r2 = Original r2 080B6E58: 1C28 add r0, r5, #0x0 ; r0 = Original r0 080B6E5A: F000 bl 080B6E5C: F81D bl 0x080B6E98 ; ? 080B6E5E: 4A0C ldr r2, =#0x00000E94 ; Number of Bytes to transfer 080B6E60: 1C30 add r0, r6, #0x0 ; r6 = Store Address 080B6E62: 1C29 add r1, r5, #0x0 ; r5 = Load Address 080B6E64: F00B bl 080B6E66: F8BE bl 0x080C1FE4 ; Data Transfer 080B6E68: 2000 mov r0, #0x00 080B6E6A: 1C31 add r1, r6, #0x0 080B6E6C: 2201 mov r2, #0x01 080B6E6E: F000 bl 080B6E70: FB75 bl 0x080B755C ; ? 080B6E72: 2001 mov r0, #0x01 080B6E74: 4B07 ldr r3, =#0x00001008 ; Restore old Stack and Exit 080B6E76: 449D add sp, r3 080B6E78: BC70 pop {r4, r5, r6} 080B6E7A: BC02 pop {r1} 080B6E7C: 4708 bx r1 ;DATA ;============= ;080B6E7E: 0000 lsl r0, r0, #0x0 ;080B6E80: EFF8 ??? ;080B6E82: FFFF bl 0x080AFE82 ;080B6E84: 1004 asr r4, r0, #0x0 ;080B6E86: 0000 lsl r0, r0, #0x0 ;080B6E88: 00D4 lsl r4, r2, #0x3 ;080B6E8A: 0400 lsl r0, r0, #0x10 ;080B6E8C: 0800 lsr r0, r0, #0x0 ;080B6E8E: 8100 strh r0, [r0, #0x08] ;080B6E90: 0E94 lsr r4, r2, #0x1A ;080B6E92: 0000 lsl r0, r0, #0x0 ;080B6E94: 1008 asr r0, r1, #0x0 ;080B6E96: 0000 lsl r0, r0, #0x0
$080B6E98 - ?
r0 contains an address. r1 and r2 contain byte sized values.
Through testing, I found out that this has to do with SRAM writing. This is only executed if the Save Data is corrupted (or non-existent). r0 (and later r6) contain #$0203BC10 then (SRAM Buffer?).
080B6E98: B5F0 push {r4, r5, r6, r7, lr} 080B6E9A: 4657 mov r7, r10 080B6E9C: 464E mov r6, r9 080B6E9E: 4645 mov r5, r8 080B6EA0: B4E0 push {r5, r6, r7} 080B6EA2: B084 add sp, #-0x010 080B6EA4: 1C06 add r6, r0, #0x0 080B6EA6: 4668 mov r0, sp 080B6EA8: 7001 strb r1, [r0] ; Store r1 (Byte sized) in a newly added Stack entry 080B6EAA: 466C mov r4, sp 080B6EAC: 3401 add r4, #0x01 080B6EAE: 7022 strb r2, [r4] ; Store r2 (Byte sized) in a newly added Stack entry 080B6EB0: 2500 mov r5, #0x00 080B6EB2: 2007 mov r0, #0x07 080B6EB4: 8030 strh r0, [r6] ; Writes "07" in the first Byte of SRAM(-Buffer?) 080B6EB6: 204D mov r0, #0x4D 080B6EB8: 70B0 strb r0, [r6, #0x02] ; Hexcode for ASCII "M" 080B6EBA: 2056 mov r0, #0x56 080B6EBC: 70F0 strb r0, [r6, #0x03] ; Hexcode for ASCII "V" 080B6EBE: 4668 mov r0, sp 080B6EC0: 7800 ldrb r0, [r0] 080B6EC2: 494D ldr r1, =#0x00000E92 080B6EC4: 1872 add r2, r6, r1 080B6EC6: 2701 mov r7, #0x01 080B6EC8: 1C3B add r3, r7, #0x0 080B6ECA: 4003 and r3, r0 080B6ECC: 7811 ldrb r1, [r2] 080B6ECE: 2002 mov r0, #0x02 080B6ED0: 4240 neg r0, r0 080B6ED2: 4681 mov r9, r0 080B6ED4: 4008 and r0, r1 080B6ED6: 4318 orr r0, r3 080B6ED8: 7010 strb r0, [r2] 080B6EDA: 21E9 mov r1, #0xE9 080B6EDC: 0109 lsl r1, r1, #0x4 080B6EDE: 1870 add r0, r6, r1 080B6EE0: 8801 ldrh r1, [r0] 080B6EE2: 8005 strh r5, [r0] 080B6EE4: 8811 ldrh r1, [r2] 080B6EE6: 2001 mov r0, #0x01 080B6EE8: 4008 and r0, r1 080B6EEA: 8010 strh r0, [r2] 080B6EEC: 7820 ldrb r0, [r4] 080B6EEE: 2800 cmp r0, #0x00 080B6EF0: D100 bne 0x080B6EF4 080B6EF2: E13E b 0x080B7172 080B6EF4: 4841 ldr r0, =#0x0203BB5C 080B6EF6: 6800 ldr r0, [r0] 080B6EF8: 6730 str r0, [r6, #0x70] 080B6EFA: 4A41 ldr r2, =#0x02032700 080B6EFC: 4690 mov r8, r2 080B6EFE: 4841 ldr r0, =#0x00009210 080B6F00: 4440 add r0, r8 080B6F02: 6800 ldr r0, [r0] 080B6F04: 6770 str r0, [r6, #0x74] 080B6F06: 4B40 ldr r3, =#0x0203BB3E 080B6F08: 8818 ldrh r0, [r3] 080B6F0A: 1C31 add r1, r6, #0x0 080B6F0C: 317A add r1, #0x7A 080B6F0E: 8008 strh r0, [r1] 080B6F10: 4C3E ldr r4, =#0x0202D7A0 080B6F12: 483F ldr r0, =#0x0000026A 080B6F14: 1823 add r3, r4, r0 080B6F16: 7818 ldrb r0, [r3] 080B6F18: 06C0 lsl r0, r0, #0x1B 080B6F1A: 1C35 add r5, r6, #0x0 080B6F1C: 357E add r5, #0x7E 080B6F1E: 0FC0 lsr r0, r0, #0x1F 080B6F20: 4038 and r0, r7 080B6F22: 782A ldrb r2, [r5] 080B6F24: 4649 mov r1, r9 080B6F26: 4011 and r1, r2 080B6F28: 4301 orr r1, r0 080B6F2A: 8818 ldrh r0, [r3] 080B6F2C: 05C0 lsl r0, r0, #0x17 080B6F2E: 0F00 lsr r0, r0, #0x1C 080B6F30: 0040 lsl r0, r0, #0x1 080B6F32: 221F mov r2, #0x1F 080B6F34: 4252 neg r2, r2 080B6F36: 4011 and r1, r2 080B6F38: 4301 orr r1, r0 080B6F3A: 4836 ldr r0, =#0x02029CB0 080B6F3C: 308B add r0, #0x8B 080B6F3E: 7800 ldrb r0, [r0] 080B6F40: 0840 lsr r0, r0, #0x1 080B6F42: 4038 and r0, r7 080B6F44: 4038 and r0, r7 080B6F46: 0140 lsl r0, r0, #0x5 080B6F48: 3A02 sub r2, #0x02 080B6F4A: 4011 and r1, r2 080B6F4C: 4301 orr r1, r0 080B6F4E: 7029 strb r1, [r5] 080B6F50: 20FF mov r0, #0xFF 080B6F52: F002 bl 080B6F54: FDB5 bl 0x080B9AC0 080B6F56: 1C39 add r1, r7, #0x0 080B6F58: 4001 and r1, r0 080B6F5A: 0189 lsl r1, r1, #0x6 080B6F5C: 782A ldrb r2, [r5] 080B6F5E: 2041 mov r0, #0x41 080B6F60: 4240 neg r0, r0 080B6F62: 4010 and r0, r2 080B6F64: 4308 orr r0, r1 080B6F66: 7028 strb r0, [r5] 080B6F68: 482B ldr r0, =#0x0200010C 080B6F6A: 7801 ldrb r1, [r0] 080B6F6C: 01C9 lsl r1, r1, #0x7 080B6F6E: 882A ldrh r2, [r5] 080B6F70: 482A ldr r0, =#0xFFFF807F 080B6F72: 4010 and r0, r2 080B6F74: 4308 orr r0, r1 080B6F76: 8028 strh r0, [r5] 080B6F78: 219A mov r1, #0x9A 080B6F7A: 0089 lsl r1, r1, #0x2 080B6F7C: 1864 add r4, r4, r1 080B6F7E: 8821 ldrh r1, [r4] 080B6F80: 1C30 add r0, r6, #0x0 080B6F82: 307C add r0, #0x7C 080B6F84: 8001 strh r1, [r0] 080B6F86: 1C32 add r2, r6, #0x0 080B6F88: 327F add r2, #0x7F 080B6F8A: 7811 ldrb r1, [r2] 080B6F8C: 207F mov r0, #0x7F 080B6F8E: 4008 and r0, r1 080B6F90: 7010 strb r0, [r2] 080B6F92: 4823 ldr r0, =#0x0000944E 080B6F94: 4440 add r0, r8 080B6F96: 7801 ldrb r1, [r0] 080B6F98: 070A lsl r2, r1, #0x1C 080B6F9A: 0FD2 lsr r2, r2, #0x1F 080B6F9C: 06C8 lsl r0, r1, #0x1B 080B6F9E: 0FC0 lsr r0, r0, #0x1F 080B6FA0: 4302 orr r2, r0 080B6FA2: 0689 lsl r1, r1, #0x1A 080B6FA4: 0FC9 lsr r1, r1, #0x1F 080B6FA6: 430A orr r2, r1 080B6FA8: 2A00 cmp r2, #0x00 080B6FAA: D105 bne 0x080B6FB8 080B6FAC: 481D ldr r0, =#0x0000943C 080B6FAE: 4440 add r0, r8 080B6FB0: 8801 ldrh r1, [r0] 080B6FB2: 1C30 add r0, r6, #0x0 080B6FB4: 3078 add r0, #0x78 080B6FB6: 8001 strh r1, [r0] 080B6FB8: 1D34 add r4, r6, #0x4 080B6FBA: 2500 mov r5, #0x00 080B6FBC: 1C32 add r2, r6, #0x0 080B6FBE: 324C add r2, #0x4C 080B6FC0: 9202 str r2, [sp, #0x008] 080B6FC2: 236C mov r3, #0x6C 080B6FC4: 199B add r3, r3, r6 080B6FC6: 4698 mov r8, r3 080B6FC8: 276D mov r7, #0x6D 080B6FCA: 19BF add r7, r7, r6 080B6FCC: 46BA mov r10, r7 080B6FCE: 1C30 add r0, r6, #0x0 080B6FD0: 3080 add r0, #0x80 080B6FD2: 9003 str r0, [sp, #0x00C] 080B6FD4: 490C ldr r1, =#0x0203BB3E 080B6FD6: 8809 ldrh r1, [r1] 080B6FD8: 428D cmp r5, r1 080B6FDA: D300 bcc 0x080B6FDE 080B6FDC: E082 b 0x080B70E4 080B6FDE: 221F mov r2, #0x1F 080B6FE0: 4691 mov r9, r2 080B6FE2: 1C28 add r0, r5, #0x0 080B6FE4: F006 bl 080B6FE6: F99C bl 0x080BD320 080B6FE8: 1C03 add r3, r0, #0x0 080B6FEA: 7898 ldrb r0, [r3, #0x02] 080B6FEC: 07C0 lsl r0, r0, #0x1F 080B6FEE: 2800 cmp r0, #0x00 080B6FF0: D01A beq 0x080B7028 080B6FF2: 7818 ldrb r0, [r3] 080B6FF4: 0680 lsl r0, r0, #0x1A 080B6FF6: E019 b 0x080B702C ;DATA ;=============== ;080B6FF8: 0E92 lsr r2, r2, #0x1A ;080B6FFA: 0000 lsl r0, r0, #0x0 ;080B6FFC: BB5C pop {r2, r3, r4, r6, pc} ;080B7000: 2700 mov r7, #0x00 ;080B7002: 0203 lsl r3, r0, #0x8 ;080B7004: 9210 str r2, [sp, #0x040] ;080B7006: 0000 lsl r0, r0, #0x0 ;080B7008: BB3E pop {r1, r2, r3, r4, r5, pc} ;080B700A: 0203 lsl r3, r0, #0x8 ;080B700C: D7A0 bvc 0x080B6F50 ;080B700E: 0202 lsl r2, r0, #0x8 ;080B7010: 026A lsl r2, r5, #0x9 ;080B7012: 0000 lsl r0, r0, #0x0 ;080B7014: 9CB0 ldr r4, [sp, #0x2C0] ;080B7016: 0202 lsl r2, r0, #0x8 ;080B7018: 010C lsl r4, r1, #0x4 ;080B701A: 0200 lsl r0, r0, #0x8 ;080B701C: 807F strh r7, [r7, #0x02] ;080B701E: FFFF bl 0x0813701E ;080B7020: 944E str r4, [sp, #0x138] ;080B7022: 0000 lsl r0, r0, #0x0 ;080B7024: 943C str r4, [sp, #0x0F0] ;080B7026: 0000 lsl r0, r0, #0x0 ;080B7028: 8818 ldrh r0, [r3] ;080B702A: 04C0 lsl r0, r0, #0x13 080B702C: 0E81 lsr r1, r0, #0x1A 080B702E: 7AA2 ldrb r2, [r4, #0x0A] 080B7030: 2740 mov r7, #0x40 080B7032: 427F neg r7, r7 080B7034: 1C38 add r0, r7, #0x0 080B7036: 4002 and r2, r0 080B7038: 430A orr r2, r1 080B703A: 72A2 strb r2, [r4, #0x0A] 080B703C: 6858 ldr r0, [r3, #0x04] 080B703E: 0240 lsl r0, r0, #0x9 080B7040: 0D80 lsr r0, r0, #0x16 080B7042: 8020 strh r0, [r4] 080B7044: 88D9 ldrh r1, [r3, #0x06] 080B7046: 09C9 lsr r1, r1, #0x7 080B7048: 7A18 ldrb r0, [r3, #0x08] 080B704A: 464F mov r7, r9 080B704C: 4038 and r0, r7 080B704E: 0240 lsl r0, r0, #0x9 080B7050: 4308 orr r0, r1 080B7052: 8060 strh r0, [r4, #0x02] 080B7054: 6898 ldr r0, [r3, #0x08] 080B7056: 0340 lsl r0, r0, #0xD 080B7058: 0C80 lsr r0, r0, #0x12 080B705A: 80A0 strh r0, [r4, #0x04] 080B705C: 68D8 ldr r0, [r3, #0x0C] 080B705E: 0280 lsl r0, r0, #0xA 080B7060: 0E40 lsr r0, r0, #0x19 080B7062: 80E0 strh r0, [r4, #0x06] 080B7064: 8998 ldrh r0, [r3, #0x0C] 080B7066: 0440 lsl r0, r0, #0x11 080B7068: 0C80 lsr r0, r0, #0x12 080B706A: 8120 strh r0, [r4, #0x08] 080B706C: 7858 ldrb r0, [r3, #0x01] 080B706E: 09C0 lsr r0, r0, #0x7 080B7070: 2101 mov r1, #0x01 080B7072: 4008 and r0, r1 080B7074: 0180 lsl r0, r0, #0x6 080B7076: 2741 mov r7, #0x41 080B7078: 427F neg r7, r7 080B707A: 1C39 add r1, r7, #0x0 080B707C: 400A and r2, r1 080B707E: 4302 orr r2, r0 080B7080: 72A2 strb r2, [r4, #0x0A] 080B7082: 2186 mov r1, #0x86 080B7084: 0049 lsl r1, r1, #0x1 080B7086: 1858 add r0, r3, r1 080B7088: 7802 ldrb r2, [r0] 080B708A: 0952 lsr r2, r2, #0x5 080B708C: 01D2 lsl r2, r2, #0x7 080B708E: 8960 ldrh r0, [r4, #0x0A] 080B7090: 4F42 ldr r7, =#0xFFFFFC7F 080B7092: 1C39 add r1, r7, #0x0 080B7094: 4008 and r0, r1 080B7096: 4310 orr r0, r2 080B7098: 8160 strh r0, [r4, #0x0A] 080B709A: 4941 ldr r1, =#0x0000010D 080B709C: 1858 add r0, r3, r1 080B709E: 7801 ldrb r1, [r0] 080B70A0: 0789 lsl r1, r1, #0x1E 080B70A2: 0F09 lsr r1, r1, #0x1C 080B70A4: 7AE2 ldrb r2, [r4, #0x0B] 080B70A6: 270D mov r7, #0x0D 080B70A8: 427F neg r7, r7 080B70AA: 1C38 add r0, r7, #0x0 080B70AC: 4002 and r2, r0 080B70AE: 430A orr r2, r1 080B70B0: 72E2 strb r2, [r4, #0x0B] 080B70B2: 7898 ldrb r0, [r3, #0x02] 080B70B4: 07C0 lsl r0, r0, #0x1F 080B70B6: 0FC0 lsr r0, r0, #0x1F 080B70B8: 2101 mov r1, #0x01 080B70BA: 4008 and r0, r1 080B70BC: 0100 lsl r0, r0, #0x4 080B70BE: 2311 mov r3, #0x11 080B70C0: 425B neg r3, r3 080B70C2: 1C19 add r1, r3, #0x0 080B70C4: 400A and r2, r1 080B70C6: 4302 orr r2, r0 080B70C8: 464F mov r7, r9 080B70CA: 403A and r2, r7 080B70CC: 72E2 strb r2, [r4, #0x0B] 080B70CE: 1C68 add r0, r5, #0x1 080B70D0: 0400 lsl r0, r0, #0x10 080B70D2: 0C05 lsr r5, r0, #0x10 080B70D4: 340C add r4, #0x0C 080B70D6: 4833 ldr r0, =#0x02032700 080B70D8: 4933 ldr r1, =#0x0000943E 080B70DA: 1840 add r0, r0, r1 080B70DC: 8800 ldrh r0, [r0] 080B70DE: 4285 cmp r5, r0 080B70E0: D200 bcs 0x080B70E4 080B70E2: E77E b 0x080B6FE2 080B70E4: 2000 mov r0, #0x00 080B70E6: F006 bl 080B70E8: F91B bl 0x080BD320 080B70EA: 1C03 add r3, r0, #0x0 080B70EC: 9F02 ldr r7, [sp, #0x008] 080B70EE: 7859 ldrb r1, [r3, #0x01] 080B70F0: 0649 lsl r1, r1, #0x19 080B70F2: 0F89 lsr r1, r1, #0x1E 080B70F4: 4640 mov r0, r8 080B70F6: 7802 ldrb r2, [r0] 080B70F8: 2004 mov r0, #0x04 080B70FA: 4240 neg r0, r0 080B70FC: 4010 and r0, r2 080B70FE: 4308 orr r0, r1 080B7100: 4641 mov r1, r8 080B7102: 7008 strb r0, [r1] 080B7104: 8819 ldrh r1, [r3] 080B7106: 04C9 lsl r1, r1, #0x13 080B7108: 0E89 lsr r1, r1, #0x1A 080B710A: 0189 lsl r1, r1, #0x6 080B710C: 8C3A ldrh r2, [r7, #0x20] 080B710E: 4827 ldr r0, =#0xFFFFF03F 080B7110: 4010 and r0, r2 080B7112: 4308 orr r0, r1 080B7114: 8438 strh r0, [r7, #0x20] 080B7116: 4826 ldr r0, =#0x0202D7A0 080B711A: 1880 add r0, r0, r2 080B711C: 220F mov r2, #0x0F 080B711E: 7801 ldrb r1, [r0] 080B7120: 4011 and r1, r2 080B7122: 0089 lsl r1, r1, #0x2 080B7124: 4640 mov r0, r8 080B7126: 7802 ldrb r2, [r0] 080B7128: 203D mov r0, #0x3D 080B712A: 4240 neg r0, r0 080B712C: 4010 and r0, r2 080B712E: 4308 orr r0, r1 080B7130: 4641 mov r1, r8 080B7132: 7008 strb r0, [r1] 080B7134: 4652 mov r2, r10 080B7136: 7811 ldrb r1, [r2] 080B7138: 201F mov r0, #0x1F 080B713A: 4008 and r0, r1 080B713C: 7010 strb r0, [r2] 080B713E: 2500 mov r5, #0x00 080B7140: 1C3C add r4, r7, #0x0 080B7142: 3410 add r4, #0x10 080B7144: 1C1A add r2, r3, #0x0 080B7146: 324C add r2, #0x4C 080B7148: 1961 add r1, r4, r5 080B714A: 0068 lsl r0, r5, #0x1 080B714C: 1810 add r0, r2, r0 080B714E: 8800 ldrh r0, [r0] 080B7150: 7008 strb r0, [r1] 080B7152: 1C68 add r0, r5, #0x1 080B7154: 0400 lsl r0, r0, #0x10 080B7156: 0C05 lsr r5, r0, #0x10 080B7158: 2D0F cmp r5, #0x0F 080B715A: D9F5 bls 0x080B7148 080B715C: 4916 ldr r1, =#0x0202D9D0 080B715E: 1C38 add r0, r7, #0x0 080B7160: 2208 mov r2, #0x08 080B7162: F007 bl 080B7164: FF01 bl 0x080BEF68 080B7166: 4915 ldr r1, =#0x0202C990 080B7168: 22E1 mov r2, #0xE1 080B716A: 0112 lsl r2, r2, #0x4 080B716C: 9803 ldr r0, [sp, #0x00C] 080B716E: F00A bl 080B7170: FF39 bl 0x080C1FE4 080B7172: 4913 ldr r1, =#0x00000E94 080B7174: 1C30 add r0, r6, #0x0 080B7176: F007 bl 080B7178: FD17 bl 0x080BEBA8 080B717A: 9001 str r0, [sp, #0x004] 080B717C: 9801 ldr r0, [sp, #0x004] 080B717E: 43C0 mvn r0, r0 080B7180: 23E9 mov r3, #0xE9 080B7182: 011B lsl r3, r3, #0x4 080B7184: 18F1 add r1, r6, r3 080B7186: 880A ldrh r2, [r1] 080B7188: 8008 strh r0, [r1] 080B718A: B004 add sp, #0x010 080B718C: BC38 pop {r3, r4, r5} 080B718E: 4698 mov r8, r3 080B7190: 46A1 mov r9, r4 080B7192: 46AA mov r10, r5 080B7194: BCF0 pop {r4, r5, r6, r7} 080B7196: BC01 pop {r0} 080B7198: 4700 bx r0 ;DATA ;=========== ;080B719A: 0000 lsl r0, r0, #0x0 ;080B719C: FC7F bl 0x080B7A9C ;080B719E: FFFF bl 0x07D3719E ;080B71A0: 010D lsl r5, r1, #0x4 ;080B71A2: 0000 lsl r0, r0, #0x0 ;080B71A4: 2700 mov r7, #0x00 ;080B71A6: 0203 lsl r3, r0, #0x8 ;080B71A8: 943E str r4, [sp, #0x0F8] ;080B71AA: 0000 lsl r0, r0, #0x0 ;080B71AC: F03F bl ;080B71AE: FFFF bl 0x080F71AE ;080B71B0: D7A0 bvc 0x080B70F4 ;080B71B2: 0202 lsl r2, r0, #0x8 ;080B71B4: 0242 lsl r2, r0, #0x9 ;080B71B6: 0000 lsl r0, r0, #0x0 ;080B71B8: D9D0 bls 0x080B715C ;080B71BA: 0202 lsl r2, r0, #0x8 ;080B71BC: C990 ldmia r1!, {r4, r7} ;080B71BE: 0202 lsl r2, r0, #0x8 ;080B71C0: 0E94 lsr r4, r2, #0x1A ;080B71C2: 0000 lsl r0, r0, #0x0
$080B71C4 - (Stack prep for $080B755C)
This adds and clears #$1000 byte to stack, calls a subroutine at $080B755C, and removes the #$1000 bytes afterwards
080B71C4: B500 push {lr} 080B71C6: 46A4 mov r12, r4 080B71C8: 4C13 ldr r4, =#0xFFFFEFFC 080B71CA: 44A5 add sp, r4 080B71CC: 4664 mov r4, r12 ; Add #$1004 Bytes to stack 080B71CE: 2180 mov r1, #0x80 080B71D0: 0149 lsl r1, r1, #0x5 080B71D2: 4469 add r1, sp ; r1 = sp + #$1000 (the four most far, newly added stack bytes) 080B71D4: 2000 mov r0, #0x00 080B71D6: 8008 strh r0, [r1] ; clear them 080B71D8: 4810 ldr r0, =#0x040000D4 080B71DA: 6001 str r1, [r0] ; Use them as source address 080B71DC: 4669 mov r1, sp 080B71DE: 6041 str r1, [r0, #0x04] ; destination: The other #$1000 newly added stack bytes 080B71E0: 490F ldr r1, =#0x81000800 ; Fixed DMA, 800 Doublebytes 080B71E2: 6081 str r1, [r0, #0x08] ; Start DMA 080B71E4: 6881 ldr r1, [r0, #0x08] 080B71E6: 1C02 add r2, r0, #0x0 080B71E8: 6890 ldr r0, [r2, #0x08] 080B71EA: 2180 mov r1, #0x80 080B71EC: 0609 lsl r1, r1, #0x18 080B71EE: 2800 cmp r0, #0x00 080B71F0: DA03 bge 0x080B71FA 080B71F2: 6890 ldr r0, [r2, #0x08] 080B71F4: 4008 and r0, r1 080B71F6: 2800 cmp r0, #0x00 080B71F8: D1FB bne 0x080B71F2 080B71FA: 20E9 mov r0, #0xE9 080B71FC: 0100 lsl r0, r0, #0x4 080B71FE: 4468 add r0, sp ; r0 = sp + #$0E90 080B7200: 8801 ldrh r1, [r0] 080B7202: 2101 mov r1, #0x01 080B7204: 8001 strh r1, [r0] ; write #$01 at sp + #$E90 080B7206: 2000 mov r0, #0x00 ; r0 = #$00 080B7208: 4669 mov r1, sp ; r1 = sp 080B720A: 2201 mov r2, #0x01 ; r2 = #$01 080B720C: F000 bl 080B720E: F9A6 bl 0x080B755C ; ? 080B7210: 4B04 ldr r3, =#0x00001004 ; Restore old Stack, exit 080B7212: 449D add sp, r3 080B7214: BC01 pop {r0} 080B7216: 4700 bx r0 ;080B7218: EFFC ??? ;080B721A: FFFF bl 0x080B421A ;080B721C: 00D4 lsl r4, r2, #0x3 ;080B721E: 0400 lsl r0, r0, #0x10 ;080B7220: 0800 lsr r0, r0, #0x0 ;080B7222: 8100 strh r0, [r0, #0x08] ;080B7224: 1004 asr r4, r0, #0x0 ;080B7226: 0000 lsl r0, r0, #0x0
$080B7228 - ?
080B7228: B5F0 push {r4, r5, r6, r7, lr} 080B722A: 4647 mov r7, r8 080B722C: B480 push {r7} 080B722E: 4C6A ldr r4, =#0xFFFFDFF8 080B7230: 44A5 add sp, r4 ; Add #$2008 Byte to Stack 080B7232: 0409 lsl r1, r1, #0x10 080B7234: 0C0F lsr r7, r1, #0x10 ; r7 = Orig. r1 AND #$0000FFFF 080B7236: 4869 ldr r0, =#0x02032700 080B7238: 4969 ldr r1, =#0x0000944E 080B723A: 1840 add r0, r0, r1 ; r0 = #$0203BB4E 080B723C: 7800 ldrb r0, [r0] ; r0 = [$0203BB4E] 080B723E: 06C0 lsl r0, r0, #0x1B 080B7240: 0FC0 lsr r0, r0, #0x1F ; r0 = Bit 5 as Bit 4, the rest ist cleared 080B7242: AA02 add r2, sp, #0x008 080B7244: 4690 mov r8, r2 080B7246: 2800 cmp r0, #0x00 080B7248: D12D bne 0x080B72A6 ; If Bit 5 of $0203BB4E is set, a lot is left out 080B724A: 4966 ldr r1, =#0x00002004 080B724C: 4469 add r1, sp 080B724E: 8008 strh r0, [r1] ; Clear Stack Entry 080B7250: 4865 ldr r0, =#0x040000D4 080B7252: 6001 str r1, [r0] ; Cleared Stack Entry is DMA Source 080B7254: 4669 mov r1, sp 080B7256: 6041 str r1, [r0, #0x04] ; Destination: Stack 080B7258: 4964 ldr r1, =#0x81001000 080B725A: 6081 str r1, [r0, #0x08] ; Clear #$1000 Double Bytes on Stack 080B725C: 6881 ldr r1, [r0, #0x08] 080B725E: 1C01 add r1, r0, #0x0 080B7260: 6888 ldr r0, [r1, #0x08] 080B7262: 2280 mov r2, #0x80 080B7264: 0612 lsl r2, r2, #0x18 080B7266: 2800 cmp r0, #0x00 080B7268: DA03 bge 0x080B7272 080B726A: 6888 ldr r0, [r1, #0x08] 080B726C: 4010 and r0, r2 080B726E: 2800 cmp r0, #0x00 080B7270: D1FB bne 0x080B726A 080B7272: 466E mov r6, sp 080B7274: 4668 mov r0, sp 080B7276: F000 bl 080B7278: F8C3 bl 0x080B7400 080B727A: 4644 mov r4, r8 080B727C: 1C20 add r0, r4, #0x0 080B727E: F751 bl 080B7280: FE0B bl 0x08008E98 080B7282: 2180 mov r1, #0x80 080B7284: 0149 lsl r1, r1, #0x5 080B7286: 4668 mov r0, sp 080B7288: F007 bl 080B728A: FC8E bl 0x080BEBA8 080B728C: 2180 mov r1, #0x80 080B728E: 0189 lsl r1, r1, #0x6 080B7290: 4469 add r1, sp 080B7292: 6008 str r0, [r1] 080B7294: 6808 ldr r0, [r1] 080B7296: 43C0 mvn r0, r0 080B7298: 88B1 ldrh r1, [r6, #0x04] 080B729A: 80B0 strh r0, [r6, #0x04] 080B729C: 1C38 add r0, r7, #0x0 080B729E: 4669 mov r1, sp 080B72A0: 2201 mov r2, #0x01 080B72A2: F000 bl 080B72A4: F95B bl 0x080B755C 080B72A6: 1C78 add r0, r7, #0x1 080B72A8: 0400 lsl r0, r0, #0x10 080B72AA: 0C07 lsr r7, r0, #0x10 ; r7 = (Orig. r1 + 1) AND #$0000FFFF 080B72AC: 494D ldr r1, =#0x00002004 080B72AE: 4469 add r1, sp 080B72B0: 2000 mov r0, #0x00 080B72B2: 8008 strh r0, [r1] 080B72B4: 484C ldr r0, =#0x040000D4 080B72B6: 6001 str r1, [r0] 080B72B8: 466A mov r2, sp 080B72BA: 6042 str r2, [r0, #0x04] 080B72BC: 494B ldr r1, =#0x81001000 080B72BE: 6081 str r1, [r0, #0x08] ; Clear #$1000 Double-Bytes of the newly added Stack Entries 080B72C0: 6881 ldr r1, [r0, #0x08] 080B72C2: 1C02 add r2, r0, #0x0 080B72C4: 6890 ldr r0, [r2, #0x08] 080B72C6: 2180 mov r1, #0x80 080B72C8: 0609 lsl r1, r1, #0x18 080B72CA: 2800 cmp r0, #0x00 080B72CC: DA03 bge 0x080B72D6 080B72CE: 6890 ldr r0, [r2, #0x08] 080B72D0: 4008 and r0, r1 080B72D2: 2800 cmp r0, #0x00 080B72D4: D1FB bne 0x080B72CE 080B72D6: 466E mov r6, sp 080B72D8: 4668 mov r0, sp 080B72DA: F000 bl 080B72DC: F891 bl 0x080B7400 080B72DE: 4644 mov r4, r8 080B72E0: 2501 mov r5, #0x01 080B72E2: 0129 lsl r1, r5, #0x4 080B72E4: 1949 add r1, r1, r5 080B72E6: 0109 lsl r1, r1, #0x4 080B72E8: 4841 ldr r0, =#0x02029F50 080B72EA: 1809 add r1, r1, r0 080B72EC: 1C20 add r0, r4, #0x0 080B72EE: 2288 mov r2, #0x88 080B72F0: 0052 lsl r2, r2, #0x1 080B72F2: F00A bl 080B72F4: FE77 bl 0x080C1FE4 080B72F6: 2096 mov r0, #0x96 080B72F8: 0040 lsl r0, r0, #0x1 080B72FA: 1824 add r4, r4, r0 080B72FC: 1C68 add r0, r5, #0x1 080B72FE: 0400 lsl r0, r0, #0x10 080B7300: 0C05 lsr r5, r0, #0x10 080B7302: 2D16 cmp r5, #0x16 080B7304: D9ED bls 0x080B72E2 080B7306: 2480 mov r4, #0x80 080B7308: 01A4 lsl r4, r4, #0x6 080B730A: 4668 mov r0, sp 080B730C: 1C21 add r1, r4, #0x0 080B730E: F007 bl 080B7310: FC4B bl 0x080BEBA8 080B7312: 466A mov r2, sp 080B7314: 1911 add r1, r2, r4 080B7316: 6008 str r0, [r1] 080B7318: 6808 ldr r0, [r1] 080B731A: 43C0 mvn r0, r0 080B731C: 88B1 ldrh r1, [r6, #0x04] 080B731E: 2400 mov r4, #0x00 080B7320: 80B0 strh r0, [r6, #0x04] 080B7322: 1C38 add r0, r7, #0x0 080B7324: 4669 mov r1, sp 080B7326: 2202 mov r2, #0x02 080B7328: F000 bl 080B732A: F918 bl 0x080B755C 080B732C: 1CB8 add r0, r7, #0x2 080B732E: 0400 lsl r0, r0, #0x10 080B7330: 0C07 lsr r7, r0, #0x10 080B7332: 492C ldr r1, =#0x00002004 080B7334: 4469 add r1, sp 080B7336: 800C strh r4, [r1] 080B7338: 482B ldr r0, =#0x040000D4 080B733A: 6001 str r1, [r0] 080B733C: 4669 mov r1, sp 080B733E: 6041 str r1, [r0, #0x04] 080B7340: 492A ldr r1, =#0x81001000 080B7342: 6081 str r1, [r0, #0x08] 080B7344: 6881 ldr r1, [r0, #0x08] 080B7346: 1C02 add r2, r0, #0x0 080B7348: 6890 ldr r0, [r2, #0x08] 080B734A: 2180 mov r1, #0x80 080B734C: 0609 lsl r1, r1, #0x18 080B734E: 2800 cmp r0, #0x00 080B7350: DA03 bge 0x080B735A 080B7352: 6890 ldr r0, [r2, #0x08] 080B7354: 4008 and r0, r1 080B7356: 2800 cmp r0, #0x00 080B7358: D1FB bne 0x080B7352 080B735A: 466E mov r6, sp 080B735C: 4668 mov r0, sp 080B735E: F000 bl 080B7360: F84F bl 0x080B7400 080B7362: 4644 mov r4, r8 080B7364: 2517 mov r5, #0x17 080B7366: 0129 lsl r1, r5, #0x4 080B7368: 1949 add r1, r1, r5 080B736A: 0109 lsl r1, r1, #0x4 080B736C: 4820 ldr r0, =#0x02029F50 080B736E: 1809 add r1, r1, r0 080B7370: 1C20 add r0, r4, #0x0 080B7372: 2288 mov r2, #0x88 080B7374: 0052 lsl r2, r2, #0x1 080B7376: F00A bl 080B7378: FE35 bl 0x080C1FE4 080B737A: 2296 mov r2, #0x96 080B737C: 0052 lsl r2, r2, #0x1 080B737E: 18A4 add r4, r4, r2 080B7380: 1C68 add r0, r5, #0x1 080B7382: 0400 lsl r0, r0, #0x10 080B7384: 0C05 lsr r5, r0, #0x10 080B7386: 2D22 cmp r5, #0x22 080B7388: D9ED bls 0x080B7366 080B738A: 491A ldr r1, =#0x0202D7A0 080B738C: 20A2 mov r0, #0xA2 080B738E: 0080 lsl r0, r0, #0x2 080B7390: 180A add r2, r1, r0 080B7392: 4819 ldr r0, =#0x0203BB5C 080B7394: 6800 ldr r0, [r0] 080B7396: 6010 str r0, [r2] 080B7398: 22A7 mov r2, #0xA7 080B739A: 0092 lsl r2, r2, #0x2 080B739C: 1C20 add r0, r4, #0x0 080B739E: F00A bl 080B73A0: FE21 bl 0x080C1FE4 080B73A2: 2480 mov r4, #0x80 080B73A4: 01A4 lsl r4, r4, #0x6 080B73A6: 4668 mov r0, sp 080B73A8: 1C21 add r1, r4, #0x0 080B73AA: F007 bl 080B73AC: FBFD bl 0x080BEBA8 080B73AE: 466A mov r2, sp 080B73B0: 1911 add r1, r2, r4 080B73B2: 6008 str r0, [r1] 080B73B4: 6808 ldr r0, [r1] 080B73B6: 43C0 mvn r0, r0 080B73B8: 88B1 ldrh r1, [r6, #0x04] 080B73BA: 80B0 strh r0, [r6, #0x04] 080B73BC: 1C38 add r0, r7, #0x0 080B73BE: 4669 mov r1, sp 080B73C0: 2202 mov r2, #0x02 080B73C2: F000 bl 080B73C4: F8CB bl 0x080B755C 080B73C6: 2001 mov r0, #0x01 080B73C8: 4B0C ldr r3, =#0x00002008 080B73CA: 449D add sp, r3 080B73CC: BC08 pop {r3} 080B73CE: 4698 mov r8, r3 080B73D0: BCF0 pop {r4, r5, r6, r7} 080B73D2: BC02 pop {r1} 080B73D4: 4708 bx r1 ;080B73D6: 0000 lsl r0, r0, #0x0 ;080B73D8: DFF8 swi 0xF8 ;080B73DA: FFFF bl 0x080B03DA ;080B73DC: 2700 mov r7, #0x00 ;080B73DE: 0203 lsl r3, r0, #0x8 ;080B73E0: 944E str r4, [sp, #0x138] ;080B73E2: 0000 lsl r0, r0, #0x0 ;080B73E4: 2004 mov r0, #0x04 ;080B73E6: 0000 lsl r0, r0, #0x0 ;080B73E8: 00D4 lsl r4, r2, #0x3 ;080B73EA: 0400 lsl r0, r0, #0x10 ;080B73EC: 1000 asr r0, r0, #0x0 ;080B73EE: 8100 strh r0, [r0, #0x08] ;080B73F0: 9F50 ldr r7, [sp, #0x140] ;080B73F2: 0202 lsl r2, r0, #0x8 ;080B73F4: D7A0 bvc 0x080B7338 ;080B73F6: 0202 lsl r2, r0, #0x8 ;080B73F8: BB5C pop {r2, r3, r4, r6, pc} ;080B73FA: 0203 lsl r3, r0, #0x8 ;080B73FC: 2008 mov r0, #0x08 ;080B73FE: 0000 lsl r0, r0, #0x0
Is r0 an SRAM-address? This looks like the Code that gets stored at the beginning of a Save state ($07 $00, then the ASCII-Letters "MV")
080B7400: 2200 mov r2, #0x00 080B7402: 2107 mov r1, #0x07 080B7404: 8001 strh r1, [r0] ; r0 = #$0007 080B7406: 214D mov r1, #0x4D 080B7408: 7081 strb r1, [r0, #0x02] ; r0 + #$02 = #$4D 080B740A: 2156 mov r1, #0x56 080B740C: 70C1 strb r1, [r0, #0x03] ; r0 + #$03 = #$56 080B740E: 8881 ldrh r1, [r0, #0x04] 080B7410: 8082 strh r2, [r0, #0x04] ; r0 + #$04 = #$0000 080B7412: 4770 bx lr
$080B7414 - (Clear DMA?)
r0 contains a DMA destination address(? If r5 is not changed at 080B7628); this space gets cleared.
080B7414: B570 push {r4, r5, r6, lr} 080B7416: B081 add sp, #-0x004 ; Add 4 bytes to stack 080B7418: 1C05 add r5, r0, #0x0 ; r5 = r0 080B741A: F000 bl 080B741C: F905 bl 0x080B7628 ; JUMP TO THE ADDRESS IN $0203F3CC ; Setup clear DMA 080B741E: 4669 mov r1, sp 080B7420: 2000 mov r0, #0x00 080B7422: 8008 strh r0, [r1] ; clear upper two byte (strH) on stack 080B7424: 4829 ldr r0, =#0x040000D4 ; DMA source address 080B7426: 6001 str r1, [r0] ; Store the address of the last stack entry as DMA Source Address 080B7428: 6045 str r5, [r0, #0x04] ; r5 is the DMA Destination Address 080B742A: 4929 ldr r1, =#0x8100074A ; Transfer #$74A doublebytes, fixed transfer (#$0000) 080B742C: 6081 str r1, [r0, #0x08] ; Store r1 in DMA Word Size/Control registers 080B742E: 6881 ldr r1, [r0, #0x08] 080B7430: 1C02 add r2, r0, #0x0 080B7432: 6890 ldr r0, [r2, #0x08] 080B7434: 2180 mov r1, #0x80 ; Setting up an AND mask for the DMA-Enable-Bit 080B7436: 0609 lsl r1, r1, #0x18 ; r1 = #$80000000 080B7438: 2800 cmp r0, #0x00 080B743A: DA03 bge 0x080B7444 080B743C: 6890 ldr r0, [r2, #0x08] ; Load DMA Word Size/Control registers 080B743E: 4008 and r0, r1 ; Exempt DMA enable bit 080B7440: 2800 cmp r0, #0x00 080B7442: D1FB bne 0x080B743C ; Loop if DMA is still active 080B7444: 2400 mov r4, #0x00 080B7446: 2007 mov r0, #0x07 080B7448: 8028 strh r0, [r5] 080B744A: 204D mov r0, #0x4D 080B744C: 70A8 strb r0, [r5, #0x02] 080B744E: 2056 mov r0, #0x56 080B7450: 70E8 strb r0, [r5, #0x03] 080B7452: 4820 ldr r0, =#0x00000E92 080B7454: 182B add r3, r5, r0 080B7456: 781A ldrb r2, [r3] 080B7458: 2102 mov r1, #0x02 080B745A: 4249 neg r1, r1 ; r1 = #$FFFFFFFD (AND-Mask) 080B745C: 1C08 add r0, r1, #0x0 080B745E: 4010 and r0, r2 ; Remove Bit 1 from value 080B7460: 7018 strb r0, [r3] ; Store back 080B7462: 1C2B add r3, r5, #0x0 080B7464: 336D add r3, #0x6D 080B7466: 781A ldrb r2, [r3] 080B7468: 2011 mov r0, #0x11 080B746A: 4240 neg r0, r0 ; r1 = #$FFFFFFEE (AND-Mask) 080B746C: 4010 and r0, r2 ; Remove bit 0 and bit 4 from value 080B746E: 7018 strb r0, [r3] ; Store back 080B7470: 1C2A add r2, r5, #0x0 080B7472: 327E add r2, #0x7E 080B7474: 7810 ldrb r0, [r2] 080B7476: 4001 and r1, r0 080B7478: 2041 mov r0, #0x41 080B747A: 4240 neg r0, r0 080B747C: 4001 and r1, r0 080B747E: 7011 strb r1, [r2] 080B7480: 4668 mov r0, sp 080B7482: 8004 strh r4, [r0] 080B7484: 4911 ldr r1, =#0x040000D4 080B7486: 6008 str r0, [r1] ; r0 = DMA Source Address 080B7488: 4A13 ldr r2, =#0x0202C990 080B748A: 604A str r2, [r1, #0x04] ; r2 = DMA Destination Address = $0202C990 (WRAM) 080B748C: 4813 ldr r0, =#0x81000708 ; Fixed transfer, 708 Double Bytes 080B748E: 6088 str r0, [r1, #0x08] 080B7490: 6888 ldr r0, [r1, #0x08] 080B7492: 6888 ldr r0, [r1, #0x08] 080B7494: 2380 mov r3, #0x80 ; Set up of an AND mask for the DMA enable bit 080B7496: 061B lsl r3, r3, #0x18 ; r3 = #$80000000 080B7498: 1C16 add r6, r2, #0x0 080B749A: 1C2C add r4, r5, #0x0 080B749C: 3480 add r4, #0x80 080B749E: 2800 cmp r0, #0x00 ; Is the DMA done? 080B74A0: DA04 bge 0x080B74AC 080B74A2: 1C1A add r2, r3, #0x0 ; Transfer AND-mask in r2 080B74A4: 6888 ldr r0, [r1, #0x08] ; Is the DMA Enable Flag still set? 080B74A6: 4010 and r0, r2 080B74A8: 2800 cmp r0, #0x00 080B74AA: D1FB bne 0x080B74A4 ; Loop if DMA is still active 080B74AC: 22E1 mov r2, #0xE1 ; Setup and execution of a Data Transfer 080B74AE: 0112 lsl r2, r2, #0x4 ; r2 = #$00000E10 - Number of Bytes to transfer 080B74B0: 1C20 add r0, r4, #0x0 ; Destination address 080B74B2: 1C31 add r1, r6, #0x0 ; Source address 080B74B4: F00A bl 080B74B6: FD96 bl 0x080C1FE4 ; Data Transfer 080B74B8: 1C28 add r0, r5, #0x0 ; r0 = Original r0 080B74BA: 2100 mov r1, #0x00 ; r1 = #$00 080B74BC: 2200 mov r2, #0x00 ; r2 = #$00 080B74BE: F7FF bl 080B74C0: FCA9 bl 0x080B6E14 ; ? 080B74C2: B001 add sp, #0x004 ; Restore registers and exit 080B74C4: BC70 pop {r4, r5, r6} 080B74C6: BC01 pop {r0} 080B74C8: 4700 bx r0 ;DATA ;========================= ;080B74CA: 0000 lsl r0, r0, #0x0 ;080B74CC: 00D4 lsl r4, r2, #0x3 ;080B74CE: 0400 lsl r0, r0, #0x10 ;080B74D0: 074A lsl r2, r1, #0x1D ;080B74D2: 8100 strh r0, [r0, #0x08] ;080B74D4: 0E92 lsr r2, r2, #0x1A ;080B74D6: 0000 lsl r0, r0, #0x0 ;080B74D8: C990 ldmia r1!, {r4, r7} ;080B74DA: 0202 lsl r2, r0, #0x8 ;080B74DC: 0708 lsl r0, r1, #0x1C ;080B74DE: 8100 strh r0, [r0, #0x08]
$080B74E0: - Is r0 empty?
My new comment:
r0 contains a double byte. If this double byte is empty, r0 gets set to #$01. If it's not empty, r0 is set to #$00. Consider this as: "Is r0 empty?" - Yes (1)/No (0)
My old comment:
; IF THE SIXTH VALUE FROM THE DATA SET -THE ONE THAT WAS STORED IN $0203F3C4 - IS #$xxxx0000, ; r0 IS SET TO #$01, ELSE IT GETS SET TO #$00
080B74E0: B500 push {lr} 080B74E2: F008 bl 080B74E4: FAC9 bl 0x080BFA78 ; Load a set of values according to two SRAM bytes 080B74E6: 0400 lsl r0, r0, #0x10 ; Remove the upper two bytes from the value in $0203F3C4 080B74E8: 2800 cmp r0, #0x00 080B74EA: D101 bne 0x080B74F0 080B74EC: 2001 mov r0, #0x01 080B74EE: E000 b 0x080B74F2 080B74F0: 2000 mov r0, #0x00 080B74F2: BC02 pop {r1} 080B74F4: 4708 bx r1 ;080B74F6: 0000 lsl r0, r0, #0x0
$080B74F8: - (Load data from SRAM to WRAM, check flawless transfer)
080B74F8: B5F0 push {r4, r5, r6, r7, lr} 080B74FA: 4647 mov r7, r8 080B74FC: B480 push {r7} 080B74FE: B081 add sp, #-0x004 080B7500: 1C0D add r5, r1, #0x0 ; r5 = r1 080B7502: 0400 lsl r0, r0, #0x10 080B7504: 0C04 lsr r4, r0, #0x10 ; r4 = r0 + AND #$0000FFFF 080B7506: 0412 lsl r2, r2, #0x10 ; r2 = r2 * 10000 080B7508: 4812 ldr r0, =#0xFFFF0000 080B750A: 1812 add r2, r2, r0 ; Is the same as if $10000 were subtracted 080B750C: 0C10 lsr r0, r2, #0x10 080B750E: 4912 ldr r1, =#0x0000FFFF 080B7510: 4288 cmp r0, r1 080B7512: D018 beq 0x080B7546 ; Branch r2 was originally 0 (overbranches the whole stuff, sets signal, exits) 080B7514: 4688 mov r8, r1 ; r8 = #$0000FFFF 080B7516: 1E47 sub r7, r0, #0x1 080B7518: 1C66 add r6, r4, #0x1 080B751A: 1C20 add r0, r4, #0x0 080B751C: 2100 mov r1, #0x00 080B751E: 1C2A add r2, r5, #0x0 080B7520: 2380 mov r3, #0x80 080B7522: 015B lsl r3, r3, #0x5 ; r3 = $1000 080B7524: F008 bl 080B7526: FC0C bl 0x080BFD40 ; - Set SRAM Wait control, copy Code from ROM to RAM, execute it (transfer from SRAM to WRAM) 080B7528: 1C20 add r0, r4, #0x0 080B752A: 1C29 add r1, r5, #0x0 080B752C: F008 bl 080B752E: FC5E bl 0x080BFDEC ; - Set SRAM Wait control, copy Code from ROM to RAM, execute it (compare SRAM with before transfered data) 080B7530: 2800 cmp r0, #0x00 080B7532: D1F2 bne 0x080B751A ; Loop if the transfer was not successful and there is a difference between SRAM code and it's copy in WRAM 080B7534: 0430 lsl r0, r6, #0x10 080B7536: 0C04 lsr r4, r0, #0x10 080B7538: 2080 mov r0, #0x80 080B753A: 0140 lsl r0, r0, #0x5 ; r0 = #$00001000 080B753C: 182D add r5, r5, r0 ; with this, now the address of the transfered and compared data is in r5 080B753E: 0438 lsl r0, r7, #0x10 080B7540: 0C00 lsr r0, r0, #0x10 080B7542: 4540 cmp r0, r8 080B7544: D1E7 bne 0x080B7516 080B7546: 2001 mov r0, #0x01 080B7548: B001 add sp, #0x004 080B754A: BC08 pop {r3} 080B754C: 4698 mov r8, r3 080B754E: BCF0 pop {r4, r5, r6, r7} 080B7550: BC02 pop {r1} 080B7552: 4708 bx r1 ;080B7554: 0000 lsl r0, r0, #0x0 ;080B7556: FFFF bl 0x080B8556 ;080B7558: FFFF bl 0x080B7558 ;080B755A: 0000 lsl r0, r0, #0x0
$080B755C - ?
080B755C: B5F0 push {r4, r5, r6, r7, lr} 080B755E: 464F mov r7, r9 080B7560: 4646 mov r6, r8 080B7562: B4C0 push {r6, r7} 080B7564: B081 add sp, #-0x004 080B7566: 1C0D add r5, r1, #0x0 ; r5 = r1 080B7568: 0400 lsl r0, r0, #0x10 080B756A: 0C04 lsr r4, r0, #0x10 ; r4 = r0 (Upper Doublebyte removed) 080B756C: 0412 lsl r2, r2, #0x10 080B756E: 4815 ldr r0, =#0xFFFF0000 080B7570: 1812 add r2, r2, r0 080B7572: 0C10 lsr r0, r2, #0x10 ; r0 = r2 - 1 (Upper Doublebyte removed) 080B7574: 4914 ldr r1, =#0x0000FFFF 080B7576: 4288 cmp r0, r1 080B7578: D01C beq 0x080B75B4 ; If r2 was 0, set r0 = #$01 and exit 080B757A: 4A14 ldr r2, =#0x0203F3C0 080B757C: 4690 mov r8, r2 080B757E: 4689 mov r9, r1 080B7580: 1E47 sub r7, r0, #0x1 080B7582: 1C66 add r6, r4, #0x1 080B7584: 4640 mov r0, r8 080B7586: 6802 ldr r2, [r0] 080B7588: 1C20 add r0, r4, #0x0 080B758A: 1C29 add r1, r5, #0x0 080B758C: F008 bl 080B758E: FFEE bl 0x080C056C ; bx r2 080B7590: 0400 lsl r0, r0, #0x10 080B7592: 2800 cmp r0, #0x00 080B7594: D1F6 bne 0x080B7584 080B7596: 1C20 add r0, r4, #0x0 080B7598: 1C29 add r1, r5, #0x0 080B759A: F008 bl 080B759C: FC27 bl 0x080BFDEC 080B759E: 2800 cmp r0, #0x00 080B75A0: D1F9 bne 0x080B7596 080B75A2: 0430 lsl r0, r6, #0x10 080B75A4: 0C04 lsr r4, r0, #0x10 080B75A6: 2280 mov r2, #0x80 080B75A8: 0152 lsl r2, r2, #0x5 080B75AA: 18AD add r5, r5, r2 080B75AC: 0438 lsl r0, r7, #0x10 080B75AE: 0C00 lsr r0, r0, #0x10 080B75B0: 4548 cmp r0, r9 080B75B2: D1E5 bne 0x080B7580 080B75B4: 2001 mov r0, #0x01 080B75B6: B001 add sp, #0x004 080B75B8: BC18 pop {r3, r4} 080B75BA: 4698 mov r8, r3 080B75BC: 46A1 mov r9, r4 080B75BE: BCF0 pop {r4, r5, r6, r7} 080B75C0: BC02 pop {r1} 080B75C2: 4708 bx r1 ;080B75C4: 0000 lsl r0, r0, #0x0 ;080B75C6: FFFF bl 0x080B85C6 ;080B75C8: FFFF bl 0x080B75C8 ;080B75CA: 0000 lsl r0, r0, #0x0 ;080B75CC: F3C0 bl ;080B75CE: 0203 lsl r3, r0, #0x8
$080B7628 - ?
Jumps to the address that is in $0203F3CC
080B7628: B500 push {lr} 080B762A: 4803 ldr r0, =#0x0203F3CC ; r0 = #$0203F3CC (WRAM address) 080B762C: 6800 ldr r0, [r0] ; r0 = $0203F3CC 080B762E: F008 bl 080B7630: FF99 bl 0x080C0564 ; bx r0 = jump to the address in r0 080B7632: BC01 pop {r0} 080B7634: 4700 bx r0 ;080B7636: 0000 lsl r0, r0, #0x0 ;080B7638: F3CC bl ;080B763A: 0203 lsl r3, r0, #0x8
$080B776C - ?
080B776C: 1C03 add r3, r0, #0x0 080B776E: 3344 add r3, #0x44 080B7770: 7819 ldrb r1, [r3] 080B7772: 2201 mov r2, #0x01 080B7774: 4311 orr r1, r2 080B7776: 7019 strb r1, [r3] ; Set Bit 0 of Orig. r0 + #$44 080B7778: 303F add r0, #0x3F 080B777A: 2100 mov r1, #0x00 080B777C: 7001 strb r1, [r0] ; Clear Orig. r0 + #3F 080B777E: 4770 bx lr
$080B7EE4 - Is [r0] = ..4A564D?
r0 contains an address. If the last three byte of the address's content is #$4A564D, r0 is set to #$01, else it is clear.
080B7EE4: 6800 ldr r0, [r0] ; Load value from the address in r0 080B7EE6: 4903 ldr r1, =#0x00FFFFFF 080B7EE8: 4008 and r0, r1 ; Remove Most Significant Byte 080B7EEA: 4903 ldr r1, =#0x004A564D 080B7EEC: 4288 cmp r0, r1 ; Compare to #$4A564D 080B7EEE: D105 bne 0x080B7EFC 080B7EF0: 2001 mov r0, #0x01 ; "Set Flag" in r0 if equal 080B7EF2: E004 b 0x080B7EFE ;080B7EF4: FFFF bl 0x080BCEF4 ;080B7EF6: 00FF lsl r7, r7, #0x3 ;080B7EF8: 564D ldsb r5, [r1, r1] ;080B7EFA: 004A lsl r2, r1, #0x1 080B7EFC: 2000 mov r0, #0x00 ; "Clear Flag" in r0 if not equal 080B7EFE: 4770 bx lr
$080B8228 - ?
080B8228: B530 push {r4, r5, lr} 080B822A: B081 add sp, #-0x004 080B822C: 1C05 add r5, r0, #0x0 080B822E: 4668 mov r0, sp 080B8230: 7001 strb r1, [r0] 080B8232: 4C0F ldr r4, =#0x02032700 080B8234: 480F ldr r0, =#0x00009451 080B8236: 1822 add r2, r4, r0 080B8238: 7811 ldrb r1, [r2] 080B823A: 2011 mov r0, #0x11 080B823C: 4240 neg r0, r0 080B823E: 4008 and r0, r1 080B8240: 7010 strb r0, [r2] 080B8242: 480D ldr r0, =#0x00003E94 080B8244: 1824 add r4, r4, r0 080B8246: 490D ldr r1, =#0x080C29CC 080B8248: 1C20 add r0, r4, #0x0 080B824A: 2202 mov r2, #0x02 080B824C: F005 bl 080B824E: FDD6 bl 0x080BDDFC 080B8250: 490B ldr r1, =#0x080B82E9 080B8252: 1C20 add r0, r4, #0x0 080B8254: F005 bl 080B8256: FEE4 bl 0x080BE020 080B8258: 4668 mov r0, sp 080B825A: 7800 ldrb r0, [r0] 080B825C: 2800 cmp r0, #0x00 080B825E: D003 beq 0x080B8268 080B8260: 1C28 add r0, r5, #0x0 080B8262: 2100 mov r1, #0x00 080B8264: F7F0 bl 080B8266: FF8E bl 0x080A9184 080B8268: B001 add sp, #0x004 080B826A: BC30 pop {r4, r5} 080B826C: BC01 pop {r0} 080B826E: 4700 bx r0 ;080B8270: 2700 mov r7, #0x00 ;080B8272: 0203 lsl r3, r0, #0x8 ;080B8274: 9451 str r4, [sp, #0x144] ;080B8276: 0000 lsl r0, r0, #0x0 ;080B8278: 3E94 sub r6, #0x94 ;080B827A: 0000 lsl r0, r0, #0x0 ;080B827C: 29CC cmp r1, #0xCC ;080B827E: 080C lsr r4, r1, #0x0 ;080B8280: 82E9 strh r1, [r5, #0x16] ;080B8282: 080B lsr r3, r1, #0x0
$080B8284 - ?
080B8284: B510 push {r4, lr} 080B8286: B081 add sp, #-0x004 080B8288: 1C02 add r2, r0, #0x0 ; r2 = Orig. r0 080B828A: 4668 mov r0, sp 080B828C: 7001 strb r1, [r0] 080B828E: 480D ldr r0, =#0x00003AD1 080B8290: 1811 add r1, r2, r0 080B8292: 7808 ldrb r0, [r1] ; r0 = [Orig. r0 + #$3AD1] 080B8294: 283F cmp r0, #0x3F 080B8296: D101 bne 0x080B829C 080B8298: 8E90 ldrh r0, [r2, #0x34] 080B829A: 7008 strb r0, [r1] 080B829C: 480A ldr r0, =#0x000037C4 080B829E: 1812 add r2, r2, r0 080B82A0: 7811 ldrb r1, [r2] ; r1 = [Orig. r0 + #$37C4] 080B82A2: 2002 mov r0, #0x02 080B82A4: 4240 neg r0, r0 080B82A6: 4008 and r0, r1 080B82A8: 7010 strb r0, [r2] 080B82AA: 4668 mov r0, sp 080B82AC: 7800 ldrb r0, [r0] 080B82AE: 2800 cmp r0, #0x00 080B82B0: D00E beq 0x080B82D0 080B82B2: 4C06 ldr r4, =#0x0203654C 080B82B4: 1C20 add r0, r4, #0x0 080B82B6: F7FF bl 080B82B8: FA59 bl 0x080B776C 080B82BA: 3448 add r4, #0x48 080B82BC: 1C20 add r0, r4, #0x0 080B82BE: F005 bl 080B82C0: FDD9 bl 0x080BDE74 ; ? 080B82C2: E00A b 0x080B82DA ; Exit ;080B82C4: 3AD1 sub r2, #0xD1 ;080B82C6: 0000 lsl r0, r0, #0x0 ;080B82C8: 37C4 add r7, #0xC4 ;080B82CA: 0000 lsl r0, r0, #0x0 ;080B82CC: 654C str r4, [r1, #0x54] ;080B82CE: 0203 lsl r3, r0, #0x8 080B82D0: 4804 ldr r0, =#0x0203654C 080B82D2: 2104 mov r1, #0x04 080B82D4: 2200 mov r2, #0x00 080B82D6: F7FF bl 080B82D8: FA53 bl 0x080B7780 ; ? 080B82DA: B001 add sp, #0x004 080B82DC: BC10 pop {r4} 080B82DE: BC01 pop {r0} 080B82E0: 4700 bx r0 ;080B82E2: 0000 lsl r0, r0, #0x0 ;080B82E4: 654C str r4, [r1, #0x54] ;080B82E6: 0203 lsl r3, r0, #0x8
$080B9AC0 - ?
In the end, r0 will contain a "flag value", either 0 or 1.
080B9AC0: 0402 lsl r2, r0, #0x10 080B9AC2: 0C11 lsr r1, r2, #0x10 ; r1 = Original r0 AND #$0000FFFF 080B9AC4: 480A ldr r0, =#0x0000011F 080B9AC6: 4281 cmp r1, r0 ; Is it higher than #$011F? 080B9AC8: D810 bhi 0x080B9AEC ; If it is, "Clear Flag in r0" and exit 080B9ACA: 0D12 lsr r2, r2, #0x14 ; r2 now contains everything but the lowest nybble of the value (#$00 - #$11) 080B9ACC: 200F mov r0, #0x0F 080B9ACE: 4008 and r0, r1 ; r0 contains now the missing lowest nybble 080B9AD0: 2180 mov r1, #0x80 080B9AD2: 0249 lsl r1, r1, #0x9 ; r1 = #$00010000 080B9AD4: 4081 lsl r1, r0 ; ? 080B9AD6: 0C09 lsr r1, r1, #0x10 ; ? 080B9AD8: 4806 ldr r0, =#0x0202D7A0 080B9ADA: 0052 lsl r2, r2, #0x1 ; r2 now must be something even between #$00 and #$22 080B9ADC: 2391 mov r3, #0x91 080B9ADE: 009B lsl r3, r3, #0x2 ; r3 = #$00000244 080B9AE0: 18C0 add r0, r0, r3 ; r0 = #$0202D9E4 080B9AE2: 1812 add r2, r2, r0 ; r2 = Something even numbered betw. #$0202D9E4 and #$0202DA06 080B9AE4: 8810 ldrh r0, [r2] 080B9AE6: 4001 and r1, r0 ; ? 080B9AE8: 2900 cmp r1, #0x00 : ? 080B9AEA: D105 bne 0x080B9AF8 ; Equal: Clear Flag, unequal: Set Flag 080B9AEC: 2000 mov r0, #0x00 ; Clear Flag in r0 080B9AEE: E004 b 0x080B9AFA ;DATA ;========== ;080B9AF0: 011F lsl r7, r3, #0x4 ;080B9AF2: 0000 lsl r0, r0, #0x0 ;080B9AF4: D7A0 bvc 0x080B9A38 ;080B9AF6: 0202 lsl r2, r0, #0x8 080B9AF8: 2001 mov r0, #0x01 ; Set Flag in r0 080B9AFA: 4770 bx lr
$080B9B28 - ?
080B9B28: B081 add sp, #-0x004 ; Add new Stack Entry 080B9B2A: 0402 lsl r2, r0, #0x10 080B9B2C: 0C13 lsr r3, r2, #0x10 ; r3 = Orig. r0 AND #$0000FFFF 080B9B2E: 4668 mov r0, sp 080B9B30: 7001 strb r1, [r0] ; New Stack Entry = Orig. r1 080B9B32: 480C ldr r0, =#0x0000011F 080B9B34: 4283 cmp r3, r0 080B9B36: D822 bhi 0x080B9B7E ; Exit if Orig. r0 > #$011F 080B9B38: 0D12 lsr r2, r2, #0x14 ; r2 = Orig. r0's Bits 4 to 15 in Bits 0 to 11 080B9B3A: 210F mov r1, #0x0F 080B9B3C: 4019 and r1, r3 ; r1 = Orig. r0's Bits 0 to 3 080B9B3E: 2080 mov r0, #0x80 080B9B40: 0240 lsl r0, r0, #0x9 ; r0 = #$10000 080B9B42: 4088 lsl r0, r1 ; ??? 080B9B44: 0C03 lsr r3, r0, #0x10 080B9B46: 4668 mov r0, sp 080B9B48: 7800 ldrb r0, [r0] 080B9B4A: 2800 cmp r0, #0x00 080B9B4C: D00E beq 0x080B9B6C 080B9B4E: 4806 ldr r0, =#0x0202D7A0 080B9B50: 0051 lsl r1, r2, #0x1 080B9B52: 2291 mov r2, #0x91 080B9B54: 0092 lsl r2, r2, #0x2 080B9B56: 1880 add r0, r0, r2 080B9B58: 1809 add r1, r1, r0 080B9B5A: 880A ldrh r2, [r1] 080B9B5C: 1C18 add r0, r3, #0x0 080B9B5E: 4310 orr r0, r2 080B9B60: E00C b 0x080B9B7C ;080B9B62: 0000 lsl r0, r0, #0x0 ;080B9B64: 011F lsl r7, r3, #0x4 ;080B9B66: 0000 lsl r0, r0, #0x0 ;080B9B68: D7A0 bvc 0x080B9AAC ;080B9B6A: 0202 lsl r2, r0, #0x8 080B9B6C: 4805 ldr r0, =#0x0202D7A0 080B9B6E: 0051 lsl r1, r2, #0x1 080B9B70: 2291 mov r2, #0x91 080B9B72: 0092 lsl r2, r2, #0x2 080B9B74: 1880 add r0, r0, r2 080B9B76: 1809 add r1, r1, r0 080B9B78: 8808 ldrh r0, [r1] 080B9B7A: 4398 bic r0, r3 080B9B7C: 8008 strh r0, [r1] 080B9B7E: B001 add sp, #0x004 080B9B80: 4770 bx lr ;080B9B82: 0000 lsl r0, r0, #0x0 ;080B9B84: D7A0 bvc 0x080B9AC8 ;080B9B86: 0202 lsl r2, r0, #0x8
$080B9B88 - ?
r0 contains an address, r1 a 16-bit-value.
080B9B88: B530 push {r4, r5, lr} 080B9B8A: B081 add sp, #-0x004 ; Add new Stack Entry 080B9B8C: 1C03 add r3, r0, #0x0 ; r3 = Orig. r0 080B9B8E: 0409 lsl r1, r1, #0x10 080B9B90: 0C0D lsr r5, r1, #0x10 ; r5 = Orig. r1 AND #$0000FFFF 080B9B92: 4669 mov r1, sp 080B9B94: 2000 mov r0, #0x00 080B9B96: 8008 strh r0, [r1] ; Clear newly added Stack Entry 080B9B98: 4914 ldr r1, =#0x040000D4 080B9B9A: 4668 mov r0, sp 080B9B9C: 6008 str r0, [r1] ; Stack Entry as DMA Source 080B9B9E: 4A14 ldr r2, =#0x00001964 080B9BA0: 1898 add r0, r3, r2 080B9BA2: 6048 str r0, [r1, #0x04] ; DMA Destination: Orig. r0 + #$1964 080B9BA4: 4813 ldr r0, =#0x81000AF0 080B9BA6: 6088 str r0, [r1, #0x08] ; Fixed DMA, clear $0AF0 Double Bytes 080B9BA8: 6888 ldr r0, [r1, #0x08] 080B9BAA: 6888 ldr r0, [r1, #0x08] 080B9BAC: 2280 mov r2, #0x80 080B9BAE: 0612 lsl r2, r2, #0x18 080B9BB0: 2800 cmp r0, #0x00 080B9BB2: DA03 bge 0x080B9BBC 080B9BB4: 6888 ldr r0, [r1, #0x08] 080B9BB6: 4010 and r0, r2 080B9BB8: 2800 cmp r0, #0x00 080B9BBA: D1FB bne 0x080B9BB4 080B9BBC: 480E ldr r0, =#0x00003ACC 080B9BBE: 181C add r4, r3, r0 080B9BC0: 2000 mov r0, #0x00 080B9BC2: 8020 strh r0, [r4] ; Orig. r0 + #$3ACC = #$0000 080B9BC4: 2D02 cmp r5, #0x02 080B9BC6: D806 bhi 0x080B9BD6 ; Leave bx r1 out if Orig. r1 > #$02 (invalid Jump Table Entry number) 080B9BC8: 480C ldr r0, =#0x08699A78 ; Jump Table Offset 080B9BCA: 00A9 lsl r1, r5, #0x2 ; Jump Table Index 080B9BCC: 1809 add r1, r1, r0 ; Form Address of Jump Table Entry 080B9BCE: 6809 ldr r1, [r1] ; Load address from Jump Table 080B9BD0: 1C18 add r0, r3, #0x0 ; r0 = Orig. r0 080B9BD2: F006 bl 080B9BD4: FCC9 bl 0x080C0568 ; bx r1 080B9BD6: 480A ldr r0, =#0x02029CB0 080B9BD8: 8821 ldrh r1, [r4] ; r1 = Orig. r0 + #$3ACC( = #$0000?) 080B9BDA: 22BC mov r2, #0xBC 080B9BDC: 0052 lsl r2, r2, #0x1 080B9BDE: 1880 add r0, r0, r2 ; r0 = #$02029E28 080B9BE0: 7001 strb r1, [r0] ; $02029E28 = #$0000(???) 080B9BE2: B001 add sp, #0x004 ; Remove added Stack Entry 080B9BE4: BC30 pop {r4, r5} 080B9BE6: BC01 pop {r0} 080B9BE8: 4700 bx r0 ;080B9BEA: 0000 lsl r0, r0, #0x0 ;080B9BEC: 00D4 lsl r4, r2, #0x3 ;080B9BEE: 0400 lsl r0, r0, #0x10 ;080B9BF0: 1964 add r4, r4, r5 ;080B9BF2: 0000 lsl r0, r0, #0x0 ;080B9BF4: 0AF0 lsr r0, r6, #0xB ;080B9BF6: 8100 strh r0, [r0, #0x08] ;080B9BF8: 3ACC sub r2, #0xCC ;080B9BFA: 0000 lsl r0, r0, #0x0 ;080B9BFC: 9A78 ldr r2, [sp, #0x1E0] ;080B9BFE: 0869 lsr r1, r5, #0x1 ;080B9C00: 9CB0 ldr r4, [sp, #0x2C0] ;080B9C02: 0202 lsl r2, r0, #0x8
$080BA39C - ?
080BA39C: B570 push {r4, r5, r6, lr} 080BA39E: 1C05 add r5, r0, #0x0 080BA3A0: 1C0E add r6, r1, #0x0 080BA3A2: 7BB4 ldrb r4, [r6, #0x0E] 080BA3A4: 07E1 lsl r1, r4, #0x1F 080BA3A6: 2032 mov r0, #0x32 080BA3A8: 1940 add r0, r0, r5 080BA3AA: 4684 mov r12, r0 080BA3AC: 0FC9 lsr r1, r1, #0x1F 080BA3AE: 0189 lsl r1, r1, #0x6 080BA3B0: 7802 ldrb r2, [r0] 080BA3B2: 2041 mov r0, #0x41 080BA3B4: 4240 neg r0, r0 080BA3B6: 4010 and r0, r2 080BA3B8: 4308 orr r0, r1 080BA3BA: 7B73 ldrb r3, [r6, #0x0D] 080BA3BC: 0719 lsl r1, r3, #0x1C 080BA3BE: 0F89 lsr r1, r1, #0x1E 080BA3C0: 2204 mov r2, #0x04 080BA3C2: 4252 neg r2, r2 080BA3C4: 4010 and r0, r2 080BA3C6: 4308 orr r0, r1 080BA3C8: 091B lsr r3, r3, #0x4 080BA3CA: 009B lsl r3, r3, #0x2 080BA3CC: 213D mov r1, #0x3D 080BA3CE: 4249 neg r1, r1 080BA3D0: 4008 and r0, r1 080BA3D2: 4318 orr r0, r3 080BA3D4: 4661 mov r1, r12 080BA3D6: 7008 strb r0, [r1] 080BA3D8: 8A30 ldrh r0, [r6, #0x10] 080BA3DA: 8628 strh r0, [r5, #0x30] 080BA3DC: 0664 lsl r4, r4, #0x19 080BA3DE: 0EA4 lsr r4, r4, #0x1A 080BA3E0: 0164 lsl r4, r4, #0x5 080BA3E2: 8EA9 ldrh r1, [r5, #0x34] 080BA3E4: 4813 ldr r0, =#0xFFFFF81F 080BA3E6: 4008 and r0, r1 080BA3E8: 4320 orr r0, r4 080BA3EA: 86A8 strh r0, [r5, #0x34] 080BA3EC: 2200 mov r2, #0x00 080BA3EE: 4812 ldr r0, =#0x0000FFFF 080BA3F0: 1C03 add r3, r0, #0x0 080BA3F2: 0050 lsl r0, r2, #0x1 080BA3F4: 1828 add r0, r5, r0 080BA3F6: 8801 ldrh r1, [r0] 080BA3F8: 4319 orr r1, r3 080BA3FA: 8001 strh r1, [r0] 080BA3FC: 1C50 add r0, r2, #0x1 080BA3FE: 0400 lsl r0, r0, #0x10 080BA400: 0C02 lsr r2, r0, #0x10 080BA402: 2A07 cmp r2, #0x07 080BA404: D9F5 bls 0x080BA3F2 080BA406: 1C28 add r0, r5, #0x0 080BA408: 1C31 add r1, r6, #0x0 080BA40A: 2206 mov r2, #0x06 080BA40C: F004 bl 080BA40E: FDAC bl 0x080BEF68 080BA410: 2200 mov r2, #0x00 ; Setup Loop Counter 080BA412: 1C2C add r4, r5, #0x0 080BA414: 3410 add r4, #0x10 080BA416: 1C33 add r3, r6, #0x0 080BA418: 3312 add r3, #0x12 080BA41A: 0051 lsl r1, r2, #0x1 080BA41C: 1861 add r1, r4, r1 080BA41E: 1898 add r0, r3, r2 080BA420: 7800 ldrb r0, [r0] 080BA422: 8008 strh r0, [r1] 080BA424: 1C50 add r0, r2, #0x1 ; Increment Loop Counter 080BA426: 0400 lsl r0, r0, #0x10 080BA428: 0C02 lsr r2, r0, #0x10 080BA42A: 2A0F cmp r2, #0x0F 080BA42C: D9F5 bls 0x080BA41A 080BA42E: BC70 pop {r4, r5, r6} 080BA430: BC01 pop {r0} 080BA432: 4700 bx r0 ;080BA434: F81F bl 0x07FBA474 ;080BA436: FFFF bl 0x080DA436 ;080BA438: FFFF bl 0x080BA438 ;080BA43A: 0000 lsl r0, r0, #0x0
$080BA630 - (Is Bit 6 of $0202B270/380/490/5A0 set?)
Test if Bit 6 is set in these four registers: $0202B270/380/490/5A0. If it is, return r0 = #$01. If none of the four Bits are set, return r0 = #$00.
080BA630: 2112 mov r1, #0x12 080BA632: 4A05 ldr r2, =#0x02029F50 080BA634: 0108 lsl r0, r1, #0x4 ; r0 = r1 * #$10 = #$120/#$130/#$140/#$150 080BA636: 1840 add r0, r0, r1 ; r0 = r1 * #$11 = #$132/#$143/#$154/#$165 080BA638: 0100 lsl r0, r0, #0x4 ; r0 = r1 * #$110 = #$1320/#$1430/#$1540/#$1650 080BA63A: 1880 add r0, r0, r2 ; r0 = #$0202B270/380/490/5A0 080BA63C: 7800 ldrb r0, [r0] ; r0 = $0202B270/380/490/5A0 080BA63E: 0640 lsl r0, r0, #0x19 080BA640: 2800 cmp r0, #0x00 ; Is Bit 6 of $0202B270 clear? 080BA642: DA03 bge 0x080BA64C ; Branch if it is 080BA644: 2001 mov r0, #0x01 ; If not found, return r0 = #$01 080BA646: E007 b 0x080BA658 ;080BA648: 9F50 ldr r7, [sp, #0x140] ;080BA64A: 0202 lsl r2, r0, #0x8 080BA64C: 1C48 add r0, r1, #0x1 080BA64E: 0400 lsl r0, r0, #0x10 080BA650: 0C01 lsr r1, r0, #0x10 ; r1 = r1 + 1 AND #$0000FFFF 080BA652: 2916 cmp r1, #0x16 080BA654: D9EE bls 0x080BA634 ; Repeat this look up until r1 exceeds #$16 080BA656: 2000 mov r0, #0x00 ; If not found, return r0 = #$00 080BA658: 4770 bx lr
$080BA6B0 - ?
080BA6B0: 4A05 ldr r2, =#0x0202D7A0 080BA6B2: 212E mov r1, #0x2E 080BA6B4: 5E50 ldsh r0, [r2, r1] ; r0 = $0202D7CE(?) 080BA6B6: 2862 cmp r0, #0x62 080BA6B8: DC02 bgt 0x080BA6C0 ; r0 = #$01 and exit if r0 > #$62 080BA6BA: 2100 mov r1, #0x00 080BA6BC: 2800 cmp r0, #0x00 080BA6BE: DD00 ble 0x080BA6C2 ; r0 = #$00 and exit if r0 < #$01 080BA6C0: 2101 mov r1, #0x01 ; Else: r0 = #$01 080BA6C2: 1C08 add r0, r1, #0x0 080BA6C4: 4770 bx lr ;080BA6C6: 0000 lsl r0, r0, #0x0 ;080BA6C8: D7A0 bvc 0x080BA60C ;080BA6CA: 0202 lsl r2, r0, #0x8
$080BA678 - ?
080BA678: 4A05 ldr r2, =#0x0202D7A0 080BA67A: 211C mov r1, #0x1C 080BA67C: 5E50 ldsh r0, [r2, r1] ; r0 = $0202D7BC(?) 080BA67E: 2862 cmp r0, #0x62 080BA680: DC02 bgt 0x080BA688 ; r0 = #$01 and exit if r0 > #$62 080BA682: 2100 mov r1, #0x00 080BA684: 2800 cmp r0, #0x00 080BA686: DD00 ble 0x080BA68A ; r0 = #$00 and exit if r0 < #$01 080BA688: 2101 mov r1, #0x01 ; Else: r0 = #$01 080BA68A: 1C08 add r0, r1, #0x0 080BA68C: 4770 bx lr ;080BA68E: 0000 lsl r0, r0, #0x0 ;080BA690: D7A0 bvc 0x080BA5D4 ;080BA692: 0202 lsl r2, r0, #0x8
$080BA694 - ?
080BA694: 4A05 ldr r2, =#0x0202D7A0 080BA696: 2126 mov r1, #0x26 080BA698: 5E50 ldsh r0, [r2, r1] ; r0 = $0202D7C6(?) 080BA69A: 2862 cmp r0, #0x62 080BA69C: DC02 bgt 0x080BA6A4 ; r0 = #$01 and exit if r0 > #$62 080BA69E: 2100 mov r1, #0x00 080BA6A0: 2800 cmp r0, #0x00 080BA6A2: DD00 ble 0x080BA6A6 ; r0 = #$00 and exit if r0 < #$01 080BA6A4: 2101 mov r1, #0x01 ; Else: r0 = #$01 080BA6A6: 1C08 add r0, r1, #0x0 080BA6A8: 4770 bx lr ;080BA6AA: 0000 lsl r0, r0, #0x0 ;080BA6AC: D7A0 bvc 0x080BA5F0 ;080BA6AE: 0202 lsl r2, r0, #0x8
$080BB51C - Load Double Byte from a Table
r0 contains a Table address, r1 a Load Index value. A double Byte is loaded from there.
080BB51C: 0409 lsl r1, r1, #0x10 ; r1 AND #$0000FFFF * 2 080BB51E: 0BC9 lsr r1, r1, #0xF 080BB520: 30DC add r0, #0xDC ; r0 = r0 + #$DC 080BB522: 1840 add r0, r0, r1 ; Add Index to Address 080BB524: 8800 ldrh r0, [r0] ; Load byte from there 080BB526: 4770 bx lr
$080BB7FC - ?
080BB7FC: B530 push {r4, r5, lr} 080BB7FE: 1C05 add r5, r0, #0x0 ; r5 = Orig. r0 080BB800: F000 bl 080BB802: F970 bl 0x080BBAE4 ; ? 080BB804: 0400 lsl r0, r0, #0x10 080BB806: 0C00 lsr r0, r0, #0x10 ; r0 AND #$0000FFFF 080BB808: 2800 cmp r0, #0x00 080BB80A: D00C beq 0x080BB826 ; Exit if r0 = #$00 080BB80C: 0104 lsl r4, r0, #0x4 ; r4 = r0 * #$10 080BB80E: 1824 add r4, r4, r0 ; r4 = r0 * #$11 080BB810: 0124 lsl r4, r4, #0x4 ; r4 = r0 * #$110 080BB812: 4806 ldr r0, =#0x02029F50 080BB814: 1824 add r4, r4, r0 ; r4 = #$02029F50 + #$110 * previous r0 (Subroutine Result?) 080BB816: 1C20 add r0, r4, #0x0 080BB818: 1C29 add r1, r5, #0x0 ; r1 = Orig. r0 080BB81A: 2200 mov r2, #0x00 080BB81C: F000 bl 080BB81E: F8F4 bl 0x080BBA08 ; ? 080BB820: 1C20 add r0, r4, #0x0 ; (See above) 080BB822: F7FF bl 080BB824: FFB3 bl 0x080BB78C ; ? 080BB826: BC30 pop {r4, r5} 080BB828: BC01 pop {r0} 080BB82A: 4700 bx r0 ;080BB82C: 9F50 ldr r7, [sp, #0x140] ;080BB82E: 0202 lsl r2, r0, #0x8
$080BBBBC - ?
080BBBBC: B530 push {r4, r5, lr} 080BBBBE: 1C04 add r4, r0, #0x0 ; r4 = Orig. r0 080BBBC0: 6860 ldr r0, [r4, #0x04] ; r0 = Orig. r0 + #$04 080BBBC2: 0240 lsl r0, r0, #0x9 080BBBC4: 0D80 lsr r0, r0, #0x16 ; Bits 11 to 30 are now in Bits 0 to 18 080BBBC6: 3801 sub r0, #0x01 ; ? 080BBBC8: F786 bl 080BBBCA: FE82 bl 0x080428D0 ; ? 080BBBCC: 1C05 add r5, r0, #0x0 ; ? 080BBBCE: 6860 ldr r0, [r4, #0x04] ; r0 = Orig. r0 + #$04 080BBBD0: 0240 lsl r0, r0, #0x9 080BBBD2: 0D80 lsr r0, r0, #0x16 ; Bits 11 to 30 are now in Bits 0 to 18 080BBBD4: F786 bl 080BBBD6: FE7C bl 0x080428D0 ; ? 080BBBD8: 1C01 add r1, r0, #0x0 ; ? 080BBBDA: 1B49 sub r1, r1, r5 ; ? 080BBBDC: 6CA0 ldr r0, [r4, #0x48] ; r0 = Orig. r0 + #$48 080BBBDE: 1B40 sub r0, r0, r5 ; ? 080BBBE0: 2264 mov r2, #0x64 080BBBE2: 4350 mul r0, r2 ; ? 080BBBE4: F004 bl 080BBBE6: FD90 bl 0x080C0708 ; ? 080BBBE8: 2105 mov r1, #0x05 ; ? 080BBBEA: F004 bl 080BBBEC: FD8D bl 0x080C0708 ; ? 080BBBEE: 0400 lsl r0, r0, #0x10 080BBBF0: 0C00 lsr r0, r0, #0x10 ; ? 080BBBF2: BC30 pop {r4, r5} 080BBBF4: BC02 pop {r1} 080BBBF6: 4708 bx r1
$080BBBF8 - ?
080BBBF8: B570 push {r4, r5, r6, lr} 080BBBFA: 4646 mov r6, r8 080BBBFC: B440 push {r6} 080BBBFE: 1C06 add r6, r0, #0x0 ; r6 = Orig. r0 080BBC00: 040D lsl r5, r1, #0x10 ; r5 = Orig. r1 AND #$0000FFFF 080BBC02: 0C2D lsr r5, r5, #0x10 080BBC04: 0068 lsl r0, r5, #0x1 ; r0 = Orig. r1 * 2 080BBC06: 1C34 add r4, r6, #0x0 ; r4 = Orig. r0 080BBC08: 344C add r4, #0x4C ; r4 = Orig. r0 + #$4C 080BBC0A: 1824 add r4, r4, r0 ; r4 = (Orig. r0 + #$4C) + (Orig. r1 * 2) 080BBC0C: 2100 mov r1, #0x00 080BBC0E: 5E60 ldsh r0, [r4, r1] ; ? 080BBC10: F78B bl 080BBC12: FEEA bl 0x080479E8 ; ? 080BBC14: 4680 mov r8, r0 080BBC16: 8820 ldrh r0, [r4] 080BBC18: 3001 add r0, #0x01 080BBC1A: 0400 lsl r0, r0, #0x10 080BBC1C: 1400 asr r0, r0, #0x10 080BBC1E: F78B bl 080BBC20: FEE3 bl 0x080479E8 080BBC22: 1C01 add r1, r0, #0x0 080BBC24: 4642 mov r2, r8 080BBC26: 1A89 sub r1, r1, r2 080BBC28: 00AD lsl r5, r5, #0x2 080BBC2A: 368C add r6, #0x8C 080BBC2C: 1976 add r6, r6, r5 080BBC2E: 6830 ldr r0, [r6] 080BBC30: 1A80 sub r0, r0, r2 080BBC32: 2264 mov r2, #0x64 080BBC34: 4350 mul r0, r2 080BBC36: F004 bl 080BBC38: FD67 bl 0x080C0708 080BBC3A: 2105 mov r1, #0x05 080BBC3C: F004 bl 080BBC3E: FD64 bl 0x080C0708 080BBC40: 0400 lsl r0, r0, #0x10 080BBC42: 0C00 lsr r0, r0, #0x10 080BBC44: BC08 pop {r3} 080BBC46: 4698 mov r8, r3 080BBC48: BC70 pop {r4, r5, r6} 080BBC4A: BC02 pop {r1} 080BBC4C: 4708 bx r1 ;080BBC4E: 0000 lsl r0, r0, #0x0
$080BBE70 - (Put a Super Randomized Number in $0202DA08/9?)
The first bits seem to me like they try to form a super-random number in this newly added Stack entry.
r0 and r1 contain addresses.
This is much more complicated than it has to if you need a Random Number. Whatever. The Random Number is stored in $0202DA08/9 in the end.
080BBE70: B5F0 push {r4, r5, r6, r7, lr} 080BBE72: 464F mov r7, r9 080BBE74: 4646 mov r6, r8 080BBE76: B4C0 push {r6, r7} 080BBE78: B081 add sp, #-0x004 080BBE7A: 4681 mov r9, r0 080BBE7C: 4688 mov r8, r1 080BBE7E: 4669 mov r1, sp 080BBE80: 2000 mov r0, #0x00 080BBE82: 8008 strh r0, [r1] ; Clear newly added Stack Entry 080BBE84: 466D mov r5, sp 080BBE86: F003 bl 080BBE88: FA2B bl 0x080BF2E0 ; (Get a Random Number?) 080BBE8A: 8829 ldrh r1, [r5] ; Load value (from newly added stack entry) 080BBE8C: 1809 add r1, r1, r0 ; (Add Random Number?) 080BBE8E: 8029 strh r1, [r5] ; Store value back 080BBE90: 4859 ldr r0, =#0x00003AB8 080BBE92: 4448 add r0, r9 080BBE94: 6801 ldr r1, [r0] ; r1 = [Orig. r0 + #$3AB8] 080BBE96: 8828 ldrh r0, [r5] ; Load from Stack entry 080BBE98: 1840 add r0, r0, r1 ; Add r1 080BBE9A: 8028 strh r0, [r5] ; Store back 080BBE9C: 4957 ldr r1, =#0x04000006 080BBE9E: 8828 ldrh r0, [r5] ; Load from Stack entry 080BBEA0: 8809 ldrh r1, [r1] ; Load Vertical Counter 080BBEA2: 1840 add r0, r0, r1 ; Add vertical counter 080BBEA4: 8028 strh r0, [r5] ; Store value back 080BBEA6: 2600 mov r6, #0x00 ; Clear Loop Counter 080BBEA8: 4A55 ldr r2, =#0x00003A0C 080BBEAA: 444A add r2, r9 ; r2 = Orig. r0 + #$3A0C 080BBEAC: 0070 lsl r0, r6, #0x1 ; r0 = Loop Counter * 2 080BBEAE: 1810 add r0, r2, r0 ; r0 = Orig. r0 + #$3A0C + Loop Counter * 2 080BBEB0: 8829 ldrh r1, [r5] ; r1 = Load Stack entry 080BBEB2: 8800 ldrh r0, [r0] ; r0 = [Orig. r0 + #$3A0C + Loop Counter * 2] 080BBEB4: 1809 add r1, r1, r0 ; Add both 080BBEB6: 8029 strh r1, [r5] ; Store back on stack 080BBEB8: 1C70 add r0, r6, #0x1 ; Increment Loop Counter 080BBEBA: 0400 lsl r0, r0, #0x10 ; Loop Counter AND #$000FFFF 080BBEBC: 0C06 lsr r6, r0, #0x10 080BBEBE: 2E07 cmp r6, #0x07 080BBEC0: D9F4 bls 0x080BBEAC ; Loop until Loop Counter > #$07 080BBEC2: 4850 ldr r0, =#0x000038F0 080BBEC4: 4448 add r0, r9 ; r0 = Orig. r0 + #$38F0 080BBEC6: 7802 ldrb r2, [r0] ; r2 = [Orig. r0 + #$38F0] 080BBEC8: 0791 lsl r1, r2, #0x1E 080BBECA: 0F89 lsr r1, r1, #0x1E ; r1 = r2 AND #$00000003 080BBECC: 8828 ldrh r0, [r5] ; Load from Stack entry 080BBECE: 1840 add r0, r0, r1 ; Add that ANDed value 080BBED0: 8028 strh r0, [r5] ; Store back 080BBED2: 0652 lsl r2, r2, #0x19 080BBED4: 0ED2 lsr r2, r2, #0x1B ; r2 = r2 AND #$0000000C >> 2 080BBED6: 8828 ldrh r0, [r5] ; Load from Stack entry 080BBED8: 1880 add r0, r0, r2 ; Add that ANDed value 080BBEDA: 8028 strh r0, [r5] ; Store back 080BBEDC: 484A ldr r0, =#0x00000E92 080BBEDE: 4440 add r0, r8 ; r0 = Orig. r1 + #$00000E92 080BBEE0: 7801 ldrb r1, [r0] ; Load Byte from Orig. r1 + #$00000E92 080BBEE2: 2001 mov r0, #0x01 080BBEE4: 4008 and r0, r1 080BBEE6: 2800 cmp r0, #0x00 080BBEE8: D053 beq 0x080BBF92 ; Branch if the LSB of r1 = 0 080BBEEA: 4643 mov r3, r8 080BBEEC: 3370 add r3, #0x70 ; r3 = Orig. r1 + #$0070 080BBEEE: 4640 mov r0, r8 ; r0 = Orig. r1 080BBEF0: 6F01 ldr r1, [r0, #0x70] ; r1 = [Orig. r1 + #$0070] 080BBEF2: 8828 ldrh r0, [r5] ; Load from Stack Entry 080BBEF4: 1840 add r0, r0, r1 ; Add loaded byte 080BBEF6: 8028 strh r0, [r5] ; Store back 080BBEF8: 6859 ldr r1, [r3, #0x04] ; r1 = [Orig. r1 + #$0074] 080BBEFA: 8828 ldrh r0, [r5] ; Load from Stack Entry 080BBEFC: 1840 add r0, r0, r1 ; Add loaded byte 080BBEFE: 8028 strh r0, [r5] ; Store back in Stack Entry 080BBF00: 8828 ldrh r0, [r5] ; Load from Stack Entry 080BBF02: 8919 ldrh r1, [r3, #0x08] ; r1 = [Orig. r1 + #$0078] 080BBF04: 1840 add r0, r0, r1 ; Add value 080BBF06: 8028 strh r0, [r5] ; Store back in Stack Entry 080BBF08: 8828 ldrh r0, [r5] ; Load from Stack Entry 080BBF0A: 895A ldrh r2, [r3, #0x0A] ; r2 = [Orig. r1 + #$007A] 080BBF0C: 1880 add r0, r0, r2 ; Add value 080BBF0E: 8028 strh r0, [r5] ; Store back in Stack Entry 080BBF10: 89D8 ldrh r0, [r3, #0x0E] ; r0 = [Orig. r1 + #$0074] 080BBF12: 09C0 lsr r0, r0, #0x7 ; After this, Bit 7 is in Bit 0, the rest is cleared 080BBF14: 0600 lsl r0, r0, #0x18 080BBF16: 0E00 lsr r0, r0, #0x18 080BBF18: 8829 ldrh r1, [r5] ; Load from Stack Entry 080BBF1A: 1809 add r1, r1, r0 ; Add value 080BBF1C: 8029 strh r1, [r5] ; Store back in Stack Entry 080BBF1E: 4644 mov r4, r8 ; r4 = Orig. r1 080BBF20: 3404 add r4, #0x04 ; r4 = Orig. r1 + #$0004 080BBF22: 2600 mov r6, #0x00 080BBF24: 0412 lsl r2, r2, #0x10 ; r2 = [Orig. r1 + #$007A] AND #$0000FFFF 080BBF26: 0C12 lsr r2, r2, #0x10 080BBF28: 4296 cmp r6, r2 ; Is r2 = #$00? 080BBF2A: D232 bcs 0x080BBF92 ; ? 080BBF2C: 466B mov r3, sp 080BBF2E: 1C17 add r7, r2, #0x0 ; r7 = Loop Compare Value 080BBF30: 7AA2 ldrb r2, [r4, #0x0A] ; r2 = [Orig. r1 + #$000E] 080BBF32: 0691 lsl r1, r2, #0x1A ; AND #$0000003F 080BBF34: 0E89 lsr r1, r1, #0x1A 080BBF36: 8818 ldrh r0, [r3] ; Load from Stack Entry 080BBF38: 1840 add r0, r0, r1 ; Add Loaded byte 080BBF3A: 8018 strh r0, [r3] ; Store back on Stack 080BBF3C: 8818 ldrh r0, [r3] ; Load from Stack Entry 080BBF3E: 8821 ldrh r1, [r4] ; r1 = [Orig. r1 + #$0004] 080BBF40: 1840 add r0, r0, r1 080BBF42: 8018 strh r0, [r3] ; Store back on Stack 080BBF44: 8818 ldrh r0, [r3] ; Load from Stack Entry 080BBF46: 8861 ldrh r1, [r4, #0x02] ; r1 = [Orig. r1 + #$0006] 080BBF48: 1840 add r0, r0, r1 080BBF4A: 8018 strh r0, [r3] ; Store back on Stack 080BBF4C: 8818 ldrh r0, [r3] ; Load from Stack Entry 080BBF4E: 88A1 ldrh r1, [r4, #0x04] ; r1 = [Orig. r1 + #$0008] 080BBF50: 1840 add r0, r0, r1 080BBF52: 8018 strh r0, [r3] ; Store back on Stack 080BBF54: 8818 ldrh r0, [r3] ; Load from Stack Entry 080BBF56: 88E1 ldrh r1, [r4, #0x06] ; r1 = [Orig. r1 + #$000A] 080BBF58: 1840 add r0, r0, r1 080BBF5A: 8018 strh r0, [r3] ; Store back on Stack 080BBF5C: 8818 ldrh r0, [r3] ; Load from Stack Entry 080BBF5E: 8921 ldrh r1, [r4, #0x08] ; r1 = [Orig. r1 + #$000C] 080BBF60: 1840 add r0, r0, r1 080BBF62: 8018 strh r0, [r3] ; Store back on Stack 080BBF64: 0652 lsl r2, r2, #0x19 080BBF66: 0FD2 lsr r2, r2, #0x1F ; Bit 6 is Bit 0, rest is cleared 080BBF68: 8818 ldrh r0, [r3] ; Load from Stack Entry 080BBF6A: 1880 add r0, r0, r2 ; Add value 080BBF6C: 8018 strh r0, [r3] ; Store back on Stack 080BBF6E: 8960 ldrh r0, [r4, #0x0A] ; r2 = [Orig. r1 + #$000E] 080BBF70: 0580 lsl r0, r0, #0x16 080BBF72: 0F40 lsr r0, r0, #0x1D ; Bits 7 to 9 are in Bit 0 to 2, rest is cleared 080BBF74: 8819 ldrh r1, [r3] ; Load from Stack Entry 080BBF76: 1809 add r1, r1, r0 ; Add value 080BBF78: 8019 strh r1, [r3] ; Store back on Stack 080BBF7A: 7AE0 ldrb r0, [r4, #0x0B] ; r2 = [Orig. r1 + #$000F] 080BBF7C: 0700 lsl r0, r0, #0x1C ; Awww, c'mon, does anybody care anymore? 080BBF7E: 0F80 lsr r0, r0, #0x1E 080BBF80: 8819 ldrh r1, [r3] ; Load from Stack Entry 080BBF82: 1809 add r1, r1, r0 ; Add value 080BBF84: 8019 strh r1, [r3] ; Store back on Stack 080BBF86: 1C70 add r0, r6, #0x1 ; INC Loop Counter 080BBF88: 0400 lsl r0, r0, #0x10 ; Loop Counter AND #$0000FFFF 080BBF8A: 0C06 lsr r6, r0, #0x10 080BBF8C: 340C add r4, #0x0C ; Add #$0C to Orig. r1 080BBF8E: 42BE cmp r6, r7 080BBF90: D3CE bcc 0x080BBF30 ; Loop 080BBF92: 491A ldr r1, =#0x04000006 080BBF94: 8828 ldrh r0, [r5] ; Load from Stack Entry 080BBF96: 8809 ldrh r1, [r1] ; Load Vertical Counter 080BBF98: 1840 add r0, r0, r1 ; Add value 080BBF9A: 8028 strh r0, [r5] ; Store back on Stack 080BBF9C: 8828 ldrh r0, [r5] ; Load from Stack Entry 080BBF9E: 2800 cmp r0, #0x00 ; Repeat this whole if the resulting double byte is = #$0000 080BBFA0: D100 bne 0x080BBFA4 080BBFA2: E770 b 0x080BBE86 080BBFA4: 4819 ldr r0, =#0x0202D7A0 080BBFA6: 219A mov r1, #0x9A 080BBFA8: 0089 lsl r1, r1, #0x2 080BBFAA: 1840 add r0, r0, r1 ; r0 = #$0202DA08 080BBFAC: 2100 mov r1, #0x00 080BBFAE: 8001 strh r1, [r0] ; Clear $0202DA08 080BBFB0: 466C mov r4, sp 080BBFB2: 1C07 add r7, r0, #0x0 ; r7 = $0202DA08 080BBFB4: 8820 ldrh r0, [r4] ; Load Super Randomized Number 080BBFB6: 4A16 ldr r2, =#0x00000FFF 080BBFB8: 1C11 add r1, r2, #0x0 080BBFBA: 4008 and r0, r1 ; Super Randomized Number AND #$00000FFF 080BBFBC: 8020 strh r0, [r4] ; Store back on stack 080BBFBE: 2600 mov r6, #0x00 080BBFC0: 8820 ldrh r0, [r4] ; Load Super Randomized Number 080BBFC2: 4286 cmp r6, r0 080BBFC4: D20E bcs 0x080BBFE4 080BBFC6: 4D13 ldr r5, =#0x0202DA08 080BBFC8: F003 bl 080BBFCA: F98A bl 0x080BF2E0 ; (Get a Random Number?) 080BBFCC: 8829 ldrh r1, [r5] ; r1 = [$0202DA08] 080BBFCE: 1809 add r1, r1, r0 ; Add Random Number 080BBFD0: 480A ldr r0, =#0x04000006 080BBFD2: 8800 ldrh r0, [r0] ; Load Vertical Counter 080BBFD4: 1809 add r1, r1, r0 ; Add Vertical Counter to Random Number 080BBFD6: 8029 strh r1, [r5] ; Store Random number in 080BBFD8: 1C70 add r0, r6, #0x1 ; Increment Loop Counter 080BBFDA: 0400 lsl r0, r0, #0x10 ; Loop Counter AND #$0000FFFF 080BBFDC: 0C06 lsr r6, r0, #0x10 080BBFDE: 8820 ldrh r0, [r4] ; Load Super Randomized Number 080BBFE0: 4286 cmp r6, r0 080BBFE2: D3F1 bcc 0x080BBFC8 ; Loop until Loop Counter reached Super Randomized Number 080BBFE4: 8838 ldrh r0, [r7] ; r0 = [$0202DA08] 080BBFE6: 2800 cmp r0, #0x00 080BBFE8: D0E4 beq 0x080BBFB4 ; Repeat the whole thing if the Randomized Number is = #$0000 080BBFEA: B001 add sp, #0x004 080BBFEC: BC18 pop {r3, r4} 080BBFEE: 4698 mov r8, r3 080BBFF0: 46A1 mov r9, r4 080BBFF2: BCF0 pop {r4, r5, r6, r7} 080BBFF4: BC01 pop {r0} 080BBFF6: 4700 bx r0 ;080BBFF8: 3AB8 sub r2, #0xB8 ;080BBFFA: 0000 lsl r0, r0, #0x0 ;080BBFFC: 0006 lsl r6, r0, #0x0 ;080BBFFE: 0400 lsl r0, r0, #0x10 ;080BC000: 3A0C sub r2, #0x0C ;080BC002: 0000 lsl r0, r0, #0x0 ;080BC004: 38F0 sub r0, #0xF0 ;080BC006: 0000 lsl r0, r0, #0x0 ;080BC008: 0E92 lsr r2, r2, #0x1A ;080BC00A: 0000 lsl r0, r0, #0x0 ;080BC00C: D7A0 bvc 0x080BBF50 ;080BC00E: 0202 lsl r2, r0, #0x8 ;080BC010: 0FFF lsr r7, r7, #0x1F ;080BC012: 0000 lsl r0, r0, #0x0 ;080BC014: DA08 bge 0x080BC028 ;080BC016: 0202 lsl r2, r0, #0x8
$080BD308 - ?
080BD308: B500 push {lr} 080BD30A: F7FF bl 080BD30C: FFDD bl 0x080BD2C8 ; ? 080BD30E: 0400 lsl r0, r0, #0x10 080BD310: 0C00 lsr r0, r0, #0x10 080BD312: 2805 cmp r0, #0x05 080BD314: D901 bls 0x080BD31A ; If r0 < #$06, r0 = #$01 080BD316: 2000 mov r0, #0x00 ; Else r0 = #$00 080BD318: E000 b 0x080BD31C 080BD31A: 2001 mov r0, #0x01 080BD31C: BC02 pop {r1} 080BD31E: 4708 bx r1
$080BD320 - (Load Address in r0)
r0 contains a number; it's an entry number for a table in WRAM starting at $0203B6D0. Each register there contains an address, which is loaded and left in r0 when the subroutine exits. If r0 was #$3F at the beginning, #$0203B7D8 gets set in r0 and it is exited.
080BD320: 0400 lsl r0, r0, #0x10 080BD322: 0C00 lsr r0, r0, #0x10 ; Remove Upper Double Byte from r0 080BD324: 283F cmp r0, #0x3F 080BD326: D007 beq 0x080BD338 ; If r0 = #$3F, set fixed address and exit 080BD328: 0080 lsl r0, r0, #0x2 080BD32A: 4902 ldr r1, =#0x0203B6D0 080BD32C: 1840 add r0, r0, r1 080BD32E: 6800 ldr r0, [r0] 080BD330: E003 b 0x080BD33A ;DATA ;============== ;080BD332: 0000 lsl r0, r0, #0x0 ;080BD334: B6D0 push {r4, r6, r7} ;080BD336: 0203 lsl r3, r0, #0x8 080BD338: 4800 ldr r0, =#0x0203B7D8 080BD33A: 4770 bx lr
$080BD340 - (Load Address in r0)
r0 contains a number; it's an entry number for a table in WRAM starting at $0203B6E8. If r0 was #$3F at the beginning, #$0203B8E8 gets set in r0 and it is exited. Else, the value gets multiplied by 28 and is added to the Table offset.
080BD340: 0400 lsl r0, r0, #0x10 080BD342: 0C01 lsr r1, r0, #0x10 ; Remove Upper Double Byte from r0, store it in r1 080BD344: 293F cmp r1, #0x3F ; If r1 = #$3F, set fixed address and exit 080BD346: D103 bne 0x080BD350 080BD348: 4800 ldr r0, =#0x0203B8E8 080BD34A: E006 b 0x080BD35A ;080BD34C: B8E8 pop {r3, r5, r6, r7} ;080BD34E: 0203 lsl r3, r0, #0x8 080BD350: 00C8 lsl r0, r1, #0x3 ; r0 = value * 8 080BD352: 1A40 sub r0, r0, r1 ; r0 = value * 8 - 1 = value * 7 080BD354: 0080 lsl r0, r0, #0x2 ; r0 = value * 7 * 2 * 2 = value * 28 080BD356: 4901 ldr r1, =#0x0203B6E8 080BD358: 1840 add r0, r0, r1 080BD35A: 4770 bx lr ;080BD35C: B6E8 push {r3, r5, r6, r7} ;080BD35E: 0203 lsl r3, r0, #0x8
$080BD360 - (Load Address in r0)
If r0 = $0000003F, r0 gets $0203B904
If not, the value in r0 gets multiplied by 12 and added to #$0203B790 from the address that was formed in r0 it's value gets loaded
So, from $0203B6D0 on, the registers are a table, and the original value in r0 is the table entry number to load
080BD360: 0400 lsl r0, r0, #0x10 080BD362: 0C01 lsr r1, r0, #0x10 080BD364: 293F cmp r1, #0x3F 080BD366: D103 bne 0x080BD370 080BD368: 4800 ldr r0, =#0x0203B904 080BD36A: E006 b 0x080BD37A ;080BD36C: B904 pop {r2, pc} ;080BD36E: 0203 lsl r3, r0, #0x8 080BD370: 0048 lsl r0, r1, #0x1 080BD372: 1840 add r0, r0, r1 080BD374: 0080 lsl r0, r0, #0x2 080BD376: 4901 ldr r1, =#0x0203B790 080BD378: 1840 add r0, r0, r1 080BD37A: 4770 bx lr ;080BD37C: B790 push {r4, r7, lr} ;080BD37E: 0203 lsl r3, r0, #0x8
$080BD380 - (Load Address in r0)
If r0 = #$3F, r0 exits with value (address) #$0203B7D8. If r0 has a different value, in the end r0 is = #$02029F50 + value * 272.
080BD380: 0400 lsl r0, r0, #0x10 080BD382: 0C01 lsr r1, r0, #0x10 080BD384: 293F cmp r1, #0x3F 080BD386: D007 beq 0x080BD398 080BD388: 0108 lsl r0, r1, #0x4 ; r0 = value * 16 080BD38A: 1840 add r0, r0, r1 ; r0 = value * 17 080BD38C: 0100 lsl r0, r0, #0x4 ; r0 = value * 272 080BD38E: 4901 ldr r1, =#0x02029F50 080BD390: 1840 add r0, r0, r1 ; r0 = #$02029F50 + value * 272 080BD392: E002 b 0x080BD39A ;080BD394: 9F50 ldr r7, [sp, #0x140] ;080BD396: 0202 lsl r2, r0, #0x8 080BD398: 4800 ldr r0, =#0x0203B7D8 080BD39A: 4770 bx lr ;080BD39C: B7D8 push {r3, r4, r6, r7, lr} ;080BD39E: 0203 lsl r3, r0, #0x8
$080BD5E0 - Calculate address of a tile ($02032704)
r0, r1 and r2 contain number values.
First of all, an address is loaded from $02032704. Then the calculation goes address + r0 * #$4B0. Valid values for r0 are #$00 to #$03. Then the values of r1 and r2 are changed a bit and added to the address.
I expect this to be used this way:
r0 = BG Number
r1 = Tile Column Number (X)
r2 = Tile Row Number (Y)
The calculation is final address = (address in $0203704) + 2 * (30 * r2 + r1). The screen can contain thirty 8x8 tiles (240px Width), and each tile has two bytes data, so the calculation actually is:
Final Address = Offset + 2 Bytes per Tile * (Number of Tiles per Row * Tile Row Number + Tile Column Number)
- The main difference between this subroutine and the one at $0809C36C is that here the basic offset is loaded from $02032704.
080BD5E0: B510 push {r4, lr} 080BD5E2: 0400 lsl r0, r0, #0x10 080BD5E4: 0C00 lsr r0, r0, #0x10 ; Remove upper Double Byte from r0 080BD5E6: 1C03 add r3, r0, #0x0 ; Copy r0 in r3 080BD5E8: 0409 lsl r1, r1, #0x10 080BD5EA: 0C09 lsr r1, r1, #0x10 ; Remove upper Double Byte from r1 080BD5EC: 0412 lsl r2, r2, #0x10 080BD5EE: 0C12 lsr r2, r2, #0x10 ; Remove upper Double Byte from r2 080BD5F0: 2801 cmp r0, #0x01 080BD5F2: D00F beq 0x080BD614 ; Branch if r0 = #$01 080BD5F4: 2801 cmp r0, #0x01 080BD5F6: DC02 bgt 0x080BD5FE ; Branch if r0 > #$01 080BD5F8: 2800 cmp r0, #0x00 080BD5FA: D005 beq 0x080BD608 ; Branch if r0 = #$00 080BD5FC: E022 b 0x080BD644 ; Branch if r0 is negative (Set r0 = #$00, Exit) 080BD5FE: 2B02 cmp r3, #0x02 ; If r0 > #$01 080BD600: D010 beq 0x080BD624 ; Branch if r0 = #$02 080BD602: 2B03 cmp r3, #0x03 080BD604: D016 beq 0x080BD634 ; Branch if r0 = #$03 080BD606: E01D b 0x080BD644 ; Branch if r0 is higher than #$03 (Set r0 = #$00, Exit) 080BD608: 4801 ldr r0, =#0x02032700 ; If r0 = #$00 080BD60A: 6843 ldr r3, [r0, #0x04] ; r3 = [$02032704] 080BD60C: E01C b 0x080BD648 ;DATA ;============== ;080BD60E: 0000 lsl r0, r0, #0x0 ;080BD610: 2700 mov r7, #0x00 ;080BD612: 0203 lsl r3, r0, #0x8 080BD614: 4802 ldr r0, =#0x02032700 ; If r0 = #$01 080BD616: 6840 ldr r0, [r0, #0x04] ; r3 = [$02032704] 080BD618: 2496 mov r4, #0x96 080BD61A: 00E4 lsl r4, r4, #0x3 080BD61C: 1903 add r3, r0, r4 ; r3 = [$02032704] + #$000004B0 080BD61E: E013 b 0x080BD648 ;DATA ;======= ;080BD620: 2700 mov r7, #0x00 ;080BD622: 0203 lsl r3, r0, #0x8 080BD624: 4802 ldr r0, =#0x02032700 ; If r0 = #$02 080BD626: 6840 ldr r0, [r0, #0x04] ; r3 = [$02032704] 080BD628: 2496 mov r4, #0x96 080BD62A: 0124 lsl r4, r4, #0x4 080BD62C: 1903 add r3, r0, r4 ; r3 = [$02032704] + #$00000960 080BD62E: E00B b 0x080BD648 ;DATA ;============ ;080BD630: 2700 mov r7, #0x00 ;080BD632: 0203 lsl r3, r0, #0x8 080BD634: 4802 ldr r0, =#0x02032700 ; If r0 = #$03 080BD636: 6840 ldr r0, [r0, #0x04] ; r3 = [$02032704] 080BD638: 24E1 mov r4, #0xE1 080BD63A: 0124 lsl r4, r4, #0x4 080BD63C: 1903 add r3, r0, r4 ; r3 = [$02032704] + #$00000E10 080BD63E: E003 b 0x080BD648 ;DATA ;============ ;080BD640: 2700 mov r7, #0x00 ;080BD642: 0203 lsl r3, r0, #0x8 080BD644: 2000 mov r0, #0x00 ; If r0 has an invalid value 080BD646: E006 b 0x080BD656 080BD648: 0110 lsl r0, r2, #0x4 080BD64A: 1A80 sub r0, r0, r2 ; r0 = 15 * r2 080BD64C: 0040 lsl r0, r0, #0x1 ; r0 = 30 * r2 080BD64E: 1808 add r0, r1, r0 ; r0 = 30 * r2 + r1 080BD650: 0040 lsl r0, r0, #0x1 ; r0 = 2 * (30 * r2 + r1) 080BD652: 181B add r3, r3, r0 ; r3 = r3 + 2 * (30 * r2 + r1) 080BD654: 1C18 add r0, r3, #0x0 ; Transfer result in r3 080BD656: BC10 pop {r4} 080BD658: BC02 pop {r1} 080BD65A: 4708 bx r1
$080BD684 - ?
r0 contains a number of times the core of this subroutine should be done (loop counter comparison value).
080BD684: B5F0 push {r4, r5, r6, r7, lr} 080BD686: 4657 mov r7, r10 080BD688: 464E mov r6, r9 080BD68A: 4645 mov r5, r8 080BD68C: B4E0 push {r5, r6, r7} 080BD68E: 0400 lsl r0, r0, #0x10 080BD690: 0C06 lsr r6, r0, #0x10 ; r6 = r0 AND #$0000FFFF 080BD692: 4A24 ldr r2, =#0x02032700 080BD694: 6851 ldr r1, [r2, #0x04] ; r1 = [$02032704] 080BD696: 4B24 ldr r3, =#0x00001F04 080BD698: 18C8 add r0, r1, r3 080BD69A: 8800 ldrh r0, [r0] ; ? 080BD69C: 00C0 lsl r0, r0, #0x3 ; ? 080BD69E: 2396 mov r3, #0x96 080BD6A0: 015B lsl r3, r3, #0x5 : r2 = #$000012C0 080BD6A2: 18C0 add r0, r0, r3 ; ? 080BD6A4: 1809 add r1, r1, r0 ; ? (r1 = [$02032704] 080BD6A6: 4689 mov r9, r1 080BD6A8: 464C mov r4, r9 080BD6AA: 2500 mov r5, #0x00 080BD6AC: 42B5 cmp r5, r6 080BD6AE: D231 bcs 0x080BD714 ; Exit if r6 = 0 080BD6B0: 2011 mov r0, #0x11 080BD6B2: 4240 neg r0, r0 080BD6B4: 4680 mov r8, r0 ; r8 = #$FFFFFFEE 080BD6B6: 2321 mov r3, #0x21 080BD6B8: 425B neg r3, r3 080BD6BA: 469C mov r12, r3 ; r12 = #$FFFFFFDE 080BD6BC: 270D mov r7, #0x0D 080BD6BE: 427F neg r7, r7 ; r7 = #$FFFFFFF2 080BD6C0: 3002 add r0, #0x02 080BD6C2: 4682 mov r10, r0 ; r19 = #$FFFFFFF0 080BD6C4: 78E0 ldrb r0, [r4, #0x03] 080BD6C6: 4643 mov r3, r8 080BD6C8: 4003 and r3, r0 ; r3 = r0 AND #$FFFFFFEE (remove bit 0 and 4) 080BD6CA: 4660 mov r0, r12 080BD6CC: 4003 and r3, r0 ; r3 = r3 AND #$FFFFFFDE (remove bit 0, 4 and 5) 080BD6CE: 7860 ldrb r0, [r4, #0x01] 080BD6D0: 4662 mov r2, r12 080BD6D2: 4002 and r2, r0 ; r2 = r0 AND #$FFFFFFDE (remove bit 0, 4 and 5) 080BD6D4: 403A and r2, r7 ; r2 = r2 AND #$FFFFFFF2 (remove bit 0, 2 and 3) 080BD6D6: 4640 mov r0, r8 080BD6D8: 4002 and r2, r0 ; r2 = r2 AND #$FFFFFFEE (remove bit 0 and 4) 080BD6DA: 7961 ldrb r1, [r4, #0x05] 080BD6DC: 1C38 add r0, r7, #0x0 080BD6DE: 4008 and r0, r1 ; r0 = r1 AND #$FFFFFFF2 (remove bit 0, 2 and 3) 080BD6E0: 2104 mov r1, #0x04 080BD6E2: 4308 orr r0, r1 ; Set bit 3 in r0 080BD6E4: 7160 strb r0, [r4, #0x05] ; Store changed byte back 080BD6E6: 2004 mov r0, #0x04 080BD6E8: 4240 neg r0, r0 080BD6EA: 4002 and r2, r0 ; Remove bit 3 in r2 080BD6EC: 7062 strb r2, [r4, #0x01] ; Store changed byte back 080BD6EE: 4650 mov r0, r10 080BD6F0: 4003 and r3, r0 ; r3 = r3 AND #$FFFFFFF0 (remove bit 0 to 3) 080BD6F2: 70E3 strb r3, [r4, #0x03] ; Store changed byte back 080BD6F4: 2000 mov r0, #0x00 080BD6F6: 80E0 strh r0, [r4, #0x06] ; Clear doublebyte 080BD6F8: 1C68 add r0, r5, #0x1 080BD6FA: 0400 lsl r0, r0, #0x10 080BD6FC: 0C05 lsr r5, r0, #0x10 ; Increment counter 080BD6FE: 3408 add r4, #0x08 ; Increment data load/store address 080BD700: 4B08 ldr r3, =#0x02032700 080BD702: 6859 ldr r1, [r3, #0x04] 080BD704: 4808 ldr r0, =#0x00001F04 080BD706: 1809 add r1, r1, r0 080BD708: 8808 ldrh r0, [r1] 080BD70A: 3001 add r0, #0x01 080BD70C: 880A ldrh r2, [r1] ; ? (some Increment) 080BD70E: 8008 strh r0, [r1] 080BD710: 42B5 cmp r5, r6 080BD712: D3D7 bcc 0x080BD6C4 ; Loop if r5 < r6, else exit 080BD714: 4648 mov r0, r9 080BD716: BC38 pop {r3, r4, r5} 080BD718: 4698 mov r8, r3 080BD71A: 46A1 mov r9, r4 080BD71C: 46AA mov r10, r5 080BD71E: BCF0 pop {r4, r5, r6, r7} 080BD720: BC02 pop {r1} 080BD722: 4708 bx r1 ;080BD724: 2700 mov r7, #0x00 ;080BD726: 0203 lsl r3, r0, #0x8 ;080BD728: 1F04 sub r4, r0, #0x4 ;080BD72A: 0000 lsl r0, r0, #0x0
$080BD838 - ?
080BD838: B500 push {lr} 080BD83A: 0409 lsl r1, r1, #0x10 ; r1 = AND #$0000FFFF 080BD83C: 0C09 lsr r1, r1, #0x10 080BD83E: 2904 cmp r1, #0x04 080BD840: D905 bls 0x080BD84E ; Exit if r1 < #$05 080BD842: 3020 add r0, #0x20 ; r0 = r0 + #$20 080BD844: 3904 sub r1, #0x04 ; r1 = r1 - #$04 080BD846: 0409 lsl r1, r1, #0x10 ; r1 AND #$0000FFFF (This really does not have to be done again, right?) 080BD848: 0C09 lsr r1, r1, #0x10 080BD84A: F001 bl 080BD84C: F915 bl 0x080BEA78 ; ? 080BD84E: BC01 pop {r0} 080BD850: 4700 bx r0 ;080BD852: 0000 lsl r0, r0, #0x0
$080BD854 - (Form a VRAM address?)
This forms a VRAM address out of the values in r0 and r1.
080BD854: 0400 lsl r0, r0, #0x10 080BD856: 0409 lsl r1, r1, #0x10 080BD858: 0AC0 lsr r0, r0, #0xB ; r0 = r0 AND #$0000FFFF, * #$10 (#16) 080BD85A: 0989 lsr r1, r1, #0x6 ; r1 = r1 AND #$0000FFFF, * #$200 (#512) 080BD85C: 1840 add r0, r0, r1 ; add both 080BD85E: 4901 ldr r1, =#0x06008000 080BD860: 1840 add r0, r0, r1 ; add #$06008000 (VRAM) 080BD862: 4770 bx lr ;080BD864: 8000 strh r0, [r0] ;080BD866: 0600 lsl r0, r0, #0x18
$080BD868 - (Form a WRAM address?)
r0 and r1 contain values for a WRAM address calculation.
080BD868: 0400 lsl r0, r0, #0x10 ; r0 AND #$0000FFFF 080BD86A: 0C00 lsr r0, r0, #0x10 080BD86C: 0409 lsl r1, r1, #0x10 ; r1 AND #$0000FFFF 080BD86E: 0C09 lsr r1, r1, #0x10 080BD870: 008A lsl r2, r1, #0x2 080BD872: 1852 add r2, r2, r1 ; r2 = r1 * 5 080BD874: 0092 lsl r2, r2, #0x2 ; r2 = r1 * #$14 (#20) 080BD876: 1880 add r0, r0, r2 ; r0 = r0 + r1 * #$14 080BD878: 0080 lsl r0, r0, #0x2 ; r0 = (r0 + r1 * #$14) * 4 080BD87A: 4901 ldr r1, =#0x02036604 080BD87C: 1840 add r0, r0, r1 ; r0 = #$02036604 + ((r0 + r1 * #$14) * 4) 080BD87E: 4770 bx lr ;080BD880: 6604 str r4, [r0, #0x60] ;080BD882: 0203 lsl r3, r0, #0x8
$080BD884 - ?
r3 contains a load index for the Data Table at $08699A80.
080BD884: B5F0 push {r4, r5, r6, r7, lr} 080BD886: 464F mov r7, r9 080BD888: 4646 mov r6, r8 080BD88A: B4C0 push {r6, r7} 080BD88C: 4681 mov r9, r0 ; r9 = Orig. r0 080BD88E: 1C0E add r6, r1, #0x0 ; r6 = Orig. r1 080BD890: 0412 lsl r2, r2, #0x10 ; r2 AND #$0000FFFF 080BD892: 0C12 lsr r2, r2, #0x10 080BD894: 4690 mov r8, r2 ; r8 = r2 080BD896: 041B lsl r3, r3, #0x10 080BD898: 0C1F lsr r7, r3, #0x10 ; r7 = r3 AND #$0000FFFF 080BD89A: 00B9 lsl r1, r7, #0x2 ; r1 = r3 * 4 080BD89C: 480E ldr r0, =#0x08699A80 080BD89E: 180C add r4, r1, r0 ; r4 = #$08699A80 + r3 * 4 080BD8A0: 2500 mov r5, #0x00 080BD8A2: 42BD cmp r5, r7 080BD8A4: D212 bcs 0x080BD8CC 080BD8A6: 6821 ldr r1, [r4] 080BD8A8: 1C30 add r0, r6, #0x0 080BD8AA: F002 bl 080BD8AC: F87D bl 0x080BF9A8 080BD8AE: 0069 lsl r1, r5, #0x1 080BD8B0: 4449 add r1, r9 080BD8B2: 4440 add r0, r8 080BD8B4: 8008 strh r0, [r1] 080BD8B6: 6821 ldr r1, [r4] 080BD8B8: 1C30 add r0, r6, #0x0 080BD8BA: F002 bl 080BD8BC: F877 bl 0x080BF9AC 080BD8BE: 1C06 add r6, r0, #0x0 080BD8C0: 1C68 add r0, r5, #0x1 080BD8C2: 0400 lsl r0, r0, #0x10 080BD8C4: 0C05 lsr r5, r0, #0x10 080BD8C6: 3C04 sub r4, #0x04 080BD8C8: 42BD cmp r5, r7 080BD8CA: D3EC bcc 0x080BD8A6 080BD8CC: BC18 pop {r3, r4} 080BD8CE: 4698 mov r8, r3 080BD8D0: 46A1 mov r9, r4 080BD8D2: BCF0 pop {r4, r5, r6, r7} 080BD8D4: BC01 pop {r0} 080BD8D6: 4700 bx r0 ;080BD8D8: 9A80 ldr r2, [sp, #0x200] ;080BD8DA: 0869 lsr r1, r5, #0x1
$080BD9B4 - ?
080BD9B4: B510 push {r4, lr} 080BD9B6: 1C0C add r4, r1, #0x0 ; r4 = Orig. r1 080BD9B8: 1C20 add r0, r4, #0x0 ; r0 = Orig. r1 080BD9BA: F000 bl 080BD9BC: F81F bl 0x080BD9FC ; ? 080BD9BE: F784 bl 080BD9C0: FFA7 bl 0x08042910 ; ? 080BD9C2: F000 bl 080BD9C4: F877 bl 0x080BDAB4 ; ? 080BD9C6: 4B0B ldr r3, =#0x0202D7A0 080BD9C8: 347E add r4, #0x7E 080BD9CA: 7821 ldrb r1, [r4] ; r1 = [Orig. r1 + #$7E] 080BD9CC: 07C9 lsl r1, r1, #0x1F ; r1 = Bit 0 of [Orig. r1 + #$7E] 080BD9CE: 480A ldr r0, =#0x0000026A 080BD9D0: 181B add r3, r3, r0 ; r3 = #$0202DA0A 080BD9D2: 0FC9 lsr r1, r1, #0x1F 080BD9D4: 0109 lsl r1, r1, #0x4 ; r1 = Bit 0 of [Orig. r1 + #$7E] in Bit 4 080BD9D6: 781A ldrb r2, [r3] ; r2 = $0202DA0A 080BD9D8: 2011 mov r0, #0x11 080BD9DA: 4240 neg r0, r0 ; r0 = #$FFFFFFEF 080BD9DC: 4010 and r0, r2 ; Clear Bit 4 of r0 080BD9DE: 4308 orr r0, r1 ; Add Bit 0 of [Orig. r1 + #$7E] as Bit 4 080BD9E0: 7018 strb r0, [r3] ; Store back in $0202DA0A 080BD9E2: 7821 ldrb r1, [r4] 080BD9E4: 0649 lsl r1, r1, #0x19 080BD9E6: 0FC9 lsr r1, r1, #0x1F ; r1 = Bit 6 of [Orig. r1 + #$7E] in Bit 0 080BD9E8: 20FF mov r0, #0xFF 080BD9EA: F7FC bl 080BD9EC: F89D bl 0x080B9B28 ; ? 080BD9EE: BC10 pop {r4} 080BD9F0: BC01 pop {r0} 080BD9F2: 4700 bx r0 ;080BD9F4: D7A0 bvc 0x080BD938 ;080BD9F6: 0202 lsl r2, r0, #0x8 ;080BD9F8: 026A lsl r2, r5, #0x9 ;080BD9FA: 0000 lsl r0, r0, #0x0
$080BDD28 - (DMA to Tilemap Buffer?)
This does a DMA to the Tilemap Buffer, if I get this right.
r0 contains the Source
r1 contains MAY BE the number of the BG it should go to
r2 contains the number of single Bytes(!) to transfer
080BDD28: B510 push {r4, lr} 080BDD2A: 0409 lsl r1, r1, #0x10 080BDD2C: 0412 lsl r2, r2, #0x10 080BDD2E: 4B0E ldr r3, =#0x02032700 080BDD30: 0AC9 lsr r1, r1, #0xB 080BDD32: 24CE mov r4, #0xCE 080BDD34: 0164 lsl r4, r4, #0x5 080BDD36: 1909 add r1, r1, r4 080BDD38: 685B ldr r3, [r3, #0x04] ; Load address of the Tilemap Buffer(?) 080BDD3A: 185B add r3, r3, r1 ; Add Orig. r1 * 1000 and #$19C0 080BDD3C: 490B ldr r1, =#0x040000D4 080BDD3E: 6008 str r0, [r1] ; Set r0 as DMA Source 080BDD40: 604B str r3, [r1, #0x04] ; Set r3 as Destination 080BDD42: 0C52 lsr r2, r2, #0x11 ; r2 = Orig. r2 div by 2: Now it's the number of DOUBLE bytes to transfer 080BDD44: 2380 mov r3, #0x80 080BDD46: 061B lsl r3, r3, #0x18 ; r3 = DMA Activation Bit 080BDD48: 431A orr r2, r3 ; Add Activation bit to the Number of Double Bytes to transfer 080BDD4A: 608A str r2, [r1, #0x08] ; Start DMA 080BDD4C: 6888 ldr r0, [r1, #0x08] 080BDD4E: 6888 ldr r0, [r1, #0x08] 080BDD50: 4018 and r0, r3 ; Check if DMA has ended 080BDD52: 2800 cmp r0, #0x00 080BDD54: D004 beq 0x080BDD60 080BDD56: 1C1A add r2, r3, #0x0 080BDD58: 6888 ldr r0, [r1, #0x08] 080BDD5A: 4010 and r0, r2 080BDD5C: 2800 cmp r0, #0x00 080BDD5E: D1FB bne 0x080BDD58 080BDD60: BC10 pop {r4} ; Exit 080BDD62: BC01 pop {r0} 080BDD64: 4700 bx r0 ;080BDD66: 0000 lsl r0, r0, #0x0 ;080BDD68: 2700 mov r7, #0x00 ;080BDD6A: 0203 lsl r3, r0, #0x8 ;080BDD6C: 00D4 lsl r4, r2, #0x3 ;080BDD6E: 0400 lsl r0, r0, #0x10
$080BDD70 - (Clear Registers)
This subroutine is called from $080976DC, $080BDDFC and $0809D0C0.
When called from $080976DC, r0 is = #$0202DF00.
This subroutine
- clears $0202DF58/9 (Orig. r0 + #$58)
- clears Bit 0 of $0202DF69 (Orig. r0 + #$69)
- clears $0202DF60/1 (Orig. r0 + #$60)
- clears $0202DF62/3 (Orig. r0 + #$62)
- clears $0202DF5A/B (Orig. r0 + #$5A)
- clears $0202DF5C/D (Orig. r0 + #$5C)
- clears $0202DF5E/F (Orig. r0 + #$5E)
- clears $0202DF64/5 (Orig. r0 + #$64)
- clears $0202DF66/7 (Orig. r0 + #$66)
- clears $0202DF6C-F (Orig. r0 + #$6C)
- CpuSet-clears $0202DF00-7 (Orig r0)
- CpuSet-clears $0202DF08-17 (Orig r0 + #$08)
- CpuSet-clears $0202DF18-57 (Orig r0 + #$18)
- Calls a subroutine
080BDD70: B530 push {r4, r5, lr} 080BDD72: B082 add sp, #-0x008 ; Add two entries on Stack 080BDD74: 1C05 add r5, r0, #0x0 ; r5 = Orig. r0 080BDD76: 1C29 add r1, r5, #0x0 080BDD78: 3158 add r1, #0x58 ; r1 = Orig. r0 + #$58 080BDD7A: 2400 mov r4, #0x00 080BDD7C: 2001 mov r0, #0x01 080BDD7E: 8008 strh r0, [r1] ; Clear Orig. r0 + #$58 080BDD80: 1C2A add r2, r5, #0x0 080BDD82: 3269 add r2, #0x69 080BDD84: 7811 ldrb r1, [r2] ; Load Orig. r0 + #$69 080BDD86: 3803 sub r0, #0x03 ; #$FFFFFFFE 080BDD88: 4008 and r0, r1 ; Clear Bit 0 080BDD8A: 7010 strb r0, [r2] ; Store back 080BDD8C: 1C28 add r0, r5, #0x0 080BDD8E: 3060 add r0, #0x60 080BDD90: 8801 ldrh r1, [r0] ; Load Orig. r0 + #$60 (whyever) 080BDD92: 8004 strh r4, [r0] ; Clear Orig. r0 + #$60 080BDD94: 1C29 add r1, r5, #0x0 080BDD96: 3162 add r1, #0x62 080BDD98: 8808 ldrh r0, [r1] 080BDD9A: 800C strh r4, [r1] ; Clear Orig. r0 + #$62 080BDD9C: 1C28 add r0, r5, #0x0 080BDD9E: 305A add r0, #0x5A 080BDDA0: 8004 strh r4, [r0] ; Clear Orig. r0 + #$5A 080BDDA2: 3002 add r0, #0x02 080BDDA4: 8004 strh r4, [r0] ; Clear Orig. r0 + #$5C 080BDDA6: 3002 add r0, #0x02 080BDDA8: 8004 strh r4, [r0] ; Clear Orig. r0 + #$5E 080BDDAA: 3006 add r0, #0x06 080BDDAC: 8801 ldrh r1, [r0] 080BDDAE: 8004 strh r4, [r0] ; Clear Orig. r0 + #$64 080BDDB0: 1C29 add r1, r5, #0x0 080BDDB2: 3166 add r1, #0x66 080BDDB4: 8808 ldrh r0, [r1] 080BDDB6: 800C strh r4, [r1] ; Clear Orig. r0 + #$66 080BDDB8: 66EC str r4, [r5, #0x6C] ; Clear Orig. r0 + #$6C 080BDDBA: 4668 mov r0, sp 080BDDBC: 8004 strh r4, [r0] ; Clear Stack Entry (use for Clear CPUSet) 080BDDBE: 4A0C ldr r2, =#0x01000004 ; Clear 4 Double Bytes, fixed transfer 080BDDC0: 1C29 add r1, r5, #0x0 ; Start at Orig. r0 080BDDC2: F001 bl 080BDDC4: FDEF bl 0x080BF9A4 ; Swi CpuSet 080BDDC6: 4668 mov r0, sp 080BDDC8: 3002 add r0, #0x02 080BDDCA: 8004 strh r4, [r0] ; Clear next stack entry 080BDDCC: 1C29 add r1, r5, #0x0 080BDDCE: 3108 add r1, #0x08 ; Start at Orig. r0 + #$08 080BDDD0: 4A08 ldr r2, =#0x01000008 ; Clear 8 Double Bytes, fixed 080BDDD2: F001 bl 080BDDD4: FDE7 bl 0x080BF9A4 ; Swi CpuSet 080BDDD6: A801 add r0, sp, #0x004 080BDDD8: 8004 strh r4, [r0] ; Clear next stack entry 080BDDDA: 1C29 add r1, r5, #0x0 080BDDDC: 3118 add r1, #0x18 ; Start at Orig. r0 + #$18 080BDDDE: 4A06 ldr r2, =#0x01000020 ; Clear #$20 Double Bytes, fixed 080BDDE0: F001 bl 080BDDE2: FDE0 bl 0x080BF9A4 ; Swi CpuSet 080BDDE4: F001 bl 080BDDE6: FB8C bl 0x080BF500 ; ? 080BDDE8: B002 add sp, #0x008 ; Remove added Stack entries 080BDDEA: BC30 pop {r4, r5} 080BDDEC: BC01 pop {r0} 080BDDEE: 4700 bx r0 ;080BDDF0: 0004 lsl r4, r0, #0x0 ;080BDDF2: 0100 lsl r0, r0, #0x4 ;080BDDF4: 0008 lsl r0, r1, #0x0 ;080BDDF6: 0100 lsl r0, r0, #0x4 ;080BDDF8: 0020 lsl r0, r4, #0x0 ;080BDDFA: 0100 lsl r0, r0, #0x4
$080BDF70 - ?
This has some similarities to $08098484.
- This disables interrupts
- transfers the Data at $020000D0 to $0203BB68
- then replaces the Data at $020000D0 with Data from the address that is in r0
- starts a DMA that transfers #$800 byte from memory to WRAM
- Stores the Address where the data is sent to in $03007FFC
- Re-enables Interrupts
080BDF70: B570 push {r4, r5, r6, lr} 080BDF72: 1C05 add r5, r0, #0x0 ; r5 = Orig. r0 080BDF74: 4E0E ldr r6, =#0x04000208 080BDF76: 2000 mov r0, #0x00 080BDF78: 8030 strh r0, [r6] ; Disable all Interrupts 080BDF7A: 480E ldr r0, =#0x0203BB68 ; Store Address 080BDF7C: 4C0E ldr r4, =#0x020000D0 080BDF7E: 1C21 add r1, r4, #0x0 ; Load Address 080BDF80: 2238 mov r2, #0x38 ; Bytes to transfer 080BDF82: F004 bl 080BDF84: F82F bl 0x080C1FE4 ; Data Transfer 080BDF86: 1C20 add r0, r4, #0x0 ; Store Address 080BDF88: 1C29 add r1, r5, #0x0 ; Load Address (Orig. r0) 080BDF8A: 2238 mov r2, #0x38 ; Bytes to transfer 080BDF8C: F004 bl 080BDF8E: F82A bl 0x080C1FE4 ; Data Transfer 080BDF90: 490A ldr r1, =#0x040000D4 080BDF92: 480B ldr r0, =#0x080BE22C 080BDF94: 6008 str r0, [r1] ; DMA Source 080BDF96: 4A0B ldr r2, =#0x03000280 080BDF98: 604A str r2, [r1, #0x04] ; DMA Destination 080BDF9A: 480B ldr r0, =#0x80000400 080BDF9C: 6088 str r0, [r1, #0x08] ; Start DMA 080BDF9E: 6888 ldr r0, [r1, #0x08] 080BDFA0: 480A ldr r0, =#0x03007FFC 080BDFA2: 6002 str r2, [r0] ; Store #$03000280 in $03007FFC 080BDFA4: 2001 mov r0, #0x01 080BDFA6: 8030 strh r0, [r6] ; Re-enable Interrupts 080BDFA8: BC70 pop {r4, r5, r6} 080BDFAA: BC01 pop {r0} 080BDFAC: 4700 bx r0 ;080BDFAE: 0000 lsl r0, r0, #0x0 ;080BDFB0: 0208 lsl r0, r1, #0x8 ;080BDFB2: 0400 lsl r0, r0, #0x10 ;080BDFB4: BB68 pop {r3, r5, r6, pc} ;080BDFB6: 0203 lsl r3, r0, #0x8 ;080BDFB8: 00D0 lsl r0, r2, #0x3 ;080BDFBA: 0200 lsl r0, r0, #0x8 ;080BDFBC: 00D4 lsl r4, r2, #0x3 ;080BDFBE: 0400 lsl r0, r0, #0x10 ;080BDFC0: E22C b 0x080BE41C ;080BDFC2: 080B lsr r3, r1, #0x0 ;080BDFC4: 0280 lsl r0, r0, #0xA ;080BDFC6: 0300 lsl r0, r0, #0xC ;080BDFC8: 0400 lsl r0, r0, #0x10 ;080BDFCA: 8000 strh r0, [r0] ;080BDFCC: 7FFC ldrb r4, [r7, #0x1F] ;080BDFCE: 0300 lsl r0, r0, #0xC
$080BDFD0 - ?
080BDFD0: B510 push {r4, lr} 080BDFD2: 4C0B ldr r4, =#0x04000208 080BDFD4: 2000 mov r0, #0x00 080BDFD6: 8020 strh r0, [r4] ; Disable all Interrupts 080BDFD8: 480A ldr r0, =#0x020000D0 ; Store Address 080BDFDA: 490B ldr r1, =#0x0203BB68 ; Load Address 080BDFDC: 2238 mov r2, #0x38 ; Number of Bytes to Transfer 080BDFDE: F004 bl 080BDFE0: F801 bl 0x080C1FE4 ; Data Transfer 080BDFE2: 490A ldr r1, =#0x040000D4 080BDFE4: 480A ldr r0, =#0x080000FC 080BDFE6: 6008 str r0, [r1] ; DMA Source 080BDFE8: 4A0A ldr r2, =#0x03000280 080BDFEA: 604A str r2, [r1, #0x04] ; DMA Destination 080BDFEC: 480A ldr r0, =#0x80000400 080BDFEE: 6088 str r0, [r1, #0x08] ; Transfer #$400 Double Bytes 080BDFF0: 6888 ldr r0, [r1, #0x08] 080BDFF2: 480A ldr r0, =#0x03007FFC 080BDFF4: 6002 str r2, [r0] ; Store DMA Source Address in $03007FFC 080BDFF6: 2001 mov r0, #0x01 080BDFF8: 8020 strh r0, [r4] ; Re-enable all Interrupts 080BDFFA: BC10 pop {r4} 080BDFFC: BC01 pop {r0} 080BDFFE: 4700 bx r0 ;080BE000: 0208 lsl r0, r1, #0x8 ;080BE002: 0400 lsl r0, r0, #0x10 ;080BE004: 00D0 lsl r0, r2, #0x3 ;080BE006: 0200 lsl r0, r0, #0x8 ;080BE008: BB68 pop {r3, r5, r6, pc} ;080BE00A: 0203 lsl r3, r0, #0x8 ;080BE00C: 00D4 lsl r4, r2, #0x3 ;080BE00E: 0400 lsl r0, r0, #0x10 ;080BE010: 00FC lsl r4, r7, #0x3 ;080BE012: 0800 lsr r0, r0, #0x0 ;080BE014: 0280 lsl r0, r0, #0xA ;080BE016: 0300 lsl r0, r0, #0xC ;080BE018: 0400 lsl r0, r0, #0x10 ;080BE01A: 8000 strh r0, [r0] ;080BE01C: 7FFC ldrb r4, [r7, #0x1F] ;080BE01E: 0300 lsl r0, r0, #0xC
$080BE020 - ?
080BE020: 2900 cmp r1, #0x00 080BE022: D000 beq 0x080BE026 080BE024: 66C1 str r1, [r0, #0x6C] 080BE026: 4770 bx lr
$080BE028 - ?
(Never executed in Intro(?))
080BE028: B500 push {lr} 080BE02A: B081 add sp, #-0x004 080BE02C: 0409 lsl r1, r1, #0x10 080BE02E: 0C0B lsr r3, r1, #0x10 080BE030: 6EC2 ldr r2, [r0, #0x6C] 080BE032: 2A00 cmp r2, #0x00 080BE034: D007 beq 0x080BE046 080BE036: 4905 ldr r1, =#0xFFFF0000 080BE038: 9800 ldr r0, [sp] 080BE03A: 4008 and r0, r1 080BE03C: 4318 orr r0, r3 080BE03E: 9000 str r0, [sp] 080BE040: 4668 mov r0, sp 080BE042: F002 bl 080BE044: FA93 bl 0x080C056C 080BE046: B001 add sp, #0x004 080BE048: BC01 pop {r0} 080BE04A: 4700 bx r0 080BE04C: 0000 lsl r0, r0, #0x0 080BE04E: FFFF bl 0x080BF04E
$080BE050 - ?
r0 contains an address (often/always $0202DF00)
This ends with r0 containing a flag (bit 0).
If $0202DF68/9 is #$0001, exit with r0 = #$00
080BE050: B510 push {r4, lr} 080BE052: 1C04 add r4, r0, #0x0 ; r4 = Orig. r0 080BE054: 1C21 add r1, r4, #0x0 ; r1 = Orig. r0 080BE056: 3162 add r1, #0x62 080BE058: 8808 ldrh r0, [r1] 080BE05A: 2000 mov r0, #0x00 080BE05C: 8008 strh r0, [r1] ; $0202DF62/3 (Orig. r0 + #$62) = #$0000 080BE05E: 1C20 add r0, r4, #0x0 080BE060: 3058 add r0, #0x58 080BE062: 8800 ldrh r0, [r0] ; Loads $0202DF58/9 (Orig. r0 + #$58) 080BE064: 2801 cmp r0, #0x01 080BE066: D017 beq 0x080BE098 ; Exit with r0 = #$00 080BE068: 1C20 add r0, r4, #0x0 080BE06A: 3069 add r0, #0x69 080BE06C: 7801 ldrb r1, [r0] ; Loads $0202DF69 (Orig. r0 + #$69) 080BE06E: 2001 mov r0, #0x01 080BE070: 4008 and r0, r1 080BE072: 2800 cmp r0, #0x00 080BE074: D009 beq 0x080BE08A 080BE076: 7860 ldrb r0, [r4, #0x01] 080BE078: 06C0 lsl r0, r0, #0x1B 080BE07A: 2800 cmp r0, #0x00 080BE07C: DB05 blt 0x080BE08A 080BE07E: F001 bl 080BE080: FCAB bl 0x080BF9D8 080BE082: 1C20 add r0, r4, #0x0 080BE084: F000 bl 080BE086: F884 bl 0x080BE190 080BE088: E001 b 0x080BE08E 080BE08A: F001 bl 080BE08C: FCA5 bl 0x080BF9D8 ; swi VBlankIntrWait 080BE08E: 1C20 add r0, r4, #0x0 ; r4 = Orig. r0 080BE090: F000 bl 080BE092: F806 bl 0x080BE0A0 080BE094: 2001 mov r0, #0x01 080BE096: E000 b 0x080BE09A 080BE098: 2000 mov r0, #0x00 080BE09A: BC10 pop {r4} 080BE09C: BC02 pop {r1} 080BE09E: 4708 bx r1
$080BE0A0 - ?
080BE0A0: B570 push {r4, r5, r6, lr} 080BE0A2: 1C04 add r4, r0, #0x0 080BE0A4: 3018 add r0, #0x18 080BE0A6: 1C21 add r1, r4, #0x0 080BE0A8: F001 bl 080BE0AA: FA7E bl 0x080BF5A8 080BE0AC: F001 bl 080BE0AE: FA20 bl 0x080BF4F0 080BE0B0: 1C23 add r3, r4, #0x0 080BE0B2: 3369 add r3, #0x69 080BE0B4: 781A ldrb r2, [r3] 080BE0B6: 2101 mov r1, #0x01 080BE0B8: 4011 and r1, r2 080BE0BA: 2900 cmp r1, #0x00 080BE0BC: D120 bne 0x080BE100 080BE0BE: 7860 ldrb r0, [r4, #0x01] 080BE0C0: 0700 lsl r0, r0, #0x1C 080BE0C2: 0F00 lsr r0, r0, #0x1C 080BE0C4: 2803 cmp r0, #0x03 080BE0C6: D10A bne 0x080BE0DE 080BE0C8: 2001 mov r0, #0x01 080BE0CA: 4310 orr r0, r2 080BE0CC: 7018 strb r0, [r3] 080BE0CE: 1C20 add r0, r4, #0x0 080BE0D0: 305A add r0, #0x5A 080BE0D2: 8001 strh r1, [r0] 080BE0D4: 1C20 add r0, r4, #0x0 080BE0D6: 2101 mov r1, #0x01 080BE0D8: F7FF bl 080BE0DA: FFA6 bl 0x080BE028 080BE0DC: E04F b 0x080BE17E 080BE0DE: 1C21 add r1, r4, #0x0 080BE0E0: 315A add r1, #0x5A 080BE0E2: 8808 ldrh r0, [r1] 080BE0E4: 3001 add r0, #0x01 080BE0E6: 8008 strh r0, [r1] 080BE0E8: 0400 lsl r0, r0, #0x10 080BE0EA: 4904 ldr r1, =#0x02570000 080BE0EC: 4288 cmp r0, r1 080BE0EE: D946 bls 0x080BE17E 080BE0F0: 1C20 add r0, r4, #0x0 080BE0F2: 2100 mov r1, #0x00 080BE0F4: F7FF bl 080BE0F6: FF98 bl 0x080BE028 080BE0F8: E041 b 0x080BE17E 080BE0FA: 0000 lsl r0, r0, #0x0 080BE0FC: 0000 lsl r0, r0, #0x0 080BE0FE: 0257 lsl r7, r2, #0x9 080BE100: 7862 ldrb r2, [r4, #0x01] 080BE102: 0650 lsl r0, r2, #0x19 080BE104: 0F80 lsr r0, r0, #0x1E 080BE106: 1C21 add r1, r4, #0x0 080BE108: 3168 add r1, #0x68 080BE10A: 7809 ldrb r1, [r1] 080BE10C: 4288 cmp r0, r1 080BE10E: DA02 bge 0x080BE116 080BE110: 09D0 lsr r0, r2, #0x7 080BE112: 2800 cmp r0, #0x00 080BE114: D003 beq 0x080BE11E 080BE116: 1C20 add r0, r4, #0x0 080BE118: 2102 mov r1, #0x02 080BE11A: F7FF bl 080BE11C: FF85 bl 0x080BE028 080BE11E: 2100 mov r1, #0x00 080BE120: 7860 ldrb r0, [r4, #0x01] 080BE122: 06C0 lsl r0, r0, #0x1B 080BE124: 2800 cmp r0, #0x00 080BE126: DA00 bge 0x080BE12A 080BE128: 2101 mov r1, #0x01 080BE12A: 7820 ldrb r0, [r4] 080BE12C: 0700 lsl r0, r0, #0x1C 080BE12E: 0F00 lsr r0, r0, #0x1C 080BE130: 4108 asr r0, r1 080BE132: 2601 mov r6, #0x01 080BE134: 4030 and r0, r6 080BE136: 2800 cmp r0, #0x00 080BE138: D004 beq 0x080BE144 080BE13A: 1C21 add r1, r4, #0x0 080BE13C: 315C add r1, #0x5C 080BE13E: 2000 mov r0, #0x00 080BE140: 8008 strh r0, [r1] 080BE142: E01C b 0x080BE17E 080BE144: 1C25 add r5, r4, #0x0 080BE146: 355C add r5, #0x5C 080BE148: 8828 ldrh r0, [r5] 080BE14A: 3001 add r0, #0x01 080BE14C: 8028 strh r0, [r5] 080BE14E: 0400 lsl r0, r0, #0x10 080BE150: 0C00 lsr r0, r0, #0x10 080BE152: 2877 cmp r0, #0x77 080BE154: D903 bls 0x080BE15E 080BE156: 1C20 add r0, r4, #0x0 080BE158: 2102 mov r1, #0x02 080BE15A: F7FF bl 080BE15C: FF65 bl 0x080BE028 080BE15E: 8828 ldrh r0, [r5] 080BE160: 213C mov r1, #0x3C 080BE162: F002 bl 080BE164: FB0D bl 0x080C0780 080BE166: 0400 lsl r0, r0, #0x10 080BE168: 2800 cmp r0, #0x00 080BE16A: D108 bne 0x080BE17E 080BE16C: 1C21 add r1, r4, #0x0 080BE16E: 3162 add r1, #0x62 080BE170: 8808 ldrh r0, [r1] 080BE172: 2800 cmp r0, #0x00 080BE174: D103 bne 0x080BE17E 080BE176: 8808 ldrh r0, [r1] 080BE178: 800E strh r6, [r1] 080BE17A: F001 bl 080BE17C: F9E7 bl 0x080BF54C 080BE17E: 1C20 add r0, r4, #0x0 080BE180: 3008 add r0, #0x08 080BE182: F001 bl 080BE184: FABB bl 0x080BF6FC 080BE186: BC70 pop {r4, r5, r6} 080BE188: BC01 pop {r0} 080BE18A: 4700 bx r0 080BE18C: 4770 bx lr 080BE18E: 0000 lsl r0, r0, #0x0
$080BE1F0 - (Check Registers and maybe jump to a subroutine)
This gets called at least from $08098530. From there, r0 = $0202DF00. This checks two registers and either executes a subroutine or not. When the intro loops, thsi subroutine gets never executed.
080BE1F0: B500 push {lr} 080BE1F2: 1C01 add r1, r0, #0x0 080BE1F4: 3058 add r0, #0x58 080BE1F6: 8800 ldrh r0, [r0] ; (r0 = $0202DF58) 080BE1F8: 2801 cmp r0, #0x01 080BE1FA: D005 beq 0x080BE208 ; Exit if r0 = #$01 080BE1FC: 7848 ldrb r0, [r1, #0x01] ; (r0 = $0202DF01) 080BE1FE: 06C0 lsl r0, r0, #0x1B ; Only bits 0 to 4 remain 080BE200: 2800 cmp r0, #0x00 080BE202: DA01 bge 0x080BE208 ; Exit if bit 4 is clear 080BE204: F001 bl 080BE206: FB14 bl 0x080BF830 ; ? 080BE208: BC01 pop {r0} 080BE20A: 4700 bx r0
$080BE330 - Load LZ77 Compressed Data Table Entry
r1 contains the number of the Table entry. This gets multiplied by 4 (each entry is 4 bytes in size - 32 bit addresses) and added to the address in r0 (which is the Table offset). The entry that is four byte further is loaded (See line 080B3336, "r1, #0x04"), which is added to the Table Offset. The result is the address of the LZ77 compressed data, which is stored in r0.
080BE330: 0409 lsl r1, r1, #0x10 080BE332: 0B89 lsr r1, r1, #0xE ; Remove upper doublebyte, multiply by 4 080BE334: 1809 add r1, r1, r0 080BE336: 6849 ldr r1, [r1, #0x04] 080BE338: 1840 add r0, r0, r1 080BE33A: 4770 bx lr
$080BE33C - ("Difference Table value load")
r0 contains an address (a Table Start Point).
r1 contains a Table Entry number.
080BE33C: 0409 lsl r1, r1, #0x10 080BE33E: 0B89 lsr r1, r1, #0xE ; Multiply Table Entry number by 4 (each Entry is 4 bytes in size) 080BE340: 1809 add r1, r1, r0 ; Add Entry Offset to Table Offset (= Entry address) 080BE342: 6888 ldr r0, [r1, #0x08] 080BE344: 6849 ldr r1, [r1, #0x04] 080BE346: 1A40 sub r0, r0, r1 ; r0 contains the difference between the entry and the next higher one 080BE348: 4770 bx lr
$080BE5E0 - ?
- Brought in variables
- r0 =
- r1 =
- r2 =
- r3 =
080BE5E0: B5F0 push {r4, r5, r6, r7, lr} 080BE5E2: 4657 mov r7, r10 080BE5E4: 464E mov r6, r9 080BE5E6: 4645 mov r5, r8 080BE5E8: B4E0 push {r5, r6, r7} 080BE5EA: B083 add sp, #-0x00C 080BE5EC: 1C15 add r5, r2, #0x0 080BE5EE: 1C1E add r6, r3, #0x0 080BE5F0: 0400 lsl r0, r0, #0x10 080BE5F2: 0C03 lsr r3, r0, #0x10 080BE5F4: 0409 lsl r1, r1, #0x10 080BE5F6: 0C0C lsr r4, r1, #0x10 080BE5F8: 042D lsl r5, r5, #0x10 080BE5FA: 0C2D lsr r5, r5, #0x10 080BE5FC: 0436 lsl r6, r6, #0x10 080BE5FE: 0C36 lsr r6, r6, #0x10 080BE600: 9602 str r6, [sp, #0x008] 080BE602: 221F mov r2, #0x1F ; r2 = $0000001F 080BE604: 4692 mov r10, r2 ; r10 = $0000001F 080BE606: 4656 mov r6, r10 ; r3 = $0000001F 080BE608: 4033 and r3, r6 ; r3 = r3 AND $0000001F 080BE60A: 4A2B ldr r2, =#0xFFFFFF00 ; r2 = $FFFFFF00 080BE60C: 4691 mov r9, r2 ; r9 = $FFFFFF00 080BE60E: 9A00 ldr r2, [sp] 080BE610: 464E mov r6, r9 ; r6 = $FFFFFF00 080BE612: 4032 and r2, r6 ; r2 = r2 AND $FFFFFF00 080BE614: 431A orr r2, r3 ; Adds both ANDed values; no bits overlap 080BE616: 9200 str r2, [sp] ; Store new value back 080BE618: 0D42 lsr r2, r0, #0x15 080BE61A: 231F mov r3, #0x1F 080BE61C: 401A and r2, r3 080BE61E: 46E8 mov r8, sp 080BE620: 4646 mov r6, r8 080BE622: 7072 strb r2, [r6, #0x01] 080BE624: 0E80 lsr r0, r0, #0x1A 080BE626: 4018 and r0, r3 080BE628: 70B0 strb r0, [r6, #0x02] 080BE62A: 4650 mov r0, r10 080BE62C: 4004 and r4, r0 080BE62E: 9801 ldr r0, [sp, #0x004] 080BE630: 464A mov r2, r9 080BE632: 4010 and r0, r2 080BE634: 4320 orr r0, r4 080BE636: 9001 str r0, [sp, #0x004] 080BE638: 0D48 lsr r0, r1, #0x15 080BE63A: 4018 and r0, r3 080BE63C: AC01 add r4, sp, #0x004 080BE63E: 7060 strb r0, [r4, #0x01] 080BE640: 0E89 lsr r1, r1, #0x1A 080BE642: 4019 and r1, r3 080BE644: 70A1 strb r1, [r4, #0x02] 080BE646: 4668 mov r0, sp 080BE648: 7800 ldrb r0, [r0] 080BE64A: 7821 ldrb r1, [r4] 080BE64C: 1C2A add r2, r5, #0x0 080BE64E: 9B02 ldr r3, [sp, #0x008] 080BE650: F000 bl 080BE652: F838 bl 0x080BE6C4 080BE654: 0600 lsl r0, r0, #0x18 080BE656: 0E00 lsr r0, r0, #0x18 080BE658: 464E mov r6, r9 080BE65A: 4037 and r7, r6 080BE65C: 4307 orr r7, r0 080BE65E: 4641 mov r1, r8 080BE660: 7848 ldrb r0, [r1, #0x01] 080BE662: 7861 ldrb r1, [r4, #0x01] 080BE664: 1C2A add r2, r5, #0x0 080BE666: 9B02 ldr r3, [sp, #0x008] 080BE668: F000 bl 080BE66A: F82C bl 0x080BE6C4 080BE66C: 0600 lsl r0, r0, #0x18 080BE66E: 0C00 lsr r0, r0, #0x10 080BE670: 4912 ldr r1, =#0xFFFF00FF 080BE672: 400F and r7, r1 080BE674: 4307 orr r7, r0 080BE676: 4642 mov r2, r8 080BE678: 7890 ldrb r0, [r2, #0x02] 080BE67A: 78A1 ldrb r1, [r4, #0x02] 080BE67C: 1C2A add r2, r5, #0x0 080BE67E: 9B02 ldr r3, [sp, #0x008] 080BE680: F000 bl 080BE682: F820 bl 0x080BE6C4 080BE684: 0600 lsl r0, r0, #0x18 080BE686: 0A00 lsr r0, r0, #0x8 080BE688: 490D ldr r1, =#0xFF00FFFF 080BE68A: 400F and r7, r1 080BE68C: 4307 orr r7, r0 080BE68E: 0638 lsl r0, r7, #0x18 080BE690: 0E00 lsr r0, r0, #0x18 080BE692: 0A39 lsr r1, r7, #0x8 080BE694: 0609 lsl r1, r1, #0x18 080BE696: 0CC9 lsr r1, r1, #0x13 080BE698: 4308 orr r0, r1 080BE69A: 0C39 lsr r1, r7, #0x10 080BE69C: 0609 lsl r1, r1, #0x18 080BE69E: 0B89 lsr r1, r1, #0xE 080BE6A0: 4308 orr r0, r1 080BE6A2: 0400 lsl r0, r0, #0x10 080BE6A4: 0C00 lsr r0, r0, #0x10 080BE6A6: B003 add sp, #0x00C 080BE6A8: BC38 pop {r3, r4, r5} 080BE6AA: 4698 mov r8, r3 080BE6AC: 46A1 mov r9, r4 080BE6AE: 46AA mov r10, r5 080BE6B0: BCF0 pop {r4, r5, r6, r7} 080BE6B2: BC02 pop {r1} 080BE6B4: 4708 bx r1 ;080BE6B6: 0000 lsl r0, r0, #0x0 ;080BE6B8: FF00 bl 0x080BF4BA ;080BE6BA: FFFF bl 0x07FBF6BA ;080BE6BC: 00FF lsl r7, r7, #0x3 ;080BE6BE: FFFF bl 0x081BE6BE ;080BE6C0: FFFF bl 0x080BE6C0 ;080BE6C2: FF00 bl 0x080BE4C4
$080BE6C4 - ?
080BE6C4: B510 push {r4, lr} 080BE6C6: 0412 lsl r2, r2, #0x10 080BE6C8: 0C12 lsr r2, r2, #0x10 080BE6CA: 041B lsl r3, r3, #0x10 080BE6CC: 0C1B lsr r3, r3, #0x10 080BE6CE: 1A9C sub r4, r3, r2 080BE6D0: 4360 mul r0, r4 080BE6D2: 4351 mul r1, r2 080BE6D4: 1840 add r0, r0, r1 080BE6D6: 1C19 add r1, r3, #0x0 080BE6D8: F002 bl 080BE6DA: F816 bl 0x080C0708 080BE6DC: BC10 pop {r4} 080BE6DE: BC02 pop {r1} 080BE6E0: 4708 bx r1 ;080BE6E2: 0000 lsl r0, r0, #0x0
$080BE6E4 - Black Screen
This removes the settings in $04000000 and sets the first color in Palette RAM to #$0000.
080BE6E4: 2080 mov r0, #0x80 080BE6E6: 04C0 lsl r0, r0, #0x13 080BE6E8: 2100 mov r1, #0x00 080BE6EA: 8001 strh r1, [r0] ; Set $04000000 to #$0000 (Video Mode 0, no Screen Display) 080BE6EC: 20A0 mov r0, #0xA0 080BE6EE: 04C0 lsl r0, r0, #0x13 080BE6F0: 8001 strh r1, [r0] ; Set $05000000 to #$0000 (Set Color 0 to pitchblack) 080BE6F2: 4770 bx lr
$080BE72C - (Clear twelve Bytes and three Bits?)
r0 contains an address. This subroutine removes Bits 0 to 2 from the thirteenth Byte from r0 and clears the twelve bytes in between.
080BE72C: 7B02 ldrb r2, [r0, #0x0C] ; r2 = [r0 + #$0C] 080BE72E: 2102 mov r1, #0x02 080BE730: 4249 neg r1, r1 080BE732: 4011 and r1, r2 ; Remove Bit 0 080BE734: 2203 mov r2, #0x03 080BE736: 4252 neg r2, r2 080BE738: 4011 and r1, r2 ; Remove Bit 1 080BE73A: 3A02 sub r2, #0x02 080BE73C: 4011 and r1, r2 ; Remove Bit 2 080BE73E: 7301 strb r1, [r0, #0x0C] ; Store Byte back 080BE740: 2100 mov r1, #0x00 080BE742: 8001 strh r1, [r0] ; Clear the twelve bytes before 080BE744: 8041 strh r1, [r0, #0x02] 080BE746: 8081 strh r1, [r0, #0x04] 080BE748: 80C1 strh r1, [r0, #0x06] 080BE74A: 8101 strh r1, [r0, #0x08] 080BE74C: 8141 strh r1, [r0, #0x0A] 080BE74E: 4770 bx lr
$080BE750 - Load Key Input
080BE750: B530 push {r4, r5, lr} 080BE752: 1C03 add r3, r0, #0x0 080BE754: 4808 ldr r0, =#0x04000130 080BE756: 8800 ldrh r0, [r0] ; Load Key Input 080BE758: 43C0 mvn r0, r0 ; r0 = NOT r0 080BE75A: 0580 lsl r0, r0, #0x16 080BE75C: 0D84 lsr r4, r0, #0x16 ; Remove Upper ten Bits and store in r4 080BE75E: 7B19 ldrb r1, [r3, #0x0C] 080BE760: 2002 mov r0, #0x02 080BE762: 4301 orr r1, r0 080BE764: 7319 strb r1, [r3, #0x0C] 080BE766: 2C00 cmp r4, #0x00 080BE768: D108 bne 0x080BE77C ; Branch if any Button is Pressed 080BE76A: 809C strh r4, [r3, #0x04] 080BE76C: 2003 mov r0, #0x03 080BE76E: 4240 neg r0, r0 080BE770: 4001 and r1, r0 080BE772: 7319 strb r1, [r3, #0x0C] 080BE774: 815C strh r4, [r3, #0x0A] 080BE776: E01C b 0x080BE7B2 ;080BE778: 0130 lsl r0, r6, #0x4 ;080BE77A: 0400 lsl r0, r0, #0x10 080BE77C: 2004 mov r0, #0x04 080BE77E: 4008 and r0, r1 080BE780: 2800 cmp r0, #0x00 080BE782: D003 beq 0x080BE78C 080BE784: 2005 mov r0, #0x05 080BE786: 4240 neg r0, r0 080BE788: 4001 and r1, r0 080BE78A: 7319 strb r1, [r3, #0x0C] 080BE78C: 8898 ldrh r0, [r3, #0x04] 080BE78E: 2800 cmp r0, #0x00 080BE790: D102 bne 0x080BE798 080BE792: 200A mov r0, #0x0A 080BE794: 8098 strh r0, [r3, #0x04] 080BE796: E00C b 0x080BE7B2 080BE798: 3801 sub r0, #0x01 080BE79A: 8098 strh r0, [r3, #0x04] 080BE79C: 0400 lsl r0, r0, #0x10 080BE79E: 2800 cmp r0, #0x00 080BE7A0: D102 bne 0x080BE7A8 080BE7A2: 2006 mov r0, #0x06 080BE7A4: 8098 strh r0, [r3, #0x04] 080BE7A6: E004 b 0x080BE7B2 080BE7A8: 7B19 ldrb r1, [r3, #0x0C] 080BE7AA: 2003 mov r0, #0x03 080BE7AC: 4240 neg r0, r0 080BE7AE: 4008 and r0, r1 080BE7B0: 7318 strb r0, [r3, #0x0C] 080BE7B2: 7B19 ldrb r1, [r3, #0x0C] 080BE7B4: 2002 mov r0, #0x02 080BE7B6: 4008 and r0, r1 080BE7B8: 1C0D add r5, r1, #0x0 080BE7BA: 8859 ldrh r1, [r3, #0x02] 080BE7BC: 2800 cmp r0, #0x00 080BE7BE: D008 beq 0x080BE7D2 080BE7C0: 8918 ldrh r0, [r3, #0x08] 080BE7C2: 4281 cmp r1, r0 080BE7C4: D102 bne 0x080BE7CC 080BE7C6: 8958 ldrh r0, [r3, #0x0A] 080BE7C8: 3001 add r0, #0x01 080BE7CA: E000 b 0x080BE7CE 080BE7CC: 2000 mov r0, #0x00 080BE7CE: 8158 strh r0, [r3, #0x0A] 080BE7D0: 8119 strh r1, [r3, #0x08] 080BE7D2: 1C22 add r2, r4, #0x0 080BE7D4: 438A bic r2, r1 080BE7D6: 801A strh r2, [r3] 080BE7D8: 805C strh r4, [r3, #0x02] 080BE7DA: 2002 mov r0, #0x02 080BE7DC: 4028 and r0, r5 080BE7DE: 2800 cmp r0, #0x00 080BE7E0: D005 beq 0x080BE7EE 080BE7E2: 88D8 ldrh r0, [r3, #0x06] 080BE7E4: 4302 orr r2, r0 080BE7E6: 801A strh r2, [r3] 080BE7E8: 2000 mov r0, #0x00 080BE7EA: 80D8 strh r0, [r3, #0x06] 080BE7EC: E002 b 0x080BE7F4 ; Exit 080BE7EE: 88D8 ldrh r0, [r3, #0x06] 080BE7F0: 4302 orr r2, r0 080BE7F2: 80DA strh r2, [r3, #0x06] 080BE7F4: BC30 pop {r4, r5} 080BE7F6: BC01 pop {r0} 080BE7F8: 4700 bx r0 ;080BE7FA: 0000 lsl r0, r0, #0x0
$080BE7FC - (Clear and set some registers)
r0 contains an address
080BE7FC: B5F0 push {r4, r5, r6, r7, lr} 080BE7FE: 2100 mov r1, #0x00 080BE800: 7401 strb r1, [r0, #0x10] ; Clear Orig. r0 + #$10 080BE802: 2108 mov r1, #0x08 080BE804: 7441 strb r1, [r0, #0x11] ; Set Orig. r0 + #$11 to #$08 080BE806: 74C1 strb r1, [r0, #0x13] ; Set Orig. r0 + #$13 to #$08 080BE808: 7481 strb r1, [r0, #0x12] ; Set Orig. r0 + #$12 to #$08 080BE80A: 1C02 add r2, r0, #0x0 ; r2 = Orig. r0 080BE80C: 2400 mov r4, #0x00 ; Set up Loop Counter 080BE80E: 2002 mov r0, #0x02 080BE810: 4240 neg r0, r0 080BE812: 4684 mov r12, r0 ; r12 = #$FFFFFFFE 080BE814: 2300 mov r3, #0x00 080BE816: 2703 mov r7, #0x03 080BE818: 427F neg r7, r7 ; r7 = #$FFFFFFFD 080BE81A: 2605 mov r6, #0x05 080BE81C: 4276 neg r6, r6 ; r6 = #$FFFFFFFB 080BE81E: 2509 mov r5, #0x09 080BE820: 426D neg r5, r5 ; r5 = #$FFFFFFF7 080BE822: 7950 ldrb r0, [r2, #0x05] 080BE824: 4661 mov r1, r12 080BE826: 4001 and r1, r0 080BE828: 7113 strb r3, [r2, #0x04] ; Clear Orig. r0 + #$04/C 080BE82A: 4039 and r1, r7 080BE82C: 4031 and r1, r6 080BE82E: 4029 and r1, r5 080BE830: 7151 strb r1, [r2, #0x05] ; Orig. r0 + #$05/D got Bits 0 to 3 cleared 080BE832: 8013 strh r3, [r2] ; Clear Orig. r0 + #$00/1/8/9 080BE834: 8053 strh r3, [r2, #0x02] ; Clear Orig. r0 + #$02/3/A/B 080BE836: 1C60 add r0, r4, #0x1 ; Inc Loop counter 080BE838: 0400 lsl r0, r0, #0x10 080BE83A: 0C04 lsr r4, r0, #0x10 080BE83C: 3208 add r2, #0x08 080BE83E: 2C01 cmp r4, #0x01 080BE840: D9EF bls 0x080BE822 ; Repeat this Loop one time 080BE842: BCF0 pop {r4, r5, r6, r7} 080BE844: BC01 pop {r0} 080BE846: 4700 bx r0
$080BE8E4 - Timer
r0 contains an address, as far as I've checked, it's always $0203BBF0.
r0 + #$10 ($0203BC00) = Big Timer (incremented each time the Small Timer runs out)
r0 + #$11 ($0203BC01) = Big Timer Goal value
r0 + #$12 ($0203BC02) = Small Timer (decremented each Loop)
r0 + #$13 ($0203BC03) = Small Timer restore value
Note that this subroutine itself does nothing, no Flag Set or anything, when the big timer runs out. So, when this subroutine is used, it has to be checked if r0+#$10 = #$00.
080BE8E4: 1C01 add r1, r0, #0x0 080BE8E6: 7C88 ldrb r0, [r1, #0x12] ; Load byte from Original r0 + #$12, decrement, store back 080BE8E8: 3801 sub r0, #0x01 080BE8EA: 7488 strb r0, [r1, #0x12] 080BE8EC: 0600 lsl r0, r0, #0x18 ; r2 = Loaded Byte AND #$000000FF 080BE8EE: 0E02 lsr r2, r0, #0x18 080BE8F0: 2A00 cmp r2, #0x00 080BE8F2: D10A bne 0x080BE90A ; Exit if value is <> #$00 080BE8F4: 7CC8 ldrb r0, [r1, #0x13] ; Restore Small Timer value 080BE8F6: 7488 strb r0, [r1, #0x12] 080BE8F8: 7C08 ldrb r0, [r1, #0x10] ; Increment Big Timer value 080BE8FA: 3001 add r0, #0x01 080BE8FC: 7408 strb r0, [r1, #0x10] 080BE8FE: 0600 lsl r0, r0, #0x18 080BE900: 0E00 lsr r0, r0, #0x18 080BE902: 7C4B ldrb r3, [r1, #0x11] 080BE904: 4298 cmp r0, r3 ; Has the "big timer" already reached the max, value? 080BE906: D100 bne 0x080BE90A ; If not, exit 080BE908: 740A strb r2, [r1, #0x10] ; If it has, clear Big Timer 080BE90A: 4770 bx lr
$080BE90C - Clear VRAM, Pal RAM, OAM
Three DMAs that completely clear VRAM, Palette RAM and OAM.
080BE90C: B081 add sp, #-0x004 ; Add another Stack Entry 080BE90E: 2000 mov r0, #0x00 080BE910: 9000 str r0, [sp] ; Clear new Stack Entry 080BE912: 491E ldr r1, =#0x040000D4 080BE914: 4668 mov r0, sp 080BE916: 6008 str r0, [r1] ; DMA Source: Cleared Stack Entry 080BE918: 20C0 mov r0, #0xC0 080BE91A: 04C0 lsl r0, r0, #0x13 080BE91C: 6048 str r0, [r1, #0x04] ; Destination: VRAM ($06000000) 080BE91E: 481C ldr r0, =#0x85006000 080BE920: 6088 str r0, [r1, #0x08] ; Fixed DMA, transfer #$6000 Quadruple Bytes (= #$18000, whole VRAM) 080BE922: 6888 ldr r0, [r1, #0x08] 080BE924: 6888 ldr r0, [r1, #0x08] 080BE926: 2280 mov r2, #0x80 080BE928: 0612 lsl r2, r2, #0x18 080BE92A: 2800 cmp r0, #0x00 080BE92C: DA03 bge 0x080BE936 080BE92E: 6888 ldr r0, [r1, #0x08] 080BE930: 4010 and r0, r2 080BE932: 2800 cmp r0, #0x00 080BE934: D1FB bne 0x080BE92E 080BE936: 2000 mov r0, #0x00 080BE938: 9000 str r0, [sp] ; Clear new Stack Entry. Again 080BE93A: 4914 ldr r1, =#0x040000D4 080BE93C: 4668 mov r0, sp 080BE93E: 6008 str r0, [r1] ; DMA Source: Cleared Stack Entry 080BE940: 20A0 mov r0, #0xA0 080BE942: 04C0 lsl r0, r0, #0x13 080BE944: 6048 str r0, [r1, #0x04] ; Destination: Palette RAM ($05000000) 080BE946: 4813 ldr r0, =#0x85000100 080BE948: 6088 str r0, [r1, #0x08] ; Fixed DMA, transfer #$100 Quadruple Bytes (= #$400, whole Pal RAM) 080BE94A: 6888 ldr r0, [r1, #0x08] 080BE94C: 6888 ldr r0, [r1, #0x08] 080BE94E: 2280 mov r2, #0x80 080BE950: 0612 lsl r2, r2, #0x18 080BE952: 2800 cmp r0, #0x00 080BE954: DA03 bge 0x080BE95E 080BE956: 6888 ldr r0, [r1, #0x08] 080BE958: 4010 and r0, r2 080BE95A: 2800 cmp r0, #0x00 080BE95C: D1FB bne 0x080BE956 080BE95E: 2000 mov r0, #0x00 080BE960: 9000 str r0, [sp] ; Clear new Stack Entry. Agaaain 080BE962: 490A ldr r1, =#0x040000D4 080BE964: 4668 mov r0, sp 080BE966: 6008 str r0, [r1] ; DMA Source: Cleared Stack Entry 080BE968: 20E0 mov r0, #0xE0 080BE96A: 04C0 lsl r0, r0, #0x13 080BE96C: 6048 str r0, [r1, #0x04] ; Destination: OAM ($07000000) 080BE96E: 4809 ldr r0, =#0x85000100 080BE970: 6088 str r0, [r1, #0x08] ; Fixed DMA, transfer #$100 Quadruple Bytes (= #$400, whole OAM) 080BE972: 6888 ldr r0, [r1, #0x08] 080BE974: 6888 ldr r0, [r1, #0x08] 080BE976: 2280 mov r2, #0x80 080BE978: 0612 lsl r2, r2, #0x18 080BE97A: 2800 cmp r0, #0x00 080BE97C: DA03 bge 0x080BE986 080BE97E: 6888 ldr r0, [r1, #0x08] 080BE980: 4010 and r0, r2 080BE982: 2800 cmp r0, #0x00 080BE984: D1FB bne 0x080BE97E 080BE986: B001 add sp, #0x004 ; Remove added Stack Entry 080BE988: 4770 bx lr ;080BE98A: 0000 lsl r0, r0, #0x0 ;080BE98C: 00D4 lsl r4, r2, #0x3 ;080BE98E: 0400 lsl r0, r0, #0x10 ;080BE990: 6000 str r0, [r0] ;080BE992: 8500 strh r0, [r0, #0x28] ;080BE994: 0100 lsl r0, r0, #0x4 ;080BE996: 8500 strh r0, [r0, #0x28]
$080BE998 - Disable all Sprites
r0 contains an address.
080BE998: B5F0 push {r4, r5, r6, r7, lr} 080BE99A: 464F mov r7, r9 080BE99C: 4646 mov r6, r8 080BE99E: B4C0 push {r6, r7} 080BE9A0: 1C06 add r6, r0, #0x0 ; Store r0 in r6 080BE9A2: 2096 mov r0, #0x96 080BE9A4: 0140 lsl r0, r0, #0x5 ; #$000012C0 080BE9A6: 1833 add r3, r6, r0 ; Add #$000012C0 to value of r0 (Address of OAM Buffer) 080BE9A8: 2400 mov r4, #0x00 080BE9AA: 4922 ldr r1, =#0xFFFFFE00 080BE9AC: 4689 mov r9, r1 ; ? 080BE9AE: 253F mov r5, #0x3F ; ? 080BE9B0: 2204 mov r2, #0x04 080BE9B2: 4252 neg r2, r2 ; r2 = #$FFFFFFFB 080BE9B4: 4690 mov r8, r2 ; Store r2 in r8 080BE9B6: 20F0 mov r0, #0xF0 080BE9B8: 4684 mov r12, r0 ; ? 080BE9BA: 27A0 mov r7, #0xA0 ; ? 080BE9BC: 8859 ldrh r1, [r3, #0x02] ; Load Sprite Attribute Byte 2 080BE9BE: 4648 mov r0, r9 080BE9C0: 4008 and r0, r1 ; Remove bits 0-8 (Tile Number) 080BE9C2: 4661 mov r1, r12 080BE9C4: 4308 orr r0, r1 ; Set bits 4-7 (Tile number #$F0 = #240) 080BE9C6: 8058 strh r0, [r3, #0x02] ; Store value back 080BE9C8: 701F strb r7, [r3] ; Store #$A0 (Y-Position: 160px) 080BE9CA: 7858 ldrb r0, [r3, #0x01] ; ? 080BE9CC: 1C29 add r1, r5, #0x0 080BE9CE: 4001 and r1, r0 ; Remove MSB 080BE9D0: 78DA ldrb r2, [r3, #0x03] ; ? 080BE9D2: 1C28 add r0, r5, #0x0 080BE9D4: 4010 and r0, r2 ; Remove MSB 080BE9D6: 70D8 strb r0, [r3, #0x03] ; ? 080BE9D8: 4642 mov r2, r8 080BE9DA: 4011 and r1, r2 ; ? 080BE9DC: 2002 mov r0, #0x02 080BE9DE: 4301 orr r1, r0 ; ? 080BE9E0: 7059 strb r1, [r3, #0x01] ; ? 080BE9E2: 1C60 add r0, r4, #0x1 ; Increment r4 080BE9E4: 0400 lsl r0, r0, #0x10 080BE9E6: 0C04 lsr r4, r0, #0x10 080BE9E8: 3308 add r3, #0x08 ; Increment r3 by 8; do next OAM Entry 080BE9EA: 2C7F cmp r4, #0x7F ; Loop until it's done #$80 times (whole OAM done) 080BE9EC: D9E6 bls 0x080BE9BC 080BE9EE: 20BE mov r0, #0xBE 080BE9F0: 0140 lsl r0, r0, #0x5 ; r0 = #$000017C0 080BE9F2: 1831 add r1, r6, r0 ; ? 080BE9F4: 2400 mov r4, #0x00 080BE9F6: 2200 mov r2, #0x00 080BE9F8: 8808 ldrh r0, [r1] ; ? 080BE9FA: 800A strh r2, [r1] ; Clear register 080BE9FC: 8848 ldrh r0, [r1, #0x02] ; ? 080BE9FE: 804A strh r2, [r1, #0x02] ; Clear register 080BEA00: 8888 ldrh r0, [r1, #0x04] ; ? 080BEA02: 808A strh r2, [r1, #0x04] ; Clear register 080BEA04: 88C8 ldrh r0, [r1, #0x06] ; ? 080BEA06: 80CA strh r2, [r1, #0x06] ; Clear register 080BEA08: 1C60 add r0, r4, #0x1 ; Increment r4 080BEA0A: 0400 lsl r0, r0, #0x10 080BEA0C: 0C04 lsr r4, r0, #0x10 080BEA0E: 3108 add r1, #0x08 ; Increment r1 by 8 080BEA10: 2C1F cmp r4, #0x1F ; Loop until it's done #$20 times 080BEA12: D9F1 bls 0x080BE9F8 080BEA14: 4908 ldr r1, =#0x00001F04 ; Clear Register 080BEA16: 1870 add r0, r6, r1 080BEA18: 8801 ldrh r1, [r0] 080BEA1A: 2100 mov r1, #0x00 080BEA1C: 8001 strh r1, [r0] 080BEA1E: 4A07 ldr r2, =#0x00001F06 ; Clear Register 080BEA20: 18B0 add r0, r6, r2 080BEA22: 8802 ldrh r2, [r0] ; This subroutine is left with that loaded value in r2 080BEA24: 8001 strh r1, [r0] 080BEA26: BC18 pop {r3, r4} 080BEA28: 4698 mov r8, r3 080BEA2A: 46A1 mov r9, r4 080BEA2C: BCF0 pop {r4, r5, r6, r7} 080BEA2E: BC01 pop {r0} 080BEA30: 4700 bx r0 ;DATA ;======= ;080BEA32: 0000 lsl r0, r0, #0x0 ;080BEA34: FE00 bl 0x080BF636 ;080BEA36: FFFF bl 0x07EBFA36 ;080BEA38: 1F04 sub r4, r0, #0x4 ;080BEA3A: 0000 lsl r0, r0, #0x0 ;080BEA3C: 1F06 sub r6, r0, #0x4 ;080BEA3E: 0000 lsl r0, r0, #0x0
$080BEA40 - ?
080BEA40: B530 push {r4, r5, lr} 080BEA42: 1C03 add r3, r0, #0x0 ; r3 = Orig. r0 080BEA44: 2000 mov r0, #0x00 ; Set up r0 as Outer Loop counter 080BEA46: 2200 mov r2, #0x00 ; Set up r2 as Inner Loop Counter 080BEA48: 1C44 add r4, r0, #0x1 ; INC Outer Loop counter 080BEA4A: 1C0D add r5, r1, #0x0 ; ? 080BEA4C: 3508 add r5, #0x08 ; ? 080BEA4E: 0050 lsl r0, r2, #0x1 080BEA50: 1808 add r0, r1, r0 080BEA52: 8800 ldrh r0, [r0] ; r0 = [r1 + Loopcounter * 8 + Loop Counter * 2] 080BEA54: 80D8 strh r0, [r3, #0x06] ; Store in [Orig. r0 + Loop Counter * 8 + #$06] 080BEA56: 1C50 add r0, r2, #0x1 ; Inc Inner Loop Counter 080BEA58: 0400 lsl r0, r0, #0x10 080BEA5A: 0C02 lsr r2, r0, #0x10 ; Inner Loop Counter AND #$0000FFFF 080BEA5C: 3308 add r3, #0x08 080BEA5E: 2A03 cmp r2, #0x03 080BEA60: D9F5 bls 0x080BEA4E ; repeat 4 times 080BEA62: 0420 lsl r0, r4, #0x10 080BEA64: 0C00 lsr r0, r0, #0x10 080BEA66: 1C29 add r1, r5, #0x0 080BEA68: 281F cmp r0, #0x1F 080BEA6A: D9EC bls 0x080BEA46 080BEA6C: BC30 pop {r4, r5} 080BEA6E: BC01 pop {r0} 080BEA70: 4700 bx r0 ;080BEA72: 0000 lsl r0, r0, #0x0
$080BEA78 - ?
080BEA78: B5F0 push {r4, r5, r6, r7, lr} 080BEA7A: 4657 mov r7, r10 080BEA7C: 464E mov r6, r9 080BEA7E: 4645 mov r5, r8 080BEA80: B4E0 push {r5, r6, r7} 080BEA82: B086 add sp, #-0x018 080BEA84: 1C05 add r5, r0, #0x0 080BEA86: 0409 lsl r1, r1, #0x10 080BEA88: 0C09 lsr r1, r1, #0x10 080BEA8A: 9104 str r1, [sp, #0x010] 080BEA8C: A802 add r0, sp, #0x008 080BEA8E: 2101 mov r1, #0x01 080BEA90: 8001 strh r1, [r0] 080BEA92: 1C04 add r4, r0, #0x0 080BEA94: E004 b 0x080BEAA0 080BEA96: 8821 ldrh r1, [r4] 080BEA98: 0048 lsl r0, r1, #0x1 080BEA9A: 1840 add r0, r0, r1 080BEA9C: 3001 add r0, #0x01 080BEA9E: 8020 strh r0, [r4] 080BEAA0: 9804 ldr r0, [sp, #0x010] 080BEAA2: 2109 mov r1, #0x09 080BEAA4: F001 bl 080BEAA6: FE30 bl 0x080C0708 080BEAA8: 8821 ldrh r1, [r4] 080BEAAA: 0400 lsl r0, r0, #0x10 080BEAAC: 0C00 lsr r0, r0, #0x10 080BEAAE: 4281 cmp r1, r0 080BEAB0: D3F1 bcc 0x080BEA96 080BEAB2: 1C21 add r1, r4, #0x0 080BEAB4: 8808 ldrh r0, [r1] 080BEAB6: 2800 cmp r0, #0x00 080BEAB8: D067 beq 0x080BEB8A 080BEABA: 4668 mov r0, sp 080BEABC: 300A add r0, #0x0A 080BEABE: 9005 str r0, [sp, #0x014] 080BEAC0: 4688 mov r8, r1 080BEAC2: 8808 ldrh r0, [r1] 080BEAC4: 9905 ldr r1, [sp, #0x014] 080BEAC6: 8008 strh r0, [r1] 080BEAC8: 8808 ldrh r0, [r1] 080BEACA: 9A04 ldr r2, [sp, #0x010] 080BEACC: 4290 cmp r0, r2 080BEACE: D251 bcs 0x080BEB74 080BEAD0: A803 add r0, sp, #0x00C 080BEAD2: 4681 mov r9, r0 080BEAD4: 468C mov r12, r1 080BEAD6: 464E mov r6, r9 080BEAD8: 4661 mov r1, r12 080BEADA: 8808 ldrh r0, [r1] 080BEADC: 464A mov r2, r9 080BEADE: 8010 strh r0, [r2] 080BEAE0: 4644 mov r4, r8 080BEAE2: 8811 ldrh r1, [r2] 080BEAE4: 8820 ldrh r0, [r4] 080BEAE6: 4281 cmp r1, r0 080BEAE8: D33C bcc 0x080BEB64 080BEAEA: 4B2C ldr r3, =#0x040000D4 080BEAEC: 482C ldr r0, =#0x80000004 080BEAEE: 4682 mov r10, r0 ; Temp-store DMA-Activation bytes 080BEAF0: 1C37 add r7, r6, #0x0 080BEAF2: 8838 ldrh r0, [r7] 080BEAF4: 00C0 lsl r0, r0, #0x3 080BEAF6: 1940 add r0, r0, r5 080BEAF8: 3808 sub r0, #0x08 080BEAFA: 7941 ldrb r1, [r0, #0x05] 080BEAFC: 0709 lsl r1, r1, #0x1C 080BEAFE: 8838 ldrh r0, [r7] 080BEB00: 00C0 lsl r0, r0, #0x3 080BEB02: 1940 add r0, r0, r5 080BEB04: 7940 ldrb r0, [r0, #0x05] 080BEB06: 0700 lsl r0, r0, #0x1C 080BEB08: 0F89 lsr r1, r1, #0x1E 080BEB0A: 0F80 lsr r0, r0, #0x1E 080BEB0C: 4281 cmp r1, r0 080BEB0E: D929 bls 0x080BEB64 080BEB10: 8830 ldrh r0, [r6] 080BEB12: 00C0 lsl r0, r0, #0x3 080BEB14: 1828 add r0, r5, r0 080BEB16: 6018 str r0, [r3] 080BEB18: 4669 mov r1, sp 080BEB1A: 6059 str r1, [r3, #0x04] 080BEB1C: 4652 mov r2, r10 080BEB1E: 609A str r2, [r3, #0x08] ; Start DMA (4 Doublebytes) 080BEB20: 6898 ldr r0, [r3, #0x08] 080BEB22: 8830 ldrh r0, [r6] 080BEB24: 1C22 add r2, r4, #0x0 080BEB26: 8821 ldrh r1, [r4] 080BEB28: 1A40 sub r0, r0, r1 080BEB2A: 00C0 lsl r0, r0, #0x3 080BEB2C: 1828 add r0, r5, r0 080BEB2E: 6018 str r0, [r3] 080BEB30: 8830 ldrh r0, [r6] 080BEB32: 00C0 lsl r0, r0, #0x3 080BEB34: 1828 add r0, r5, r0 080BEB36: 6058 str r0, [r3, #0x04] 080BEB38: 4650 mov r0, r10 080BEB3A: 6098 str r0, [r3, #0x08] 080BEB3C: 6898 ldr r0, [r3, #0x08] 080BEB3E: 4669 mov r1, sp 080BEB40: 6019 str r1, [r3] 080BEB42: 8830 ldrh r0, [r6] 080BEB44: 8821 ldrh r1, [r4] 080BEB46: 1A40 sub r0, r0, r1 080BEB48: 00C0 lsl r0, r0, #0x3 080BEB4A: 1828 add r0, r5, r0 080BEB4C: 6058 str r0, [r3, #0x04] 080BEB4E: 4650 mov r0, r10 080BEB50: 6098 str r0, [r3, #0x08] 080BEB52: 6898 ldr r0, [r3, #0x08] 080BEB54: 8831 ldrh r1, [r6] 080BEB56: 8820 ldrh r0, [r4] 080BEB58: 1A09 sub r1, r1, r0 080BEB5A: 8031 strh r1, [r6] 080BEB5C: 8839 ldrh r1, [r7] 080BEB5E: 8810 ldrh r0, [r2] 080BEB60: 4281 cmp r1, r0 080BEB62: D2C6 bcs 0x080BEAF2 080BEB64: 4661 mov r1, r12 080BEB66: 8808 ldrh r0, [r1] 080BEB68: 3001 add r0, #0x01 080BEB6A: 8008 strh r0, [r1] 080BEB6C: 8808 ldrh r0, [r1] 080BEB6E: 9A04 ldr r2, [sp, #0x010] 080BEB70: 4290 cmp r0, r2 080BEB72: D3B1 bcc 0x080BEAD8 080BEB74: 4641 mov r1, r8 080BEB76: 8808 ldrh r0, [r1] 080BEB78: 2103 mov r1, #0x03 080BEB7A: F001 bl 080BEB7C: FDC5 bl 0x080C0708 080BEB7E: 4642 mov r2, r8 080BEB80: 8010 strh r0, [r2] 080BEB82: 4641 mov r1, r8 080BEB84: 8810 ldrh r0, [r2] 080BEB86: 2800 cmp r0, #0x00 080BEB88: D19B bne 0x080BEAC2 080BEB8A: B006 add sp, #0x018 080BEB8C: BC38 pop {r3, r4, r5} 080BEB8E: 4698 mov r8, r3 080BEB90: 46A1 mov r9, r4 080BEB92: 46AA mov r10, r5 080BEB94: BCF0 pop {r4, r5, r6, r7} 080BEB96: BC01 pop {r0} 080BEB98: 4700 bx r0 ;080BEB9A: 0000 lsl r0, r0, #0x0 ;080BEB9C: 00D4 lsl r4, r2, #0x3 ;080BEB9E: 0400 lsl r0, r0, #0x10 ;080BEBA0: 0004 lsl r4, r0, #0x0 ;080BEBA2: 8000 strh r0, [r0] ;080BEBA4: 4770 bx lr ;080BEBA6: 0000 lsl r0, r0, #0x0
$080BEBA8 - ?
r0 contains an address.
r1 contains a counter/compare value.
Doublebytes from r0 are loaded and added to each other. This is repeated [r1 /2] times. The result gets stored in r0.
080BEBA8: B510 push {r4, lr} 080BEBAA: B081 add sp, #-0x004 ; add 4 bytes on stack 080BEBAC: 1C03 add r3, r0, #0x0 080BEBAE: 1C0C add r4, r1, #0x0 080BEBB0: 2000 mov r0, #0x00 080BEBB2: 9000 str r0, [sp] ; Clear the newly added 4 bytes on stack 080BEBB4: 0864 lsr r4, r4, #0x1 ; r4 = r4 / 2 080BEBB6: 2200 mov r2, #0x00 080BEBB8: 42A2 cmp r2, r4 ; Is r4 clear now? 080BEBBA: D207 bcs 0x080BEBCC ; If it is, overbranch the loop and exit 080BEBBC: 8819 ldrh r1, [r3] ; Load doublebyte from [r3] 080BEBBE: 9800 ldr r0, [sp] 080BEBC0: 1840 add r0, r0, r1 ; Add it to the [r3]-value-accumulation on stack... 080BEBC2: 9000 str r0, [sp] ; ... and store it back on stack 080BEBC4: 3201 add r2, #0x01 ; Increment counter 080BEBC6: 3302 add r3, #0x02 ; Double-Increment Load address 080BEBC8: 42A2 cmp r2, r4 ; Has the counter reached it's limit? 080BEBCA: D3F7 bcc 0x080BEBBC ; Loop if not 080BEBCC: 9800 ldr r0, [sp] ; Load the accumulation (the result of this subroutine) in r0 080BEBCE: B001 add sp, #0x004 ; Remove the temp value from stack 080BEBD0: BC10 pop {r4} ; Restore registers and exit 080BEBD2: BC02 pop {r1} 080BEBD4: 4708 bx r1 ;080BEBD6: 0000 lsl r0, r0, #0x0
$080BEBD8 - ?
080BEBD8: B570 push {r4, r5, r6, lr} 080BEBDA: B088 add sp, #-0x020 ; Add new Stack entries 080BEBDC: 1C16 add r6, r2, #0x0 ; r6 = Orig. r2 080BEBDE: 9C0C ldr r4, [sp, #0x030] ; Restore Orig. r4!? 080BEBE0: 041B lsl r3, r3, #0x10 080BEBE2: 0424 lsl r4, r4, #0x10 080BEBE4: 0C24 lsr r4, r4, #0x10 ; r4 AND #$0000FFFF 080BEBE6: 0ADB lsr r3, r3, #0xB ; r3 AND #$0000FFFF * #$40 080BEBE8: 18C0 add r0, r0, r3 ; r0 = Orig. r0 + Orig. r3 * #$40 080BEBEA: 6802 ldr r2, [r0] ; Transfer thirty-two bytes from r0 into newly added stack entries 080BEBEC: 9200 str r2, [sp] 080BEBEE: 6842 ldr r2, [r0, #0x04] 080BEBF0: 9201 str r2, [sp, #0x004] 080BEBF2: 6902 ldr r2, [r0, #0x10] 080BEBF4: 9202 str r2, [sp, #0x008] 080BEBF6: 6942 ldr r2, [r0, #0x14] 080BEBF8: 9203 str r2, [sp, #0x00C] 080BEBFA: 6882 ldr r2, [r0, #0x08] 080BEBFC: 9204 str r2, [sp, #0x010] 080BEBFE: 68C2 ldr r2, [r0, #0x0C] 080BEC00: 9205 str r2, [sp, #0x014] 080BEC02: AD04 add r5, sp, #0x010 080BEC04: 6982 ldr r2, [r0, #0x18] 080BEC06: 9206 str r2, [sp, #0x018] 080BEC08: 69C0 ldr r0, [r0, #0x1C] 080BEC0A: 9007 str r0, [sp, #0x01C] 080BEC0C: 1C08 add r0, r1, #0x0 ; r0 = Orig. r1 080BEC0E: 4669 mov r1, sp ; r1 = Stack Address 080BEC10: 1C22 add r2, r4, #0x0 ; r2 = Orig. r4 080BEC12: 2302 mov r3, #0x02 080BEC14: F000 bl 080BEC16: F80A bl 0x080BEC2C ; ? 080BEC18: 1C30 add r0, r6, #0x0 ; r0 = Orig. r2 080BEC1A: 1C29 add r1, r5, #0x0 ; r1 = sp, #$010 080BEC1C: 1C22 add r2, r4, #0x0 ; r2 = Orig. r4 080BEC1E: 2302 mov r3, #0x02 080BEC20: F000 bl 080BEC22: F804 bl 0x080BEC2C ; ? 080BEC24: B008 add sp, #0x020 080BEC26: BC70 pop {r4, r5, r6} 080BEC28: BC01 pop {r0} 080BEC2A: 4700 bx r0
$080BEDD8 - swi VBlankIntrWait (Wait for VBlank)
080BEDD8: B500 push {lr} 080BEDDA: F000 bl 080BEDDC: FDFD bl 0x080BF9D8 ; - swi VBlankIntrWait 080BEDDE: BC01 pop {r0} 080BEDE0: 4700 bx r0 ;080BEDE2: 0000 lsl r0, r0, #0x0
$080BEF68 - ?
r0 and r1 contain both an address. r0 has a Data Store Address, r1 the corresponding Data Load Address.
080BEF68: B530 push {r4, r5, lr} 080BEF6A: 1C04 add r4, r0, #0x0 080BEF6C: 1C0B add r3, r1, #0x0 080BEF6E: 0412 lsl r2, r2, #0x10 080BEF70: 4D08 ldr r5, =#0xFFFF0000 080BEF72: 1411 asr r1, r2, #0x10 080BEF74: 42AA cmp r2, r5 080BEF76: D111 bne 0x080BEF9C 080BEF78: 8819 ldrh r1, [r3] 080BEF7A: 0C2A lsr r2, r5, #0x10 080BEF7C: 4291 cmp r1, r2 080BEF7E: D005 beq 0x080BEF8C 080BEF80: 8021 strh r1, [r4] 080BEF82: 3302 add r3, #0x02 080BEF84: 3402 add r4, #0x02 080BEF86: 8819 ldrh r1, [r3] 080BEF88: 4291 cmp r1, r2 080BEF8A: D1F9 bne 0x080BEF80 080BEF8C: 4A02 ldr r2, =#0x0000FFFF 080BEF8E: 1C11 add r1, r2, #0x0 080BEF90: 8021 strh r1, [r4] 080BEF92: E010 b 0x080BEFB6 ;DATA ;========== ;080BEF94: 0000 lsl r0, r0, #0x0 ;080BEF96: FFFF bl 0x080BFF96 ;080BEF98: FFFF bl 0x080BEF98 ;080BEF9A: 0000 lsl r0, r0, #0x0 080BEF9C: 2200 mov r2, #0x00 080BEF9E: 428A cmp r2, r1 080BEFA0: DA09 bge 0x080BEFB6 080BEFA2: 1C0D add r5, r1, #0x0 080BEFA4: 8819 ldrh r1, [r3] 080BEFA6: 8021 strh r1, [r4] 080BEFA8: 3302 add r3, #0x02 080BEFAA: 3402 add r4, #0x02 080BEFAC: 1C51 add r1, r2, #0x1 080BEFAE: 0409 lsl r1, r1, #0x10 080BEFB0: 0C0A lsr r2, r1, #0x10 080BEFB2: 42AA cmp r2, r5 080BEFB4: DBF6 blt 0x080BEFA4 080BEFB6: BC30 pop {r4, r5} 080BEFB8: BC02 pop {r1} 080BEFBA: 4708 bx r1
$080BF094 - ?
080BF094: B5F0 push {r4, r5, r6, r7, lr} 080BF096: 1C05 add r5, r0, #0x0 ; r5 = Orig. r0 080BF098: 0409 lsl r1, r1, #0x10 080BF09A: 0C0E lsr r6, r1, #0x10 ; r6 = Orig. r1 080BF09C: 2E00 cmp r6, #0x00 080BF09E: D103 bne 0x080BF0A8 ; Branch if Orig. r1 <> #$0000 080BF0A0: E01E b 0x080BF0E0 ; Exit if Orig. r1 = #$0000 080BF0A2: 3402 add r4, #0x02 080BF0A4: 1C20 add r0, r4, #0x0 080BF0A6: E01B b 0x080BF0E0 080BF0A8: 1C2C add r4, r5, #0x0 ; r4 = Orig. r0 080BF0AA: 2101 mov r1, #0x01 080BF0AC: 4249 neg r1, r1 ; r1 = #$FFFFFFFF 080BF0AE: 1C28 add r0, r5, #0x0 ; r0 = Orig. r0 080BF0B0: F7FF bl 080BF0B2: FE98 bl 0x080BEDE4 ; ? 080BF0B4: 0400 lsl r0, r0, #0x10 080BF0B6: 0C03 lsr r3, r0, #0x10 ; ? (Is r0 changed by the subroutine above?) 080BF0B8: 2201 mov r2, #0x01 080BF0BA: 2100 mov r1, #0x00 080BF0BC: 4299 cmp r1, r3 ; ? 080BF0BE: D20E bcs 0x080BF0DE ; ? 080BF0C0: 4F09 ldr r7, =#0x0000FFFE 080BF0C2: 8820 ldrh r0, [r4] ; ? 080BF0C4: 42B8 cmp r0, r7 080BF0C6: D104 bne 0x080BF0D2 080BF0C8: 42B2 cmp r2, r6 080BF0CA: D0EA beq 0x080BF0A2 080BF0CC: 1C50 add r0, r2, #0x1 080BF0CE: 0400 lsl r0, r0, #0x10 080BF0D0: 0C02 lsr r2, r0, #0x10 080BF0D2: 1C48 add r0, r1, #0x1 080BF0D4: 0400 lsl r0, r0, #0x10 080BF0D6: 0C01 lsr r1, r0, #0x10 080BF0D8: 3402 add r4, #0x02 080BF0DA: 4299 cmp r1, r3 080BF0DC: D3F1 bcc 0x080BF0C2 080BF0DE: 1C28 add r0, r5, #0x0 ; r0 = Orig. r0 080BF0E0: BCF0 pop {r4, r5, r6, r7} 080BF0E2: BC02 pop {r1} 080BF0E4: 4708 bx r1 ;080BF0E6: 0000 lsl r0, r0, #0x0 ;080BF0E8: FFFE bl 0x080C00E6 ;080BF0EA: 0000 lsl r0, r0, #0x0
$080BF0EC - ?
080BF0EC: B570 push {r4, r5, r6, lr} 080BF0EE: 0409 lsl r1, r1, #0x10 080BF0F0: 0C09 lsr r1, r1, #0x10 ; r1 AND #$0000FFFF 080BF0F2: 0412 lsl r2, r2, #0x10 080BF0F4: 0C15 lsr r5, r2, #0x10 ; r5 = Orig. r2 AND #$0000FFFF 080BF0F6: F7FF bl 080BF0F8: FFCD bl 0x080BF094 ; ? 080BF0FA: 1C04 add r4, r0, #0x0 ; ? 080BF0FC: 2101 mov r1, #0x01 080BF0FE: 4249 neg r1, r1 ; r1 = #$FFFFFFFF 080BF100: F7FF bl 080BF102: FE70 bl 0x080BEDE4 ; ? 080BF104: 0400 lsl r0, r0, #0x10 080BF106: 0C02 lsr r2, r0, #0x10 ; r2 = Recent r0 AND #$0000FFFF 080BF108: 2301 mov r3, #0x01 080BF10A: 2100 mov r1, #0x00 080BF10C: 4291 cmp r1, r2 080BF10E: D214 bcs 0x080BF13A ; (Exit if r1 = r2) 080BF110: 4E04 ldr r6, =#0x0000FFFE 080BF112: 8820 ldrh r0, [r4] 080BF114: 42B0 cmp r0, r6 080BF116: D10A bne 0x080BF12E 080BF118: 42AB cmp r3, r5 080BF11A: D105 bne 0x080BF128 080BF11C: 1C48 add r0, r1, #0x1 080BF11E: 0400 lsl r0, r0, #0x10 080BF120: 0C00 lsr r0, r0, #0x10 080BF122: E00B b 0x080BF13C ;080BF124: FFFE bl 0x080CB122 ;080BF126: 0000 lsl r0, r0, #0x0 080BF128: 1C58 add r0, r3, #0x1 080BF12A: 0400 lsl r0, r0, #0x10 080BF12C: 0C03 lsr r3, r0, #0x10 080BF12E: 1C48 add r0, r1, #0x1 080BF130: 0400 lsl r0, r0, #0x10 080BF132: 0C01 lsr r1, r0, #0x10 080BF134: 3402 add r4, #0x02 080BF136: 4291 cmp r1, r2 080BF138: D3EB bcc 0x080BF112 080BF13A: 1C10 add r0, r2, #0x0 080BF13C: BC70 pop {r4, r5, r6} 080BF13E: BC02 pop {r1} 080BF140: 4708 bx r1 ;080BF142: 0000 lsl r0, r0, #0x0
$080BF278 - (Setup Random Number Table?)
This is so bizarre, I have the feeling that this is a Random Number Generator
080BF278: B5F0 push {r4, r5, r6, r7, lr} 080BF27A: 4647 mov r7, r8 080BF27C: B480 push {r7} 080BF27E: 1C03 add r3, r0, #0x0 080BF280: 2400 mov r4, #0x00 ; Set up loop counter 080BF282: 4812 ldr r0, =#0x0203F3A0 080BF284: 4680 mov r8, r0 080BF286: 4912 ldr r1, =#0x0203E9E0 080BF288: 468C mov r12, r1 080BF28A: 4E12 ldr r6, =#0xFFFF0000 080BF28C: 4D12 ldr r5, =#0x00010DCD 080BF28E: 4F13 ldr r7, =#0x0000026F 080BF290: 00A2 lsl r2, r4, #0x2 ; r2 = Loop Counter * 4 080BF292: 4462 add r2, r12 ; r2 = Loop Counter * 4 + #$0203E9E0 080BF294: 1C19 add r1, r3, #0x0 ; r1 = Orig. r0 080BF296: 4031 and r1, r6 ; r1 AND #$FFFF0000 080BF298: 1C18 add r0, r3, #0x0 ; r0 = Orig. r0 080BF29A: 4368 mul r0, r5 ; r0 = Orig. r0 * #$10DCD 080BF29C: 1C43 add r3, r0, #0x1 ; r3 = Orig. r0 * #$10DCD + 1 080BF29E: 1C18 add r0, r3, #0x0 ; r0 = Orig. r0 * #$10DCD + 1 080BF2A0: 4030 and r0, r6 ; r0 = Orig. r0 * #$10DCD + 1 AND #$FFFF0000 080BF2A2: 0C00 lsr r0, r0, #0x10 ; Shift upper double byte in lower double byte 080BF2A4: 4301 orr r1, r0 ; Add Orig. r0 upper double byte 080BF2A6: 6011 str r1, [r2] ; Store in $0203E9E0 + Loop Counter * 4 080BF2A8: 1C18 add r0, r3, #0x0 ; r0 = Orig. r0 * #$10DCD + 1 080BF2AA: 4368 mul r0, r5 ; r0 = (Orig. r0 * #$10DCD + 1) * #$10DCD 080BF2AC: 1C43 add r3, r0, #0x1 ; r3 = (Orig. r0 * #$10DCD + 1) * #$10DCD + 1 080BF2AE: 1C60 add r0, r4, #0x1 ; Increment Loop Counter 080BF2B0: 0400 lsl r0, r0, #0x10 ; Loop Counter AND #$0000FFFF 080BF2B2: 0C04 lsr r4, r0, #0x10 080BF2B4: 42BC cmp r4, r7 080BF2B6: D9EB bls 0x080BF290 ; Loop until Loop Counter = #$270 080BF2B8: 209C mov r0, #0x9C 080BF2BA: 0080 lsl r0, r0, #0x2 080BF2BC: 4641 mov r1, r8 080BF2BE: 6008 str r0, [r1] ; Store #$00000270 in $0203F3A0 080BF2C0: BC08 pop {r3} 080BF2C2: 4698 mov r8, r3 080BF2C4: BCF0 pop {r4, r5, r6, r7} 080BF2C6: BC01 pop {r0} 080BF2C8: 4700 bx r0 ;080BF2CA: 0000 lsl r0, r0, #0x0 ;080BF2CC: F3A0 bl ;080BF2CE: 0203 lsl r3, r0, #0x8 ;080BF2D0: E9E0 ??? ;080BF2D2: 0203 lsl r3, r0, #0x8 ;080BF2D4: 0000 lsl r0, r0, #0x0 ;080BF2D6: FFFF bl 0x080C02D6 ;080BF2D8: 0DCD lsr r5, r1, #0x17 ;080BF2DA: 0001 lsl r1, r0, #0x0 ;080BF2DC: 026F lsl r7, r5, #0x9 ;080BF2DE: 0000 lsl r0, r0, #0x0
$080BF2E0 - (Give out Random Number?)
I think this is a Random Number Generator.
$0203F3A0 contains the "controller" for this. If $0203F3A0 is less than #$270, it serves as an Index, which Random Number of the Random Number Table should be given out. Afterwards, $0203F3A0 is incremented. If it reaches #$270, the whole Number Table gets mixed up again. #$271 is the signal to set up the Random Number Table in the first place.
The Random number is given out in r0.
080BF2E0: B5F0 push {r4, r5, r6, r7, lr} 080BF2E2: 464F mov r7, r9 080BF2E4: 4646 mov r6, r8 080BF2E6: B4C0 push {r6, r7} 080BF2E8: 483F ldr r0, =#0x0203F3A0 080BF2EA: 6802 ldr r2, [r0] 080BF2EC: 493F ldr r1, =#0x0000026F 080BF2EE: 4680 mov r8, r0 ; r8 = r1 = #$0203F3A0 080BF2F0: 428A cmp r2, r1 080BF2F2: DD5D ble 0x080BF3B0 ; Skip almost to the end if $0203F3A0 is less than #$270 080BF2F4: 483E ldr r0, =#0x00000271 080BF2F6: 4282 cmp r2, r0 080BF2F8: D102 bne 0x080BF300 ; Branch if $0203F3A0 <> #$271 080BF2FA: 483E ldr r0, =#0x00001105 080BF2FC: F7FF bl 080BF2FE: FFBC bl 0x080BF278 080BF300: 2300 mov r3, #0x00 080BF302: 483D ldr r0, =#0x087DB748 080BF304: 4681 mov r9, r0 ; r9 = r0 = #$087DB748 080BF306: 4F3D ldr r7, =#0x0203E9E0 080BF308: 46CC mov r12, r9 ; r12 = r9 = #$087DB748 080BF30A: 1C3D add r5, r7, #0x0 ; r5 = r7 = #$0203E9E0 080BF30C: 682C ldr r4, [r5] ; r4 = [r5] (something around $0203E9E0) 080BF30E: 2680 mov r6, #0x80 080BF310: 0636 lsl r6, r6, #0x18 ; r6 = #$80000000 080BF312: 4034 and r4, r6 ; r4 = MSB of the loaded value 080BF314: 6868 ldr r0, [r5, #0x04] ; r0 = [r5 + 4] (something around $0203E9E0) 080BF316: 493A ldr r1, =#0x7FFFFFFF 080BF318: 4008 and r0, r1 ; r0 = Everything but the MSB of the loaded value 080BF31A: 4304 orr r4, r0 ; Add both to one another 080BF31C: 4939 ldr r1, =#0x0000018D 080BF31E: 1858 add r0, r3, r1 ; r0 = Loop Counter + #$18D 080BF320: 0080 lsl r0, r0, #0x2 ; r0 = (Loop Counter + #$18D) * 4 080BF322: 19C0 add r0, r0, r7 ; r0 = $0203E9E0 + (Loop Counter + #$18D) * 4 080BF324: 0862 lsr r2, r4, #0x1 ; r2 = MSB + other stuff div 2 080BF326: 6801 ldr r1, [r0] ; r1 = [$0203E9E0 + (Loop Counter + #$18D) * 4] 080BF328: 4051 eor r1, r2 ; ? 080BF32A: 2001 mov r0, #0x01 ; ? 080BF32C: 4004 and r4, r0 ; ? 080BF32E: 00A0 lsl r0, r4, #0x2 ; ? 080BF330: 4460 add r0, r12 ; ? 080BF332: 6800 ldr r0, [r0] ; ? 080BF334: 4041 eor r1, r0 ; ? 080BF336: C502 stmia r5!, {r1} ; Store r1 in r5, increment r5 afterwards 080BF338: 3301 add r3, #0x01 ; INC Loop Counter 080BF33A: 2BE2 cmp r3, #0xE2 080BF33C: DDE6 ble 0x080BF30C ; Loop until r3 > #$E2 (= #226) 080BF33E: 4D32 ldr r5, =#0x0000026E 080BF340: 42AB cmp r3, r5 080BF342: DC1A bgt 0x080BF37A ; Branch if r3 > #$026E (don't know how this could ever be...?) 080BF344: 492D ldr r1, =#0x0203E9E0 080BF346: 4C2C ldr r4, =#0x087DB748 080BF348: 46A4 mov r12, r4 ; r12 = r4 = #$087DB748 080BF34A: 0098 lsl r0, r3, #0x2 ; r0 = r3 * 4 080BF34C: 1842 add r2, r0, r1 ; r2 = $0203E9E0 + r3 * 4 080BF34E: 4C2F ldr r4, =#0xFFFFFC74 080BF350: 1900 add r0, r0, r4 ; r0 = r3 * 4 - #$038C 080BF352: 1847 add r7, r0, r1 ; r7 = $0203E9E0 + (r3 * 4 - #$038C) 080BF354: 6814 ldr r4, [r2] 080BF356: 4034 and r4, r6 ; MSB of Loaded byte 080BF358: 6850 ldr r0, [r2, #0x04] 080BF35A: 4929 ldr r1, =#0x7FFFFFFF 080BF35C: 4008 and r0, r1 ; Everything but the MSB of the loaded byte 080BF35E: 4304 orr r4, r0 ; Add both to one another 080BF360: 0860 lsr r0, r4, #0x1 ; ORRed value div 2 080BF362: CF02 ldmia r7!, {r1} ; Load from r7 into r1, INC r7 afterwards 080BF364: 4041 eor r1, r0 ; ? 080BF366: 2001 mov r0, #0x01 ; ? 080BF368: 4004 and r4, r0 ; ? 080BF36A: 00A0 lsl r0, r4, #0x2 ; ? 080BF36C: 4460 add r0, r12 ; ? 080BF36E: 6800 ldr r0, [r0] ; ? 080BF370: 4041 eor r1, r0 ; ? 080BF372: C202 stmia r2!, {r1} ; Store r1 in r2, INC r2 afterwards 080BF374: 3301 add r3, #0x01 ; INC Loop Counetr 080BF376: 42AB cmp r3, r5 080BF378: DDEC ble 0x080BF354 ; Loop until r3 > #$26E 080BF37A: 4A20 ldr r2, =#0x0203E9E0 080BF37C: 4824 ldr r0, =#0x000009BC 080BF37E: 1813 add r3, r2, r0 080BF380: 681C ldr r4, [r3] ; r4 = [$0203F39C] 080BF382: 2080 mov r0, #0x80 080BF384: 0600 lsl r0, r0, #0x18 080BF386: 4004 and r4, r0 ; r4 = MSB of $0203F39C 080BF388: 6810 ldr r0, [r2] ; r0 = [$0203E9E0] 080BF38A: 491D ldr r1, =#0x7FFFFFFF 080BF38C: 4008 and r0, r1 ; r0 = Everything but the MSB of $0203E9E0 080BF38E: 4304 orr r4, r0 ; but both together 080BF390: 21C6 mov r1, #0xC6 080BF392: 00C9 lsl r1, r1, #0x3 ; r1 = #$0630 080BF394: 1852 add r2, r2, r1 ; r2 = $0203F010 080BF396: 0860 lsr r0, r4, #0x1 ; ORRed value div 2 080BF398: 6811 ldr r1, [r2] ; r1 = [$0203F010] 080BF39A: 4041 eor r1, r0 ; ? 080BF39C: 2001 mov r0, #0x01 ; ? 080BF39E: 4004 and r4, r0 ; ? 080BF3A0: 00A0 lsl r0, r4, #0x2 ; ? 080BF3A2: 4448 add r0, r9 ; ? 080BF3A4: 6800 ldr r0, [r0] ; ? 080BF3A6: 4041 eor r1, r0 ; ? 080BF3A8: 6019 str r1, [r3] ; ? 080BF3AA: 2000 mov r0, #0x00 080BF3AC: 4644 mov r4, r8 080BF3AE: 6020 str r0, [r4] ; Clear $0203F3A0 080BF3B0: 4A12 ldr r2, =#0x0203E9E0 080BF3B2: 4640 mov r0, r8 080BF3B4: 6801 ldr r1, [r0] ; r1 = [$0203F3A0] 080BF3B6: 0088 lsl r0, r1, #0x2 ; r0 = Loaded Byte * 4 080BF3B8: 1880 add r0, r0, r2 ; r0 = $0203E9E0 + Loaded Byte * 4 080BF3BA: 6804 ldr r4, [r0] ; r4 = [$0203E9E0 + Loaded Byte * 4] 080BF3BC: 3101 add r1, #0x01 ; INC r1 (Loaded Byte - Load index) 080BF3BE: 4640 mov r0, r8 080BF3C0: 6001 str r1, [r0] ; Store incremented Load Index back in $0203F3A0 080BF3C2: 0AE0 lsr r0, r4, #0xB ; r0 = Second Loaded Byte >> #$B (= #11) 080BF3C4: 4044 eor r4, r0 ; r4 = r4 + (r4 >> #$B) 080BF3C6: 01E0 lsl r0, r4, #0x7 ; r0 = r4 << #$7 080BF3C8: 4912 ldr r1, =#0x9D2C5680 080BF3CA: 4008 and r0, r1 ; ? 080BF3CC: 4044 eor r4, r0 ; ? 080BF3CE: 03E0 lsl r0, r4, #0xF ; ? 080BF3D0: 4911 ldr r1, =#0xEFC60000 ; ? 080BF3D2: 4008 and r0, r1 ; ? 080BF3D4: 4044 eor r4, r0 ; ? 080BF3D6: 0CA0 lsr r0, r4, #0x12 ; ? 080BF3D8: 4044 eor r4, r0 ; ? 080BF3DA: 1C20 add r0, r4, #0x0 ; ? 080BF3DC: BC18 pop {r3, r4} 080BF3DE: 4698 mov r8, r3 080BF3E0: 46A1 mov r9, r4 080BF3E2: BCF0 pop {r4, r5, r6, r7} 080BF3E4: BC02 pop {r1} 080BF3E6: 4708 bx r1 ;080BF3E8: F3A0 bl ;080BF3EA: 0203 lsl r3, r0, #0x8 ;080BF3EC: 026F lsl r7, r5, #0x9 ;080BF3EE: 0000 lsl r0, r0, #0x0 ;080BF3F0: 0271 lsl r1, r6, #0x9 ;080BF3F2: 0000 lsl r0, r0, #0x0 ;080BF3F4: 1105 asr r5, r0, #0x4 ;080BF3F6: 0000 lsl r0, r0, #0x0 ;080BF3F8: B748 push {r3, r6, lr} ;080BF3FA: 087D lsr r5, r7, #0x1 ;080BF3FC: E9E0 ??? ;080BF3FE: 0203 lsl r3, r0, #0x8 ;080BF400: FFFF bl 0x082C3400 ;080BF402: 7FFF ldrb r7, [r7, #0x1F] ;080BF404: 018D lsl r5, r1, #0x6 ;080BF406: 0000 lsl r0, r0, #0x0 ;080BF408: 026E lsl r6, r5, #0x9 ;080BF40A: 0000 lsl r0, r0, #0x0 ;080BF40C: FC74 bl 0x080BFCF6 ;080BF40E: FFFF bl 0x07D3440E ;080BF410: 09BC lsr r4, r7, #0x6 ;080BF412: 0000 lsl r0, r0, #0x0 ;080BF414: 5680 ldsb r0, [r0, r2] ;080BF416: 9D2C ldr r5, [sp, #0x0B0] ;080BF418: 0000 lsl r0, r0, #0x0 ;080BF41A: EFC6 ???
$080BF41C - (Jump?)
080BF41C: B500 push {lr} 080BF41E: F79C bl 080BF420: F8AF bl 0x0805B580 080BF422: BC01 pop {r0} 080BF424: 4700 bx r0 ;080BF426: 0000 lsl r0, r0, #0x0
$080BF428 - ?
080BF428: B500 push {lr} 080BF42A: 0600 lsl r0, r0, #0x18 080BF42C: 0E00 lsr r0, r0, #0x18 ; r0 AND #$000000FF 080BF42E: F79C bl 080BF430: F8B9 bl 0x0805B5A4 ; ? 080BF432: BC01 pop {r0} 080BF434: 4700 bx r0 ;080BF436: 0000 lsl r0, r0, #0x0
$080BF4F0 - (Set $030017C8 = $030017C0 if it is = #$01)
080BF4F0: 4902 ldr r1, =#0x030017C0 080BF4F2: 7808 ldrb r0, [r1] 080BF4F4: 2801 cmp r0, #0x01 080BF4F6: D100 bne 0x080BF4FA ; Exit if $030017C0 <> #$01 080BF4F8: 7208 strb r0, [r1, #0x08] ; Else, set $030017C8 = #$01 080BF4FA: 4770 bx lr ;080BF4FC: 17C0 asr r0, r0, #0x1F ;080BF4FE: 0300 lsl r0, r0, #0xC
080BF54C: B530 push {r4, r5, lr} 080BF54E: B081 add sp, #-0x004 080BF550: 4810 ldr r0, =#0x030017C0 080BF552: 7A00 ldrb r0, [r0, #0x08] 080BF554: 2800 cmp r0, #0x00 080BF556: D019 beq 0x080BF58C ; Exit if $030017C8 = #$00 080BF558: 4C0F ldr r4, =#0x04000128 080BF55A: 2500 mov r5, #0x00 080BF55C: 8025 strh r5, [r4] ; Inactivate SIO Control 080BF55E: 4669 mov r1, sp 080BF560: 480E ldr r0, =#0x04000200 080BF562: 8800 ldrh r0, [r0] ; Interrupt Enable Register 080BF564: 8008 strh r0, [r1] ; Buffer Interrupt Flags on stack 080BF566: 4668 mov r0, sp 080BF568: 8801 ldrh r1, [r0] ; Load Interrupt Flags in r1 080BF56A: 2001 mov r0, #0x01 080BF56C: 4008 and r0, r1 080BF56E: 2800 cmp r0, #0x00 080BF570: D001 beq 0x080BF576 ; Branch if LCD V-Blank-Flag is disabled 080BF572: F000 bl 080BF574: FA31 bl 0x080BF9D8 ; Wait for VBLANK 080BF576: 480A ldr r0, =#0x04000134 080BF578: 8005 strh r5, [r0] ; Clear RCNT (Mode Selection) 080BF57A: 2180 mov r1, #0x80 080BF57C: 0189 lsl r1, r1, #0x6 ; r1 = #$2000 080BF57E: 1C08 add r0, r1, #0x0 ; r0 = #$2000 080BF580: 8020 strh r0, [r4] ; $04000128 = #$2000 080BF582: 8820 ldrh r0, [r4] 080BF584: 4A07 ldr r2, =#0x00004003 080BF586: 1C11 add r1, r2, #0x0 080BF588: 4308 orr r0, r1 080BF58A: 8020 strh r0, [r4] ; $04000128 = #$6003
; Shift Clock = Internal ; Internal Shift Clock: 2MHz ; IRQ Enable: Want IRQ upon completion)
080BF58C: B001 add sp, #0x004 080BF58E: BC30 pop {r4, r5} 080BF590: BC01 pop {r0} 080BF592: 4700 bx r0 ;080BF594: 17C0 asr r0, r0, #0x1F ;080BF596: 0300 lsl r0, r0, #0xC ;080BF598: 0128 lsl r0, r5, #0x4 ;080BF59A: 0400 lsl r0, r0, #0x10 ;080BF59C: 0200 lsl r0, r0, #0x8 ;080BF59E: 0400 lsl r0, r0, #0x10 ;080BF5A0: 0134 lsl r4, r6, #0x4 ;080BF5A2: 0400 lsl r0, r0, #0x10 ;080BF5A4: 4003 and r3, r0 ;080BF5A6: 0000 lsl r0, r0, #0x0
$080BF764 - (Register stuff around $030017C0 ?)
080BF764: B5F0 push {r4, r5, r6, r7, lr} 080BF766: 4657 mov r7, r10 080BF768: 464E mov r6, r9 080BF76A: 4645 mov r5, r8 080BF76C: B4E0 push {r5, r6, r7} 080BF76E: B082 add sp, #-0x008 080BF770: 4681 mov r9, r0 080BF772: 4B2B ldr r3, =#0x04000208 080BF774: 2100 mov r1, #0x00 080BF776: 8019 strh r1, [r3] ; Disable Interrupts 080BF778: 4D2A ldr r5, =#0x030017C0 080BF77A: 6B2C ldr r4, [r5, #0x30] 080BF77C: 6AE8 ldr r0, [r5, #0x2C] 080BF77E: 6328 str r0, [r5, #0x30] 080BF780: 62EC str r4, [r5, #0x2C] 080BF782: 79EA ldrb r2, [r5, #0x07] 080BF784: 71E9 strb r1, [r5, #0x07] 080BF786: 2001 mov r0, #0x01 080BF788: 8018 strh r0, [r3] ; Enable Interrupts 080BF78A: 7129 strb r1, [r5, #0x04] 080BF78C: 2A00 cmp r2, #0x00 080BF78E: D039 beq 0x080BF804 080BF790: 2600 mov r6, #0x00 080BF792: 78A8 ldrb r0, [r5, #0x02] 080BF794: 4286 cmp r6, r0 080BF796: D235 bcs 0x080BF804 080BF798: A801 add r0, sp, #0x004 080BF79A: 4680 mov r8, r0 080BF79C: 200D mov r0, #0x0D 080BF79E: 4240 neg r0, r0 080BF7A0: 4682 mov r10, r0 080BF7A2: 0070 lsl r0, r6, #0x1 080BF7A4: 1980 add r0, r0, r6 080BF7A6: 00C0 lsl r0, r0, #0x3 080BF7A8: 6B29 ldr r1, [r5, #0x30] 080BF7AA: 180C add r4, r1, r0 080BF7AC: 2000 mov r0, #0x00 080BF7AE: 9000 str r0, [sp] 080BF7B0: 2200 mov r2, #0x00 080BF7B2: 1C77 add r7, r6, #0x1 080BF7B4: 0050 lsl r0, r2, #0x1 080BF7B6: 1900 add r0, r0, r4 080BF7B8: 8801 ldrh r1, [r0] 080BF7BA: 9800 ldr r0, [sp] 080BF7BC: 1840 add r0, r0, r1 080BF7BE: 9000 str r0, [sp] 080BF7C0: 1C50 add r0, r2, #0x1 080BF7C2: 0400 lsl r0, r0, #0x10 080BF7C4: 0C02 lsr r2, r0, #0x10 080BF7C6: 2A09 cmp r2, #0x09 080BF7C8: D9F4 bls 0x080BF7B4 080BF7CA: 9800 ldr r0, [sp] 080BF7CC: 0400 lsl r0, r0, #0x10 080BF7CE: 1400 asr r0, r0, #0x10 080BF7D0: 3404 add r4, #0x04 080BF7D2: 4550 cmp r0, r10 080BF7D4: D10A bne 0x080BF7EC 080BF7D6: 0131 lsl r1, r6, #0x4 080BF7D8: 4449 add r1, r9 080BF7DA: 1C20 add r0, r4, #0x0 080BF7DC: 4A12 ldr r2, =#0x04000004 ; Fill 4x4 Bytes 080BF7DE: F000 bl 080BF7E0: F8E1 bl 0x080BF9A4 ; swi CpuSet 080BF7E2: 2001 mov r0, #0x01 080BF7E4: 40B0 lsl r0, r6 080BF7E6: 7929 ldrb r1, [r5, #0x04] 080BF7E8: 4308 orr r0, r1 080BF7EA: 7128 strb r0, [r5, #0x04] 080BF7EC: 2000 mov r0, #0x00 080BF7EE: 9001 str r0, [sp, #0x004] 080BF7F0: 4640 mov r0, r8 080BF7F2: 1C21 add r1, r4, #0x0 080BF7F4: 4A0D ldr r2, =#0x05000004 ; Fill 4x4 Bytes with r0 080BF7F6: F000 bl 080BF7F8: F8D5 bl 0x080BF9A4 ; swi CpuSet 080BF7FA: 0438 lsl r0, r7, #0x10 080BF7FC: 0C06 lsr r6, r0, #0x10 080BF7FE: 78A8 ldrb r0, [r5, #0x02] 080BF800: 4286 cmp r6, r0 080BF802: D3CE bcc 0x080BF7A2 080BF804: 4907 ldr r1, =#0x030017C0 080BF806: 78C8 ldrb r0, [r1, #0x03] 080BF808: 790A ldrb r2, [r1, #0x04] 080BF80A: 4310 orr r0, r2 080BF80C: 70C8 strb r0, [r1, #0x03] 080BF80E: 7908 ldrb r0, [r1, #0x04] 080BF810: B002 add sp, #0x008 080BF812: BC38 pop {r3, r4, r5} 080BF814: 4698 mov r8, r3 080BF816: 46A1 mov r9, r4 080BF818: 46AA mov r10, r5 080BF81A: BCF0 pop {r4, r5, r6, r7} 080BF81C: BC02 pop {r1} 080BF81E: 4708 bx r1 ;080BF820: 0208 lsl r0, r1, #0x8 ;080BF822: 0400 lsl r0, r0, #0x10 ;080BF824: 17C0 asr r0, r0, #0x1F ;080BF826: 0300 lsl r0, r0, #0xC ;080BF828: 0004 lsl r4, r0, #0x0 ;080BF82A: 0400 lsl r0, r0, #0x10 ;080BF82C: 0004 lsl r4, r0, #0x0 ;080BF82E: 0500 lsl r0, r0, #0x14
$080BF9E0 - (Store to SRAM, wait, store to SRAM, wait)
080BF9E0: B530 push {r4, r5, lr} 080BF9E2: B091 add sp, #-0x044 080BF9E4: 4668 mov r0, sp 080BF9E6: F000 bl 080BF9E8: F937 bl 0x080BFC58 ; Transfer #$47707800 to address in r0 + #$01 080BF9EA: 466D mov r5, sp 080BF9EC: 3501 add r5, #0x01 ; r5 = sp + #$01 080BF9EE: 4A06 ldr r2, =#0x0E005555 ; SRAM 080BF9F0: 20AA mov r0, #0xAA 080BF9F2: 7010 strb r0, [r2] ; $0E005555 = #$AA 080BF9F4: 4905 ldr r1, =#0x0E002AAA 080BF9F6: 2055 mov r0, #0x55 080BF9F8: 7008 strb r0, [r1] ; $0E002AAA = #$55 080BF9FA: 2090 mov r0, #0x90 080BF9FC: 7010 strb r0, [r2] ; $0E005555 = #$90 080BF9FE: A910 add r1, sp, #0x040 ; r1 = $03007E98 (when sp is $03007E58) 080BFA00: 4A03 ldr r2, =#0x00004E20 080BFA02: 1C10 add r0, r2, #0x0 ; r0 = $00004E20 (Set up counter for a waiting loop) 080BFA04: E008 b 0x080BFA18 ;DATA ;=================== ;080BFA06: 0000 lsl r0, r0, #0x0 ;080BFA08: 5555 strb r5, [r2, r5] ;080BFA0A: 0E00 lsr r0, r0, #0x18 ;080BFA0C: 2AAA cmp r2, #0xAA ;080BFA0E: 0E00 lsr r0, r0, #0x18 ;080BFA10: 4E20 ldr r6, =#0x0000E007 ;080BFA12: 0000 lsl r0, r0, #0x0 ; WAITING LOOP 080BFA14: 8808 ldrh r0, [r1] ; load value in sp, #0x040 080BFA16: 3801 sub r0, #0x01 ; decrement value 080BFA18: 8008 strh r0, [r1] ; store value in sp, #0x040 080BFA1A: 8808 ldrh r0, [r1] ; load value in sp, #0x040 080BFA1C: 2800 cmp r0, #0x00 ; is it 0? 080BFA1E: D1F9 bne 0x080BFA14 ; If not, loop 080BFA20: 480B ldr r0, =#0x0E000001 080BFA22: F000 bl 080BFA24: FDA9 bl 0x080C0578 ; 080C0578 is: bx r5, here is r5 = 03007E59 ; Jumps to 03007E58 03007E58: 7800 ldrb r0, [r0] ; before: r0 = 0E000001 (SRAM) ; after: r0 = 1B 03007E5A: 4770 bx lr 080BFA26: 0600 lsl r0, r0, #0x18 ; turns 0000001B into 1B000000 080BFA28: 0C04 lsr r4, r0, #0x10 ; turns 1B000000 into 00001B00 080BFA2A: 20E0 mov r0, #0xE0 080BFA2C: 0500 lsl r0, r0, #0x14 ; r0 0E000000 080BFA2E: F000 bl 080BFA30: FDA3 bl 0x080C0578 ; 080C0578 is: bx r5, here is r5 = 03007E59 ; Jumps to 03007E58 03007E58: 7800 ldrb r0, [r0] ; before: r0 = 0E000000 (SRAM) ; after: r0 = 32 03007E5A: 4770 bx lr 080BFA32: 0600 lsl r0, r0, #0x18 ; Is the same as 080BFA34: 0E00 lsr r0, r0, #0x18 ; AND #$000000FF 080BFA36: 4304 orr r4, r0 ; Adds to the 00001B00 (= 00001B32) 080BFA38: 4A06 ldr r2, =#0x0E005555 080BFA3A: 20AA mov r0, #0xAA 080BFA3C: 7010 strb r0, [r2] 080BFA3E: 4906 ldr r1, =#0x0E002AAA 080BFA40: 2055 mov r0, #0x55 080BFA42: 7008 strb r0, [r1] 080BFA44: 20F0 mov r0, #0xF0 080BFA46: 7010 strb r0, [r2] 080BFA48: A910 add r1, sp, #0x040 080BFA4A: 4A04 ldr r2, =#0x00004E20 080BFA4C: 1C10 add r0, r2, #0x0 080BFA4E: E009 b 0x080BFA64 ;DATA ;=================== ;080BFA50: 0001 lsl r1, r0, #0x0 ;080BFA52: 0E00 lsr r0, r0, #0x18 ;080BFA54: 5555 strb r5, [r2, r5] ;080BFA56: 0E00 lsr r0, r0, #0x18 ;080BFA58: 2AAA cmp r2, #0xAA ;080BFA5A: 0E00 lsr r0, r0, #0x18 ;080BFA5C: 4E20 ldr r6, =#0x49096008 ;080BFA5E: 0000 lsl r0, r0, #0x0 080BFA60: 8808 ldrh r0, [r1] 080BFA62: 3801 sub r0, #0x01 080BFA64: 8008 strh r0, [r1] 080BFA66: 8808 ldrh r0, [r1] 080BFA68: 2800 cmp r0, #0x00 080BFA6A: D1F9 bne 0x080BFA60 080BFA6C: 1C20 add r0, r4, #0x0 080BFA6E: B011 add sp, #0x044 080BFA70: BC30 pop {r4, r5} 080BFA72: BC02 pop {r1} 080BFA74: 4708 bx r1 ;080BFA76: 0000 lsl r0, r0, #0x0
$080BFA78 - (Load a set of values according to two SRAM bytes)
080BFA78: B510 push {r4, lr} 080BFA7A: 4A07 ldr r2, =#0x04000204 ; SET SRAM WAIT CONTROL TO 8 CYCLES 080BFA7C: 8810 ldrh r0, [r2] ; Load Waitstate Control 080BFA7E: 4907 ldr r1, =#0x0000FFFC 080BFA80: 4008 and r0, r1 ; Remove old SRAM Wait Control value 080BFA82: 2103 mov r1, #0x03 080BFA84: 4308 orr r0, r1 ; Set new SRAM Wait Control to #%..11 = 8 cycles 080BFA86: 8010 strh r0, [r2] ; Store value back 080BFA88: F7FF bl 080BFA8A: FFAA bl 0x080BF9E0 ; Store in SRAM, wait, store in SRAM, wait 080BFA8C: 0400 lsl r0, r0, #0x10 080BFA8E: 0C03 lsr r3, r0, #0x10 ; r3 has two bytes from SRAM (AND #$0000FFFF) 080BFA90: 4A03 ldr r2, =#0x080C52EC 080BFA92: 2401 mov r4, #0x01 080BFA94: E007 b 0x080BFAA6 ;080BFA96: 0000 lsl r0, r0, #0x0 ;080BFA98: 0204 lsl r4, r0, #0x8 ;080BFA9A: 0400 lsl r0, r0, #0x10 ;080BFA9C: FFFC bl 0x07CC0A96 ;080BFA9E: 0000 lsl r0, r0, #0x0 ;080BFAA0: 52EC strh r4, [r5, r3] ;080BFAA2: 080C lsr r4, r1, #0x0 080BFAA4: 3204 add r2, #0x04 080BFAA6: 6811 ldr r1, [r2] ; Load address from address table - $080C53DC 080BFAA8: 1C08 add r0, r1, #0x0 ; transfer address to r0 080BFAAA: 3028 add r0, #0x28 ; Add #$28 to address in r0 - $080C5404 080BFAAC: 7800 ldrb r0, [r0] ; Load *byte* 080BFAAE: 2800 cmp r0, #0x00 080BFAB0: D003 beq 0x080BFABA ; Leave Loop if loaded byte is #$00 080BFAB2: 8D08 ldrh r0, [r1, #0x28] ; else, load byte with adjacent byte again 080BFAB4: 4283 cmp r3, r0 ; Is it the same as the loaded SRAM byte? 080BFAB6: D1F5 bne 0x080BFAA4 ; Loop if both are not the same (and load the next from the table) 080BFAB8: 2400 mov r4, #0x00 080BFABA: 490E ldr r1, =#0x0203F3C0 080BFABC: 6810 ldr r0, [r2] ; Load last address from Address Table 080BFABE: 6800 ldr r0, [r0] ; Load 64-bit-value from that address 080BFAC0: 6008 str r0, [r1] ; Store that value in $0203F3C0 080BFAC2: 490D ldr r1, =#0x0203F3CC 080BFAC4: 6810 ldr r0, [r2] 080BFAC6: 6840 ldr r0, [r0, #0x04] 080BFAC8: 6008 str r0, [r1] ; Store second value in $0203F3CC 080BFACA: 490C ldr r1, =#0x0203F3D0 080BFACC: 6810 ldr r0, [r2] 080BFACE: 6880 ldr r0, [r0, #0x08] 080BFAD0: 6008 str r0, [r1] ; Store third value in $0203F3D0 080BFAD2: 490B ldr r1, =#0x0203F3BC 080BFAD4: 6810 ldr r0, [r2] 080BFAD6: 68C0 ldr r0, [r0, #0x0C] 080BFAD8: 6008 str r0, [r1] ; Store fourth value in $0203F3BC 080BFADA: 490A ldr r1, =#0x0203F3A4 080BFADC: 6810 ldr r0, [r2] 080BFADE: 6900 ldr r0, [r0, #0x10] 080BFAE0: 6008 str r0, [r1] ; Store fifth value in $0203F3A4 080BFAE2: 4909 ldr r1, =#0x0203F3C4 080BFAE4: 6810 ldr r0, [r2] 080BFAE6: 3014 add r0, #0x14 080BFAE8: 6008 str r0, [r1] ; Store sixth value in $0203F3C4 080BFAEA: 1C20 add r0, r4, #0x0 080BFAEC: BC10 pop {r4} 080BFAEE: BC02 pop {r1} 080BFAF0: 4708 bx r1 ;080BFAF2: 0000 lsl r0, r0, #0x0 ;080BFAF4: F3C0 bl ;080BFAF6: 0203 lsl r3, r0, #0x8 ;080BFAF8: F3CC bl ;080BFAFA: 0203 lsl r3, r0, #0x8 ;080BFAFC: F3D0 bl ;080BFAFE: 0203 lsl r3, r0, #0x8 ;080BFB00: F3BC bl ;080BFB02: 0203 lsl r3, r0, #0x8 ;080BFB04: F3A4 bl ;080BFB06: 0203 lsl r3, r0, #0x8 ;080BFB08: F3C4 bl ;080BFB0A: 0203 lsl r3, r0, #0x8
$080BFB0D - Data for $080BFB30
$080BFB0D-10: #$00880849
$080BFB0D: #$49 $080BFB0E: #$08 $080BFB0F: #$88 $080BFB10: #$00
$080BFB30 - ?
r1 contains an address. In that address "#$080BFB0D" gets stored.
r0 contains a timer number, so it must be between #$00 and #$03. If its higher than that, this subroutine exits. In the end, bit 0 of r0 is used as a flag: If it did not work, that flag is set; if everything's fine, it's clear.
This subroutine stores the timer number byte (#$00-#$03) in $0203F3AC and the Timer Counter/Reload Register ($04000100, $04000104,...) in $0203F3B4.
080BFB30: 1C0A add r2, r1, #0x0 080BFB32: 0600 lsl r0, r0, #0x18 080BFB34: 0E01 lsr r1, r0, #0x18 ; r1 = r0 + AND #$000000FF 080BFB36: 2903 cmp r1, #0x03 080BFB38: D814 bhi 0x080BFB64 ; Exit if r1 is bigger than #$03 (Invalid timer number) 080BFB3A: 4806 ldr r0, =#0x0203F3AC 080BFB3C: 7001 strb r1, [r0] ; Store byte in $0203F3AC 080BFB3E: 4906 ldr r1, =#0x0203F3B4 080BFB40: 7800 ldrb r0, [r0] ; Load the byte back from $0203F3AC 080BFB42: 0080 lsl r0, r0, #0x2 ; * 4 080BFB44: 4B05 ldr r3, =#0x04000100 080BFB46: 18C0 add r0, r0, r3 ; 04000100 + that byte * 4 080BFB48: 6008 str r0, [r1] ; Store it in $0203F3B4 080BFB4A: 4805 ldr r0, =#0x080BFB0D 080BFB4C: 6010 str r0, [r2] ; Store $080BFB0D in the Register that was brought in here (in r1, originally) 080BFB4E: 2000 mov r0, #0x00 ; Set r0 to 0 if Original r0 was lower than #$04 080BFB50: E009 b 0x080BFB66 ;080BFB52: 0000 lsl r0, r0, #0x0 ;080BFB54: F3AC bl ;080BFB56: 0203 lsl r3, r0, #0x8 ;080BFB58: F3B4 bl ;080BFB5A: 0203 lsl r3, r0, #0x8 ;080BFB5C: 0100 lsl r0, r0, #0x4 ;080BFB5E: 0400 lsl r0, r0, #0x10 ;080BFB60: FB0D bl 0x07CC017C ;080BFB62: 080B lsr r3, r1, #0x0 080BFB64: 2001 mov r0, #0x01 ; Set r0 to 1 if Original r0 was higher than #$03 080BFB66: 4770 bx lr
$080BFC54 - (Data for Subroutine below)
; TRANSFERED DATA ; 080BFC54: #$00 store in r0 + 1 ; 080BFC55: #$78 store in r0 + 2 ; 080BFC56: #$70 store in r0 + 3 ; 080BFC57: #$47 store in r0 + 4
$080BFC58 - (Transfer #$47707800 to address in r0 + #$01)
When this is called in the Intro, r0 is $03007E57 at start, so it transfers to $03007E58 to $03007E5B.
I don't know if it is ever called outside the intro again.
080BFC58: 1C02 add r2, r0, #0x0 080BFC5A: 4905 ldr r1, =#0x0203F3A8 080BFC5C: 1C50 add r0, r2, #0x1 080BFC5E: 6008 str r0, [r1] ; Store r0's original value plus 1 in $0203F3A8 080BFC60: 4B04 ldr r3, =#0x080BFC55 080BFC62: 2001 mov r0, #0x01 080BFC64: 4043 eor r3, r0 ; r3 = r3 - 1 080BFC66: 4804 ldr r0, =#0x080BFC59 080BFC68: 4902 ldr r1, =#0x080BFC55 080BFC6A: 1A40 sub r0, r0, r1 080BFC6C: 03C0 lsl r0, r0, #0xF ; r0 = #$00020000 080BFC6E: E00B b 0x080BFC88 ;DATA ;=================== ;080BFC70: F3A8 bl ;080BFC72: 0203 lsl r3, r0, #0x8 ;080BFC74: FC55 bl 0x082C3520 ;080BFC76: 080B lsr r3, r1, #0x0 ;080BFC78: FC59 bl 0x080CB52C ;080BFC7A: 080B lsr r3, r1, #0x0 080BFC7C: 8818 ldrh r0, [r3] 080BFC7E: 8010 strh r0, [r2] 080BFC80: 3302 add r3, #0x02 080BFC82: 3202 add r2, #0x02 080BFC84: 1E48 sub r0, r1, #0x1 ; decrement counter 080BFC86: 0400 lsl r0, r0, #0x10 ; r0 * 10000 080BFC88: 0C01 lsr r1, r0, #0x10 ; r0 / 10000 080BFC8A: 2900 cmp r1, #0x00 080BFC8C: D1F6 bne 0x080BFC7C 080BFC8E: 4770 bx lr
$080BFD40 - (Transfer from SRAM to WRAM)
; r0 = New value for Waitstate Control ($04000204) 080BFD40: B5F0 push {r4, r5, r6, r7, lr} 080BFD42: B0A0 add sp, #-0x080 080BFD44: 1C0D add r5, r1, #0x0 080BFD46: 1C16 add r6, r2, #0x0 080BFD48: 1C1F add r7, r3, #0x0 080BFD4A: 0400 lsl r0, r0, #0x10 080BFD4C: 0C04 lsr r4, r0, #0x10 ; r4 = r0 + AND #$0000FFFF ; Set SRAM Wait control to 8 cycles 080BFD4E: 4A08 ldr r2, =#0x04000204 080BFD50: 8810 ldrh r0, [r2] ; Load old value of $4000204 (Waitstate control) 080BFD52: 4908 ldr r1, =#0x0000FFFC 080BFD54: 4008 and r0, r1 ; Remove old bits for SRAM Wait contrl 080BFD56: 2103 mov r1, #0x03 080BFD58: 4308 orr r0, r1 ; Add two set bits for 8 cycle SRAM Wait control 080BFD5A: 8010 strh r0, [r2] ; Store new value back to $4000204 ; Prepare for Code Transfer from ROM to WRAM 080BFD5C: 4B06 ldr r3, =#0x080BFD1D 080BFD5E: 2001 mov r0, #0x01 080BFD60: 4043 eor r3, r0 ; r3 = #$080BFD1C 080BFD62: 466A mov r2, sp ; r2 = sp 080BFD64: 4805 ldr r0, =#0x080BFD41 080BFD66: 4904 ldr r1, =#0x080BFD1D 080BFD68: 1A40 sub r0, r0, r1 080BFD6A: 03C0 lsl r0, r0, #0xF ; r0 = #$00120000 080BFD6C: E00E b 0x080BFD8C ;080BFD6E: 0000 lsl r0, r0, #0x0 ;080BFD70: 0204 lsl r4, r0, #0x8 ;080BFD72: 0400 lsl r0, r0, #0x10 ;080BFD74: FFFC bl 0x07CC0D6E ;080BFD76: 0000 lsl r0, r0, #0x0 ;080BFD78: FD1D bl 0x080C07B4 ;080BFD7A: 080B lsr r3, r1, #0x0 ;080BFD7C: FD41 bl 0x080CB800 ;080BFD7E: 080B lsr r3, r1, #0x0 ; Transfer $12 doublebytes (makes thirty-six bytes) from $080BFD1C to stack (the code that gets executed afterwards) 080BFD80: 8818 ldrh r0, [r3] 080BFD82: 8010 strh r0, [r2] 080BFD84: 3302 add r3, #0x02 ; Increment Load Address 080BFD86: 3202 add r2, #0x02 ; Increment Store Address 080BFD88: 1E48 sub r0, r1, #0x1 ; Decrement counter 080BFD8A: 0400 lsl r0, r0, #0x10 080BFD8C: 0C01 lsr r1, r0, #0x10 080BFD8E: 2900 cmp r1, #0x00 080BFD90: D1F6 bne 0x080BFD80 ; Prepare for Code execution 080BFD92: 466B mov r3, sp 080BFD94: 3301 add r3, #0x01 080BFD96: 4808 ldr r0, =#0x080C53B0 080BFD98: 7F00 ldrb r0, [r0, #0x1C] ; r0 = [$080C53CC] = #$0C 080BFD9A: 4084 lsl r4, r0 ; LSL r4, #$0C 080BFD9C: 1C20 add r0, r4, #0x0 080BFD9E: 22E0 mov r2, #0xE0 080BFDA0: 0512 lsl r2, r2, #0x14 ; r2 = #$0E000000 080BFDA2: 18A9 add r1, r5, r2 080BFDA4: 1840 add r0, r0, r1 080BFDA6: 1C31 add r1, r6, #0x0 080BFDA8: 1C3A add r2, r7, #0x0 080BFDAA: F000 bl 080BFDAC: FBE1 bl 0x080C0570 ; bx r3, r3 = 03006DF1 ; r0 = address from where to load ; r1 = address where to store ; r2 = number of bytes to transfer 03006DF0: B510 push {r4, lr} 03006DF2: 1C04 add r4, r0, #0x0 03006DF4: 1E53 sub r3, r2, #0x1 ; r3 is the counter value. It has to get decremented, because the loop isn't left at 0, but one repition after 03006DF6: 2A00 cmp r2, #0x00 03006DF8: D008 beq 0x03006E0C ; if r2 = 0, exit 03006DFA: 2201 mov r2, #0x01 03006DFC: 4252 neg r2, r2 ; r2 = #$FFFFFFFF 03006DFE: 7820 ldrb r0, [r4] 03006E00: 7008 strb r0, [r1] 03006E02: 3401 add r4, #0x01 03006E04: 3101 add r1, #0x01 03006E06: 3B01 sub r3, #0x01 03006E08: 4293 cmp r3, r2 03006E0A: D1F8 bne 0x03006DFE 03006E0C: BC10 pop {r4} 03006E0E: BC01 pop {r0} 03006E10: 4700 bx r0 080BFDAE: B020 add sp, #0x080 080BFDB0: BCF0 pop {r4, r5, r6, r7} 080BFDB2: BC01 pop {r0} 080BFDB4: 4700 bx r0 ;080BFDB6: 0000 lsl r0, r0, #0x0 ;080BFDB8: 53B0 strh r0, [r6, r6] ;080BFDBA: 080C lsr r4, r1, #0x0
$080BFDEC - Check Data transfered from SRAM
This transfers a Subroutine from ROM to WRAM (stuff in WRAM can get executed faster) and jumps there.
This compares stuff from SRAM with something different. In the Intro, this is used to compare data that was transfered from SRAM to WRAM before ($080BFD40) with it's original material, so it checks if the transfer worked without any mistake. If a mistake happened, r0 contains the (WRAM) address of the byte that differs. If everything worked fine, r0 = #$00
080BFDEC: B530 push {r4, r5, lr} 080BFDEE: B0C0 add sp, #-0x100 080BFDF0: 1C0D add r5, r1, #0x0 080BFDF2: 0400 lsl r0, r0, #0x10 080BFDF4: 0C04 lsr r4, r0, #0x10 ; r4 = r0 + AND #$0000FFFF ; Set SRAM Wait control to 8 cycles 080BFDF6: 4A08 ldr r2, =#0x04000204 080BFDF8: 8810 ldrh r0, [r2] ; Load old value of $4000204 (Waitstate control) 080BFDFA: 4908 ldr r1, =#0x0000FFFC 080BFDFC: 4008 and r0, r1 ; Remove old bits for SRAM Wait contrl 080BFDFE: 2103 mov r1, #0x03 080BFE00: 4308 orr r0, r1 ; Add two set bits for 8 cycle SRAM Wait control 080BFE02: 8010 strh r0, [r2] ; Store new value back to $4000204 080BFE04: 4B06 ldr r3, =#0x080BFDBD 080BFE06: 2001 mov r0, #0x01 080BFE08: 4043 eor r3, r0 ; r3 = #$080BFDBC 080BFE0A: 466A mov r2, sp 080BFE0C: 4805 ldr r0, =#0x080BFDED 080BFE0E: 4904 ldr r1, =#0x080BFDBD 080BFE10: 1A40 sub r0, r0, r1 080BFE12: 03C0 lsl r0, r0, #0xF ; r0 = #$00180000 080BFE14: E00E b 0x080BFE34 ;DATA ;============== ;080BFE16: 0000 lsl r0, r0, #0x0 ;080BFE18: 0204 lsl r4, r0, #0x8 ;080BFE1A: 0400 lsl r0, r0, #0x10 ;080BFE1C: FFFC bl 0x07CC0E16 ;080BFE1E: 0000 lsl r0, r0, #0x0 ;080BFE20: FDBD bl 0x080C099C ;080BFE22: 080B lsr r3, r1, #0x0 ;080BFE24: FDED bl 0x080CBA00 ;080BFE26: 080B lsr r3, r1, #0x0 ; This transfers the Code from 080BFDBD to $03006D78. Afterwards, it's executed. Look below. 080BFE28: 8818 ldrh r0, [r3] 080BFE2A: 8010 strh r0, [r2] 080BFE2C: 3302 add r3, #0x02 080BFE2E: 3202 add r2, #0x02 080BFE30: 1E48 sub r0, r1, #0x1 080BFE32: 0400 lsl r0, r0, #0x10 080BFE34: 0C01 lsr r1, r0, #0x10 080BFE36: 2900 cmp r1, #0x00 080BFE38: D1F6 bne 0x080BFE28 080BFE3A: 466B mov r3, sp 080BFE3C: 3301 add r3, #0x01 ; Set up the Address where to jump 080BFE3E: 4807 ldr r0, =#0x080C53B0 080BFE40: 7F01 ldrb r1, [r0, #0x1C] 080BFE42: 408C lsl r4, r1 080BFE44: 1C21 add r1, r4, #0x0 080BFE46: 22E0 mov r2, #0xE0 080BFE48: 0512 lsl r2, r2, #0x14 ; r2 = $0E000000 080BFE4A: 1889 add r1, r1, r2 ; r1 is always SRAM ($0E.....) 080BFE4C: 8B02 ldrh r2, [r0, #0x18] 080BFE4E: 1C28 add r0, r5, #0x0 080BFE50: F000 bl 080BFE52: FB8E bl 0x080C0570 ; 080C0570 is a "bx r3". r3 contains $03006D79. 03006D78: B530 push {r4, r5, lr} 03006D7A: 1C05 add r5, r0, #0x0 ; r5 = r0 (Load Address 1) 03006D7C: 1C0B add r3, r1, #0x0 ; r3 = r1 (Load Address 2) 03006D7E: 1E54 sub r4, r2, #0x1 03006D80: 2A00 cmp r2, #0x00 03006D82: D00C beq 0x03006D9E ; direct exit if r2 (number of bytes to transfer) is = 0 03006D84: 2201 mov r2, #0x01 03006D86: 4252 neg r2, r2 03006D88: 7819 ldrb r1, [r3] ; Load byte from Load Address 2 03006D8A: 7828 ldrb r0, [r5] ; Load byte from Load Address 1 03006D8C: 3501 add r5, #0x01 ; Increment Load Address 1 03006D8E: 3301 add r3, #0x01 ; Increment Load Address 2 03006D90: 4281 cmp r1, r0 ; Compare both values 03006D92: D001 beq 0x03006D98 ; do next byte if they are the same 03006D94: 1E58 sub r0, r3, #0x1 ; If they are not the same, r0 is the Byte of Load Address 2 which is incorrect 03006D96: E003 b 0x03006DA0 ; This loop (and Subroutine) is left after the first differing 03006D98: 3C01 sub r4, #0x01 ; Decrement counter 03006D9A: 4294 cmp r4, r2 ; Is counter less than 0? 03006D9C: D1F4 bne 0x03006D88 ; If not: Loop 03006D9E: 2000 mov r0, #0x00 03006DA0: BC30 pop {r4, r5} 03006DA2: BC02 pop {r1} 03006DA4: 4708 bx r1 080BFE54: B040 add sp, #0x100 080BFE56: BC30 pop {r4, r5} 080BFE58: BC02 pop {r1} 080BFE5A: 4708 bx r1 ; DATA ; ====================== ;080BFE5C: 53B0 strh r0, [r6, r6] ;080BFE5E: 080C lsr r4, r1, #0x0
$080C0568 - bx r1
080C0568: 4708 bx r1 080C056A: 46C0 mov r8, r8
$080C0708 - ?
r0 and r1 contain values that form a certain value as a result. This results is in r0 in the end (it gets calculated in r2). If r1 = #$01, this subroutine gets exited with r0 = #$00 (this seems not to happen).
080C0708: 2900 cmp r1, #0x00 080C070A: D034 beq 0x080C0776 ; If r1 = #$00, exit with r0 = #$00 080C070C: 2301 mov r3, #0x01 080C070E: 2200 mov r2, #0x00 080C0710: B410 push {r4} 080C0712: 4288 cmp r0, r1 080C0714: D32C bcc 0x080C0770 ; If r0 < r1, exit with r0 = #$00 080C0716: 2401 mov r4, #0x01 080C0718: 0724 lsl r4, r4, #0x1C ; r4 = #$10000000 ;First Loop 080C071A: 42A1 cmp r1, r4 080C071C: D204 bcs 0x080C0728 ; (Branch is not taken if r1 > r4) 080C071E: 4281 cmp r1, r0 080C0720: D202 bcs 0x080C0728 ; (Branch is not taken if r1 > r0, branch is taken if r1 < r0) 080C0722: 0109 lsl r1, r1, #0x4 080C0724: 011B lsl r3, r3, #0x4 080C0726: E7F8 b 0x080C071A ; Loop 080C0728: 00E4 lsl r4, r4, #0x3 ; r4 = #$80000000 ;Second Loop 080C072A: 42A1 cmp r1, r4 080C072C: D204 bcs 0x080C0738 ; (Branch is not taken if r1 > r4) 080C072E: 4281 cmp r1, r0 080C0730: D202 bcs 0x080C0738 ; (Branch is not taken if r1 > r0, branch is taken if r1 < r0) 080C0732: 0049 lsl r1, r1, #0x1 080C0734: 005B lsl r3, r3, #0x1 080C0736: E7F8 b 0x080C072A ; Loop ;Third Loop 080C0738: 4288 cmp r0, r1 080C073A: D301 bcc 0x080C0740 ; (Branch is taken if r0 < r1) 080C073C: 1A40 sub r0, r0, r1 080C073E: 431A orr r2, r3 080C0740: 084C lsr r4, r1, #0x1 080C0742: 42A0 cmp r0, r4 080C0744: D302 bcc 0x080C074C ; (Branch is only(!) taken if r0 < r4) 080C0746: 1B00 sub r0, r0, r4 080C0748: 085C lsr r4, r3, #0x1 080C074A: 4322 orr r2, r4 080C074C: 088C lsr r4, r1, #0x2 080C074E: 42A0 cmp r0, r4 080C0750: D302 bcc 0x080C0758 ; (Branch is only(!) taken if r0 < r4) 080C0752: 1B00 sub r0, r0, r4 080C0754: 089C lsr r4, r3, #0x2 080C0756: 4322 orr r2, r4 080C0758: 08CC lsr r4, r1, #0x3 080C075A: 42A0 cmp r0, r4 080C075C: D302 bcc 0x080C0764 ; (Branch is only(!) taken if r0 < r4) 080C075E: 1B00 sub r0, r0, r4 080C0760: 08DC lsr r4, r3, #0x3 080C0762: 4322 orr r2, r4 080C0764: 2800 cmp r0, #0x00 080C0766: D003 beq 0x080C0770 080C0768: 091B lsr r3, r3, #0x4 080C076A: D001 beq 0x080C0770 080C076C: 0909 lsr r1, r1, #0x4 080C076E: E7E3 b 0x080C0738 080C0770: 1C10 add r0, r2, #0x0 080C0772: BC10 pop {r4} 080C0774: 46F7 mov pc, lr ; Exit 080C0776: B500 push {lr} 080C0778: F7FF bl 080C077A: FF5C bl 0x080C0634 ; Pushes lr back into pc: Direct return without sense ; After testing it seems like its never executed 080C077C: 2000 mov r0, #0x00 080C077E: BD00 pop {pc}
$080C0708 - ($080C0840?)
These are maybe two separate subroutines.
080C0780: 2900 cmp r1, #0x00 080C0782: D058 beq 0x080C0836 080C0784: 2301 mov r3, #0x01 080C0786: 4288 cmp r0, r1 080C0788: D200 bcs 0x080C078C 080C078A: 46F7 mov pc, lr ; Exit 080C078C: B410 push {r4} 080C078E: 2401 mov r4, #0x01 080C0790: 0724 lsl r4, r4, #0x1C 080C0792: 42A1 cmp r1, r4 080C0794: D204 bcs 0x080C07A0 080C0796: 4281 cmp r1, r0 080C0798: D202 bcs 0x080C07A0 080C079A: 0109 lsl r1, r1, #0x4 080C079C: 011B lsl r3, r3, #0x4 080C079E: E7F8 b 0x080C0792 080C07A0: 00E4 lsl r4, r4, #0x3 080C07A2: 42A1 cmp r1, r4 080C07A4: D204 bcs 0x080C07B0 080C07A6: 4281 cmp r1, r0 080C07A8: D202 bcs 0x080C07B0 080C07AA: 0049 lsl r1, r1, #0x1 080C07AC: 005B lsl r3, r3, #0x1 080C07AE: E7F8 b 0x080C07A2 080C07B0: 2200 mov r2, #0x00 080C07B2: 4288 cmp r0, r1 080C07B4: D300 bcc 0x080C07B8 080C07B6: 1A40 sub r0, r0, r1 080C07B8: 084C lsr r4, r1, #0x1 080C07BA: 42A0 cmp r0, r4 080C07BC: D305 bcc 0x080C07CA 080C07BE: 1B00 sub r0, r0, r4 080C07C0: 469C mov r12, r3 080C07C2: 2401 mov r4, #0x01 080C07C4: 41E3 ror r3, r4 080C07C6: 431A orr r2, r3 080C07C8: 4663 mov r3, r12 080C07CA: 088C lsr r4, r1, #0x2 080C07CC: 42A0 cmp r0, r4 080C07CE: D305 bcc 0x080C07DC 080C07D0: 1B00 sub r0, r0, r4 080C07D2: 469C mov r12, r3 080C07D4: 2402 mov r4, #0x02 080C07D6: 41E3 ror r3, r4 080C07D8: 431A orr r2, r3 080C07DA: 4663 mov r3, r12 080C07DC: 08CC lsr r4, r1, #0x3 080C07DE: 42A0 cmp r0, r4 080C07E0: D305 bcc 0x080C07EE 080C07E2: 1B00 sub r0, r0, r4 080C07E4: 469C mov r12, r3 080C07E6: 2403 mov r4, #0x03 080C07E8: 41E3 ror r3, r4 080C07EA: 431A orr r2, r3 080C07EC: 4663 mov r3, r12 080C07EE: 469C mov r12, r3 080C07F0: 2800 cmp r0, #0x00 080C07F2: D003 beq 0x080C07FC 080C07F4: 091B lsr r3, r3, #0x4 080C07F6: D001 beq 0x080C07FC 080C07F8: 0909 lsr r1, r1, #0x4 080C07FA: E7D9 b 0x080C07B0 080C07FC: 240E mov r4, #0x0E 080C07FE: 0724 lsl r4, r4, #0x1C 080C0800: 4022 and r2, r4 080C0802: D101 bne 0x080C0808 080C0804: BC10 pop {r4} 080C0806: 46F7 mov pc, lr 080C0808: 4663 mov r3, r12 080C080A: 2403 mov r4, #0x03 080C080C: 41E3 ror r3, r4 080C080E: 421A tst r2, r3 080C0810: D001 beq 0x080C0816 080C0812: 08CC lsr r4, r1, #0x3 080C0814: 1900 add r0, r0, r4 080C0816: 4663 mov r3, r12 080C0818: 2402 mov r4, #0x02 080C081A: 41E3 ror r3, r4 080C081C: 421A tst r2, r3 080C081E: D001 beq 0x080C0824 080C0820: 088C lsr r4, r1, #0x2 080C0822: 1900 add r0, r0, r4 080C0824: 4663 mov r3, r12 080C0826: 2401 mov r4, #0x01 080C0828: 41E3 ror r3, r4 080C082A: 421A tst r2, r3 080C082C: D001 beq 0x080C0832 080C082E: 084C lsr r4, r1, #0x1 080C0830: 1900 add r0, r0, r4 080C0832: BC10 pop {r4} 080C0834: 46F7 mov pc, lr 080C0836: B500 push {lr} 080C0838: F7FF bl 080C083A: FEFC bl 0x080C0634 080C083C: 2000 mov r0, #0x00 080C083E: BD00 pop {pc} 080C0840: B5F0 push {r4, r5, r6, r7, lr} 080C0842: B082 add sp, #-0x008 080C0844: 1C01 add r1, r0, #0x0 080C0846: 68CC ldr r4, [r1, #0x0C] 080C0848: 690D ldr r5, [r1, #0x10] 080C084A: 684F ldr r7, [r1, #0x04] 080C084C: 2600 mov r6, #0x00 080C084E: 2200 mov r2, #0x00 080C0850: 6808 ldr r0, [r1] 080C0852: 2801 cmp r0, #0x01 080C0854: D800 bhi 0x080C0858 080C0856: 2201 mov r2, #0x01 080C0858: 2A00 cmp r2, #0x00 080C085A: D00D beq 0x080C0878 080C085C: 4E03 ldr r6, =#0x000007FF 080C085E: 4A04 ldr r2, =#0x00000000 080C0860: 4B04 ldr r3, =#0x00080000 080C0862: 1C20 add r0, r4, #0x0 080C0864: 1C29 add r1, r5, #0x0 080C0866: 4319 orr r1, r3 080C0868: E062 b 0x080C0930 ;080C086A: 0000 lsl r0, r0, #0x0 ;080C086C: 07FF lsl r7, r7, #0x1F ;080C086E: 0000 lsl r0, r0, #0x0 ;080C0870: 0000 lsl r0, r0, #0x0 ;080C0872: 0000 lsl r0, r0, #0x0 ;080C0874: 0000 lsl r0, r0, #0x0 ;080C0876: 0008 lsl r0, r1, #0x0 080C0878: 2200 mov r2, #0x00 080C087A: 2804 cmp r0, #0x04 080C087C: D100 bne 0x080C0880 080C087E: 2201 mov r2, #0x01 080C0880: 2A00 cmp r2, #0x00 080C0882: D123 bne 0x080C08CC 080C0884: 2200 mov r2, #0x00 080C0886: 2802 cmp r0, #0x02 080C0888: D100 bne 0x080C088C 080C088A: 2201 mov r2, #0x01 080C088C: 2A00 cmp r2, #0x00 080C088E: D002 beq 0x080C0896 080C0890: 2400 mov r4, #0x00 080C0892: 2500 mov r5, #0x00 080C0894: E04E b 0x080C0934 080C0896: 1C28 add r0, r5, #0x0 080C0898: 4320 orr r0, r4 080C089A: 2800 cmp r0, #0x00 080C089C: D04A beq 0x080C0934 080C089E: 688A ldr r2, [r1, #0x08] 080C08A0: 4804 ldr r0, =#0xFFFFFC02 080C08A2: 4282 cmp r2, r0 080C08A4: DA0F bge 0x080C08C6 080C08A6: 1A82 sub r2, r0, r2 080C08A8: 2A38 cmp r2, #0x38 080C08AA: DD05 ble 0x080C08B8 080C08AC: 2400 mov r4, #0x00 080C08AE: 2500 mov r5, #0x00 080C08B0: E039 b 0x080C0926 ;080C08B2: 0000 lsl r0, r0, #0x0 ;080C08B4: FC02 bl 0x080C10BA ;080C08B6: FFFF bl 0x07CC38B6 080C08B8: 1C29 add r1, r5, #0x0 080C08BA: 1C20 add r0, r4, #0x0 080C08BC: F001 bl 080C08BE: FB34 bl 0x080C1F28 080C08C0: 1C0D add r5, r1, #0x0 080C08C2: 1C04 add r4, r0, #0x0 080C08C4: E02F b 0x080C0926 080C08C6: 4803 ldr r0, =#0x000003FF 080C08C8: 4282 cmp r2, r0 080C08CA: DD07 ble 0x080C08DC 080C08CC: 4E02 ldr r6, =#0x000007FF 080C08CE: 2400 mov r4, #0x00 080C08D0: 2500 mov r5, #0x00 080C08D2: E02F b 0x080C0934 ;080C08D4: 03FF lsl r7, r7, #0xF ;080C08D6: 0000 lsl r0, r0, #0x0 ;080C08D8: 07FF lsl r7, r7, #0x1F ;080C08DA: 0000 lsl r0, r0, #0x0 080C08DC: 4809 ldr r0, =#0x000003FF 080C08DE: 1816 add r6, r2, r0 080C08E0: 20FF mov r0, #0xFF 080C08E2: 1C21 add r1, r4, #0x0 080C08E4: 4001 and r1, r0 080C08E6: 2200 mov r2, #0x00 080C08E8: 2980 cmp r1, #0x80 080C08EA: D10D bne 0x080C0908 080C08EC: 2A00 cmp r2, #0x00 080C08EE: D10B bne 0x080C0908 080C08F0: 3001 add r0, #0x01 080C08F2: 1C21 add r1, r4, #0x0 080C08F4: 4001 and r1, r0 080C08F6: 1C10 add r0, r2, #0x0 080C08F8: 4308 orr r0, r1 080C08FA: 2800 cmp r0, #0x00 080C08FC: D008 beq 0x080C0910 080C08FE: 2080 mov r0, #0x80 080C0900: 2100 mov r1, #0x00 080C0902: E003 b 0x080C090C ;080C0904: 03FF lsl r7, r7, #0xF ;080C0906: 0000 lsl r0, r0, #0x0 080C0908: 207F mov r0, #0x7F 080C090A: 2100 mov r1, #0x00 080C090C: 1824 add r4, r4, r0 080C090E: 414D adc r5, r1 080C0910: 4818 ldr r0, =#0x1FFFFFFF 080C0912: 4285 cmp r5, r0 080C0914: D907 bls 0x080C0926 080C0916: 07EB lsl r3, r5, #0x1F 080C0918: 0862 lsr r2, r4, #0x1 080C091A: 1C18 add r0, r3, #0x0 080C091C: 4310 orr r0, r2 080C091E: 0869 lsr r1, r5, #0x1 080C0920: 1C0D add r5, r1, #0x0 080C0922: 1C04 add r4, r0, #0x0 080C0924: 3601 add r6, #0x01 080C0926: 062B lsl r3, r5, #0x18 080C0928: 0A22 lsr r2, r4, #0x8 080C092A: 1C18 add r0, r3, #0x0 080C092C: 4310 orr r0, r2 080C092E: 0A29 lsr r1, r5, #0x8 080C0930: 1C0D add r5, r1, #0x0 080C0932: 1C04 add r4, r0, #0x0 080C0934: 9400 str r4, [sp] 080C0936: 4A10 ldr r2, =#0x000FFFFF 080C0938: 402A and r2, r5 080C093A: 9801 ldr r0, [sp, #0x004] 080C093C: 490F ldr r1, =#0xFFF00000 080C093E: 4008 and r0, r1 080C0940: 4310 orr r0, r2 080C0942: 9001 str r0, [sp, #0x004] 080C0944: 466A mov r2, sp 080C0946: 490E ldr r1, =#0x000007FF 080C0948: 1C08 add r0, r1, #0x0 080C094A: 4006 and r6, r0 080C094C: 0131 lsl r1, r6, #0x4 080C094E: 480D ldr r0, =#0xFFFF800F 080C0950: 88D3 ldrh r3, [r2, #0x06] 080C0952: 4018 and r0, r3 080C0954: 4308 orr r0, r1 080C0956: 80D0 strh r0, [r2, #0x06] 080C0958: 01F9 lsl r1, r7, #0x7 080C095A: 207F mov r0, #0x7F 080C095C: 79D3 ldrb r3, [r2, #0x07] 080C095E: 4018 and r0, r3 080C0960: 4308 orr r0, r1 080C0962: 71D0 strb r0, [r2, #0x07] 080C0964: 9900 ldr r1, [sp] 080C0966: 9801 ldr r0, [sp, #0x004] 080C0968: 9000 str r0, [sp] 080C096A: 9101 str r1, [sp, #0x004] 080C096C: 9800 ldr r0, [sp] 080C096E: 9901 ldr r1, [sp, #0x004] 080C0970: B002 add sp, #0x008 080C0972: BDF0 pop {r4, r5, r6, r7, pc} ;080C0974: FFFF bl 0x07EB1974 ;080C0976: 1FFF sub r7, r7, #0x7 ;080C0978: FFFF bl 0x080C0978 ;080C097A: 000F lsl r7, r1, #0x0 ;080C097C: 0000 lsl r0, r0, #0x0 ;080C097E: FFF0 bl 0x080C1960 ;080C0980: 07FF lsl r7, r7, #0x1F ;080C0982: 0000 lsl r0, r0, #0x0 ;080C0984: 800F strh r7, [r1] ;080C0986: FFFF bl 0x080D0986
$080C1FE4 - Data Transfer
r0 = Store Address
r1 = Load Address
r2 = Counter
; r0 --> r5 --> r4 (--> r1) ; r1 --> r3 080C1FE4: B530 push {r4, r5, lr} ; Push Register on Stack: r4, r5, Link Register 080C1FE6: 1C05 add r5, r0, #0x0 ; r5 = r0 080C1FE8: 1C2C add r4, r5, #0x0 ; r4 = r5 (= r0?) 080C1FEA: 1C0B add r3, r1, #0x0 ; r3 = r1 080C1FEC: 2A0F cmp r2, #0x0F 080C1FEE: D919 bls 0x080C2024 ; Branch if r2 is lower or same #$0F 080C1FF0: 1C18 add r0, r3, #0x0 ; r0 = r3 080C1FF2: 4328 orr r0, r5 ; I guess this is OR r0 with r5 and store it in r0 ; ----- ; What this part does: ; if the two LSBs of r0 (=r5) are cleared, the stuff beginning at 080C1FFC is executed, ; else it's skipped ; ----- 080C1FF4: 2103 mov r1, #0x03 ; r1 = 03 080C1FF6: 4008 and r0, r1 080C1FF8: 2800 cmp r0, #0x00 080C1FFA: D113 bne 0x080C2024 ; Jump over the next part if r0 is clear ; ----- 080C1FFC: 1C29 add r1, r5, #0x0 ; r1 = r5 080C1FFE: CB01 ldmia r3!, {r0} ; Load the register that address is in r3 and store it in r0 080C2000: C101 stmia r1!, {r0} ; Store r0 in the address that is in r1 080C2002: CB01 ldmia r3!, {r0} 080C2004: C101 stmia r1!, {r0} 080C2006: CB01 ldmia r3!, {r0} 080C2008: C101 stmia r1!, {r0} 080C200A: CB01 ldmia r3!, {r0} 080C200C: C101 stmia r1!, {r0} 080C200E: 3A10 sub r2, #0x10 ; r2 = r2 - $10 080C2010: 2A0F cmp r2, #0x0F 080C2012: D8F4 bhi 0x080C1FFE ; Branch (and thus, repeat) if r2 is more than $0F 080C2014: 2A03 cmp r2, #0x03 080C2016: D904 bls 0x080C2022 ; Branch Lower or same ; ----- ; This address stuff that happens above for four entries ; happens here for one single entry: ; Load from the address from r3 and store it in the address in r1 ; ----- 080C2018: CB01 ldmia r3!, {r0} 080C201A: C101 stmia r1!, {r0} 080C201C: 3A04 sub r2, #0x04 080C201E: 2A03 cmp r2, #0x03 080C2020: D8FA bhi 0x080C2018 ; ----- 080C2022: 1C0C add r4, r1, #0x0 080C2024: 3A01 sub r2, #0x01 ; r2 = r2 - 1 080C2026: 2001 mov r0, #0x01 ; r0 = 01 080C2028: 4240 neg r0, r0 ; r0 = r0* -1 = -01 080C202A: 4282 cmp r2, r0 080C202C: D007 beq 0x080C203E ; Exit if r2=r0 ; ----- ; ; ----- 080C202E: 1C01 add r1, r0, #0x0 ; r1 = r0 ; ----- ; Bytewise transfer ; ----- 080C2030: 7818 ldrb r0, [r3] ; Load byte from address in r3 into r0 080C2032: 7020 strb r0, [r4] ; Store byte from r0 into the address in r4 080C2034: 3301 add r3, #0x01 080C2036: 3401 add r4, #0x01 ; Increment r3 and r4 080C2038: 3A01 sub r2, #0x01 ; Decrement r2 080C203A: 428A cmp r2, r1 080C203C: D1F8 bne 0x080C2030 ; Loop until r2 = r1 ; ----- 080C203E: 1C28 add r0, r5, #0x0 080C2040: BD30 pop {r4, r5, pc} ; Restores r4 and r5 and jumps back (what is popped in the PC was pushed out of the LR) ;080C2042: 0000 lsl r0, r0, #0x0
$080C2044 - Turn to ARM code, jump to $0805BEAC
Line $080C2044 changes from THUMB to ARM code:
080C2044: 4778 bx pc ; Turn from THUMB to ARM code ;080C2046: 46C0 mov r8, r8 ; Not executed 080C2048: EAFE6797 b 0x0805BEAC
$080C204C - Turn to ARM code, jump to $0805BF3C
080C204C: 4778 bx pc ; Turn from THUMB to ARM code ;080C204E: 46C0 mov r8, r8 ; Not executed 080C2050: EAFE67B9 b 0x0805BF3C
$080C2054 - Turn to ARM code, jump to $0805C2C8
080C2054: 4778 bx pc ; Turn from THUMB to ARM code ;080C2056: 46C0 mov r8, r8 ; Not executed 080C2058: EAFE689A b 0x0805C2C8
$080C205C - Turn to ARM code, jump to $0805BFD8
080C205C: 4778 bx pc ; Turn from THUMB to ARM code ;080C205E: 46C0 mov r8, r8 ; Not executed 080C2060: EAFE67DC b 0x0805BFD8
$080C2438 - Table of Screen settings (BGs)
This is used in $080978B4. These values are set in the Buffer for the BG Control Registers ($04000008/A/C/E).
; Entry #$00 40 1C C1 1D 42 1E 4B 1F
BG0 = #$1C40: BG Priority 0, Character Base Block 0, Mosaic Enabled, 16/16 Colors, Screen Base Block #$1C, Transparent Display Overflow, Screen Size 256x256
BG1 = #$1DC1: BG Priority 1, Character Base Block 0, Mosaic Enabled, 256 Colors, Screen Base Block #$1D, Transparent Display Overflow, Screen Size 256x256
BG2 = #$1E42: BG Priority 2, Character Base Block 0, Mosaic Enabled, 16/16 Colors, Screen Base Block #$1E, Transparent Display Overflow, Screen Size 256x256
BG3 = #$1F4B: BG Priority 3, Character Base Block 2, Mosaic Enabled, 16/16 Colors, Screen Base Block #$1F, Transparent Display Overflow, Screen Size 256x256
; Entry #$01 40 1C 41 1D C2 5E C3 5F
BG0 = #$1C40: BG Priority 0, Character Base Block 0, Mosaic Enabled, 16/16 Colors, Screen Base Block #$1C, Transparent Display Overflow, Screen Size 256x256
BG1 = #$1D41: BG Priority 1, Character Base Block 0, Mosaic Enabled, 16/16 Colors, Screen Base Block #$1D, Transparent Display Overflow, Screen Size 256x256
BG2 = #$5EC2: BG Priority 2, Character Base Block 0, Mosaic Enabled, 256 Colors, Screen Base Block #$1E, Transparent Display Overflow, Screen Size 512x256
BG3 = #$5FC3: BG Priority 3, Character Base Block 0, Mosaic Enabled, 256 Colors, Screen Base Block #$1F, Transparent Display Overflow, Screen Size 512x256
; Entry #$02 40 1C 41 1D C2 1E CB 1F
BG0 = #$1C40: BG Priority 0, Character Base Block 0, Mosaic Enabled, 16/16 Colors, Screen Base Block #$1C, Transparent Display Overflow, Screen Size 256x256
BG1 = #$1D41: BG Priority 1, Character Base Block 0, Mosaic Enabled, 16/16 Colors, Screen Base Block #$1D, Transparent Display Overflow, Screen Size 256x256
BG2 = #$1EC2: BG Priority 2, Character Base Block 0, Mosaic Enabled, 256 Colors, Screen Base Block #$1E, Transparent Display Overflow, Screen Size 256x256
BG3 = #$1FCB: BG Priority 3, Character Base Block 2, Mosaic Enabled, 256 Colors, Screen Base Block #$1F, Transparent Display Overflow, Screen Size 256x256
Maybe the data afterwards belongs to this table, too:
04 00 01 00 00 00 08 00 40 00 00 03 0A 00 04 00 07 00 01 01 02 00 04 00 20 00 00 02 0A 00 3C 00 03 00 80 01 00 00 04 00 20 00 01 02 00 00 00 00 03 00 8C 01 00 00 04 00 20 00 01 02 00 00 00 00 03 00 C0 01 00 00 04 00 20 00 01 02 00 00 00 00 03 00 CC 01 00 00 04 00 20 00 01 02 00 00 00 00 03 00 14 02 00 00 04 00 20 00 01 02 00 00 00 00 03 00 40 02 00 00 04 00 20 00 01 02 00 00 00 00 05 00 00 02 01 00 04 00 20 00 01 02 26 00 8F 00 03 00 80 02 00 00 04 00 20 00 01 02 00 00 00 00 03 00 8C 02 00 00 04 00 20 00 01 02 00 00 00 00 03 00 C0 02 00 00 04 00 20 00 01 02 00 00 00 00 01 00 44 03 03 00 00 00 00 00 00 01 00 00 00 00 01 00 04 03 03 00 00 00 00 00 00 01 00 00 00 00 01 00 00 03 03 00 00 00 00 00 00 02 00 00 00 00 01 00 06 03 03 00 00 00 00 00 00 03 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00
(Next byte is $080C2560)
$080C2560 - Table of unknown pursose
This is directly ripped from the ROM, so it's Little Endian.
00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 03 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 03 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16 00 30 00 C2 01 1E 00 08 00 38 00 C2 01 1E 00 0A 00 30 00 3A 02 1E 00 0C 00 28 00 B2 02 1E 00 0C 00 24 00 0A 00 24 00 08 00 24 00 0C 00 24 00 08 00 24 00 08 00 24 00 0C 00 24 00 0C 00 28 00 0C 00 24 00 0C 00 24 00 04 00 2C 00 04 00 24 00 0C 00 24 00 0C 00 24 00 0C 00 24 00 05 00 03 00 16 0C 00 00 2A 00 6A 00 4A 01 1E 00 00 01 00 00 06 00 03 00 14 0F 00 00 0C 00 6A 00 3A 02 1E 00 06 07 00 00 04 00 04 00 14 0F 00 00 12 00 6A 00 76 02 1E 00 12 13 00 00 06 00 03 00 14 0F 00 00 12 00 6A 00 1A 04 1E 00 1A 1B 00 00 06 00 03 00 12 14 00 00 12 00 6A 00 EE 02 1E 00 20 21 00 00 04 00 04 00 18 0F 00 00 12 00 6A 00 46 05 1E 00 26 27 00 00 79 7A 7A 00 00 00 00 00 5F 5F 62 00 00 00 00 00 54 49 4A 4A 00 00 00 00 4C 4D 4F 00 00 00 00 00 58 5C 58 00 00 00 00 00 78 7A 7B 7B 00 00 00 00 5F 5F 62 00 00 00 00 00 65 64 63 00 00 00 00 00 19 13 03 00 12 00 6A 00 BE 05 1E 00 19 14 03 00 12 00 6A 00 56 04 1E 00 1E 14 03 00 12 00 6A 00 1A 04 1E 00 1E 14 03 00 12 00 6A 00 1A 04 1E 00 1E 10 03 00 12 00 6A 00 A2 03 1E 00 1C 12 03 00 12 00 6A 00 56 04 1E 00 00 00 04 00 4A 00 48 00 4A 01 00 00 0F 14 00 00 0A 00 28 00 FE 01 1E 00 0F 14 00 00 06 00 28 00 FE 01 1E 00 0F 14 00 00 06 00 28 00 3A 02 1E 00 0F 14 00 00 0A 00 20 00 3A 02 1E 00
(Next byte is $080C2760)
$080C52E0 - Address Table
From $080C52E0 to $080C52EB is ASCII text "FLASH_V126.."
From $080C52EC on, it's 64-bit-sized addresses (both from ROM ($08) and WRAM ($02)). These are used in $080BFAA6.
$080C5590 - Values for WRAM registers
These #$38 (fifty-six) Bytes are transferred after the Brownie Brown Logo and before the actual Intro into the registers $020000D0 to $02000107.
See Subroutine at $08001724.
$086143EC - (Title Screen Palette of unknown purpose)
Raw Data
Is loaded at $08097BFC, #$20 Bytes.
$086242AC - Brownie Brown Logo Tiles
Raw Data
$08624ECC - Brownie Brown Logo Palette
Raw Data
$08624EEC - Nintendo Logo Tiles
Raw Data
$08625E0C - Nintendo Logo Palette
Raw Data
$0862922C - Equipment Icons
Raw Data - #$800 Bytes
These are the symbols for several Equipment Items (like Helmets, Armors, Necklaces etc.) and the Currency symbol. These Grafics are always in VRAM when you're in menu.
$08699478 - Subroutine Address Table for unknown Subroutine
080998F1 ; Entry #$00 0809998D ; Entry #$01 080999B1 ; Entry #$02 080999B5 ; Entry #$03 08099A51 ; Entry #$04
$0869948C - Subroutine Address Table for $08099BB8
These subroutines seem to handle the actual animations of the Intro. Used in the Subroutine $08099BB8. If the Entry number that the subroutine has to load is higher than #$19, the subroutine exits immediately.
08099C19 ; Entry #$00 08099C3D ; Entry #$01 08099CB5 ; Entry #$02 08099CB9 ; Entry #$03 08099CED ; Entry #$04 08099D29 ; Entry #$05 08099D55 ; Entry #$06 08099D99 ; Entry #$07 08099DC1 ; Entry #$08 08099DED ; Entry #$09 08099E41 ; Entry #$0A 08099E69 ; Entry #$0B 08099E95 ; Entry #$0C 08099EC1 ; Entry #$0D 08099EE5 ; Entry #$0E 08099F65 ; Entry #$0F 08099F69 ; Entry #$10 08099F8D ; Entry #$11 08099FCD ; Entry #$12 08099FD1 ; Entry #$13 08099FF5 ; Entry #$14 0809A035 ; Entry #$15 0809A039 ; Entry #$16 0809A05D ; Entry #$17 0809A099 ; Entry #$18 0809A101 ; Entry #$19
$086994F4 - Subroutine Address Table for unknown Subroutine
Don't mind the "Entry" numbers. I thought they would belong to the list above.
0809AA11 ; Entry #$01F 0809AAD1 ; Entry #$020 0809AAE9 ; Entry #$021 0809AB01 ; Entry #$022 0809ABD1 ; Entry #$023
$08699508 - Subroutine Address Table for $0809BAC4
0809BAE9 ; Entry #$00 0809BAED ; Entry #$01 0809BB91 ; Entry #$02 0809BBA9 ; Entry #$03
$08699518 - Subroutine Address Table for unknown Subroutine
Don't mind the "Entry" numbers. I thought they would belong to the list above.
0809BC1D ; Entry #$028 0809BC21 ; Entry #$029 0809BC45 ; Entry #$02A 0809BC5D ; Entry #$02B 0809BCD1 ; Entry #$02C 0809BCD5 ; Entry #$02D 0809BCFD ; Entry #$02E 0809BD09 ; Entry #$02F 0809BD0D ; Entry #$030 0809BD61 ; Entry #$031 0809BD8D ; Entry #$032 0809BDE9 ; Entry #$033 080A0F8D ; Entry #$034 080A1151 ; Entry #$035 080A1229 ; Entry #$036 080A1349 ; Entry #$037 080A15D5 ; Entry #$038 080A16C5 ; Entry #$039 080A173D ; Entry #$03A 080A17C9 ; Entry #$03B 080A1AE5 ; Entry #$03C 080A1C01 ; Entry #$03D 080A1D51 ; Entry #$03E 080A1E69 ; Entry #$03F 080A1F31 ; Entry #$040 080A1F35 ; Entry #$041 080A1FAD ; Entry #$042 080A20B5 ; Entry #$043 080A21D1 ; Entry #$044 080A22E9 ; Entry #$045 080A2489 ; Entry #$046 080A24F1 ; Entry #$047 080A256D ; Entry #$048 080A2631 ; Entry #$049 080A270D ; Entry #$04A 080A274D ; Entry #$04B 080A287D ; Entry #$04C 080A2965 ; Entry #$04D 080A2A59 ; Entry #$04E 080A2B41 ; Entry #$04F 080A2C29 ; Entry #$050 080A2D49 ; Entry #$051 080A2E35 ; Entry #$052 080A2E65 ; Entry #$053 080A2F19 ; Entry #$054 080A316D ; Entry #$055 080A341D ; Entry #$056 080A3511 ; Entry #$057 080A3621 ; Entry #$058 080A3715 ; Entry #$059 080A3BB1 ; Entry #$05A 080A3BFD ; Entry #$05B 080A3C51 ; Entry #$05C 080A3F71 ; Entry #$05D 080A4051 ; Entry #$05E 080A40F9 ; Entry #$05F 080A40FD ; Entry #$060 080A3C85 ; Entry #$061 080A3CDD ; Entry #$062 080A45B5 ; Entry #$063 080A4661 ; Entry #$064 080A4701 ; Entry #$065 080A4799 ; Entry #$066 080A480D ; Entry #$067 080A49B1 ; Entry #$068 080A4A29 ; Entry #$069 080A4A81 ; Entry #$06A 080A4AED ; Entry #$06B 080A4BC9 ; Entry #$06C 080A4C35 ; Entry #$06D 080A4CAD ; Entry #$06E 080A4F99 ; Entry #$06F 080A4FB5 ; Entry #$070 080A4FF5 ; Entry #$071 080A5035 ; Entry #$072 080A5075 ; Entry #$073 080A50CD ; Entry #$074 080A513D ; Entry #$075 080A517D ; Entry #$076 080A526D ; Entry #$077 080A530D ; Entry #$078 080A5349 ; Entry #$079 080A53B9 ; Entry #$07A 080A5435 ; Entry #$07B 080A5505 ; Entry #$07C 080A5551 ; Entry #$07D 080A55A5 ; Entry #$07E 080A55D1 ; Entry #$07F 080A5691 ; Entry #$080 080A56D5 ; Entry #$081 080A57B1 ; Entry #$082 080A5A95 ; Entry #$083 080A5AD9 ; Entry #$084 080A5AFD ; Entry #$085 080A5B21 ; Entry #$086 080A5B45 ; Entry #$087 080A5B75 ; Entry #$088 080A5B79 ; Entry #$089 080A5B7D ; Entry #$08A 080A5B81 ; Entry #$08B 080A7921 ; Entry #$08C 080A7949 ; Entry #$08D 080A796D ; Entry #$08E 080A7991 ; Entry #$08F 080A79DD ; Entry #$090 080A7A39 ; Entry #$091 080A7A61 ; Entry #$092 080A7A85 ; Entry #$093 080A7AD9 ; Entry #$094 080A7AFD ; Entry #$095 080A7BE9 ; Entry #$096 080A7C61 ; Entry #$097 080A7CDD ; Entry #$098 080A7D41 ; Entry #$099 080A9419 ; Entry #$09A 080A9479 ; Entry #$09B 080A94D9 ; Entry #$09C 080A9525 ; Entry #$09D 080A9549 ; Entry #$09E 009E0036 ; Entry #$09F 000000B2 ; Entry #$0A0 080A98AD ; Entry #$0A1 080A98DD ; Entry #$0A2 080A98FD ; Entry #$0A3 080A9919 ; Entry #$0A4 080A9941 ; Entry #$0A5 080A9969 ; Entry #$0A6 080A9991 ; Entry #$0A7 080A9A1D ; Entry #$0A8 080A9B59 ; Entry #$0A9 080A9B89 ; Entry #$0AA 080A9C41 ; Entry #$0AB 080A9C69 ; Entry #$0AC 080A9CB5 ; Entry #$0AD 080AA031 ; Entry #$0AE 080A98DD ; Entry #$0AF 080A98FD ; Entry #$0B0 080A9919 ; Entry #$0B1 080A9941 ; Entry #$0B2 080A9969 ; Entry #$0B3 080A9991 ; Entry #$0B4 080AA385 ; Entry #$0B5 080AA539 ; Entry #$0B6 080AA58D ; Entry #$0B7 080AA769 ; Entry #$0B8 080AA9A1 ; Entry #$0B9 080AAD29 ; Entry #$0BA 080AAF51 ; Entry #$0BB 080AB021 ; Entry #$0BC 080AB0D5 ; Entry #$0BD 080AB181 ; Entry #$0BE 080AB255 ; Entry #$0BF 080AB675 ; Entry #$0C0 080AB84D ; Entry #$0C1 080AB945 ; Entry #$0C2 080ABA85 ; Entry #$0C3 080ABDF9 ; Entry #$0C4 080AC13D ; Entry #$0C5 080AC191 ; Entry #$0C6 080AC335 ; Entry #$0C7 080AC3E9 ; Entry #$0C8 080ACC35 ; Entry #$0C9 080ACCD9 ; Entry #$0CA 080ACD6D ; Entry #$0CB 080ACDF5 ; Entry #$0CC 080ACE99 ; Entry #$0CD 080ACEF9 ; Entry #$0CE 080AD4E5 ; Entry #$0CF 080AD555 ; Entry #$0D0 080AD90D ; Entry #$0D1 080ADA25 ; Entry #$0D2 080ADB35 ; Entry #$0D3 080ADBED ; Entry #$0D4 080ADCD1 ; Entry #$0D5 080ADD51 ; Entry #$0D6 080ADEB9 ; Entry #$0D7 080ADFED ; Entry #$0D8 080AE1DD ; Entry #$0D9 080AE329 ; Entry #$0DA 080AE48D ; Entry #$0DB 080AE4D9 ; Entry #$0DC 080AE525 ; Entry #$0DD 080AE5B9 ; Entry #$0DE 080AE64D ; Entry #$0DF 080AE6E1 ; Entry #$0E0 080AE72D ; Entry #$0E1 080AE8B1 ; Entry #$0E2 080AE971 ; Entry #$0E3 080AEA31 ; Entry #$0E4 080AEE89 ; Entry #$0E5 080AF02D ; Entry #$0E6 080AF0ED ; Entry #$0E7 080AF1AD ; Entry #$0E8 080AF289 ; Entry #$0E9 080AF2ED ; Entry #$0EA 080AF505 ; Entry #$0EB 080AF605 ; Entry #$0EC 080AF6C5 ; Entry #$0ED 080AF769 ; Entry #$0EE 080AF7D1 ; Entry #$0EF 080AFAB5 ; Entry #$0F0 080AFB01 ; Entry #$0F1 080AFB4D ; Entry #$0F2 080AFB99 ; Entry #$0F3 080AFBE5 ; Entry #$0F4 080AFC31 ; Entry #$0F5 080AFC7D ; Entry #$0F6 080AFCC9 ; Entry #$0F7 080AFD15 ; Entry #$0F8 006E614A ; Entry #$0F9 00626546 ; Entry #$0FA 0072614D ; Entry #$0FB 00727041 ; Entry #$0FC 0079614D ; Entry #$0FD 006E754A ; Entry #$0FE 006C754A ; Entry #$0FF 00677541 ; Entry #$100 00706553 ; Entry #$101 0074634F ; Entry #$102 00766F4E ; Entry #$103 00636544 ; Entry #$104 080B2F39 ; Entry #$105 080B2F69 ; Entry #$106 080B2F95 ; Entry #$107 080B2FB1 ; Entry #$108 080B2FD9 ; Entry #$109 080B3001 ; Entry #$10A 080B3029 ; Entry #$10B 080B3055 ; Entry #$10C 080B307D ; Entry #$10D 080B30A9 ; Entry #$10E 080B30DD ; Entry #$10F 080B314D ; Entry #$110 080B3179 ; Entry #$111 080B31A5 ; Entry #$112 080B2F69 ; Entry #$113 080B2F95 ; Entry #$114 080B2FB1 ; Entry #$115 080B2FD9 ; Entry #$116 080B3001 ; Entry #$117 080B3029 ; Entry #$118 080B3251 ; Entry #$119 080B327D ; Entry #$11A 080B32A9 ; Entry #$11B 080B32D5 ; Entry #$11C 080B3301 ; Entry #$11D 080B358D ; Entry #$11E 080B35B9 ; Entry #$11F 080B365D ; Entry #$120 080B36FD ; Entry #$121 080B3799 ; Entry #$122 080B383D ; Entry #$123 080B3869 ; Entry #$124 080B38E9 ; Entry #$125 080B3915 ; Entry #$126 080B3941 ; Entry #$127 080B3A11 ; Entry #$128 080B3B8D ; Entry #$129 080B3C05 ; Entry #$12A 080B3D0D ; Entry #$12B 080B405D ; Entry #$12C 080B42E5 ; Entry #$12D 080B4315 ; Entry #$12E 080B4415 ; Entry #$12F 080B4509 ; Entry #$130 080B45C5 ; Entry #$131 080B4621 ; Entry #$132 080B46D5 ; Entry #$133 080B4719 ; Entry #$134 080B47AD ; Entry #$135 080B47F1 ; Entry #$136 080B4851 ; Entry #$137 080B48BD ; Entry #$138 080B4901 ; Entry #$139 080B4B35 ; Entry #$13A 080B4B65 ; Entry #$13B 080B4B71 ; Entry #$13C 080B4B8D ; Entry #$13D 080B4BB1 ; Entry #$13E 080B4BBD ; Entry #$13F 080B4BC9 ; Entry #$140 080B4C65 ; Entry #$141 080B4CA1 ; Entry #$142 080B4D1D ; Entry #$143 080B4DA5 ; Entry #$144 080B4DCD ; Entry #$145 080B4E61 ; Entry #$146 080B4ED1 ; Entry #$147 080B4B65 ; Entry #$148 080B4B71 ; Entry #$149 080B4B8D ; Entry #$14A 080B4BB1 ; Entry #$14B 080B4BBD ; Entry #$14C 080B4BC9 ; Entry #$14D 080B4FF9 ; Entry #$14E 080B5025 ; Entry #$14F 080B5051 ; Entry #$150 080B50E5 ; Entry #$151 080B5111 ; Entry #$152 080B5169 ; Entry #$153 080B7895 ; Entry #$154 080B7899 ; Entry #$155 080B7965 ; Entry #$156 080B79C5 ; Entry #$157 080B7A15 ; Entry #$158 080B7A2D ; Entry #$159 080B7AC1 ; Entry #$15A 080B7AC5 ; Entry #$15B 080B7AED ; Entry #$15C 080B7B15 ; Entry #$15D 080B7B3D ; Entry #$15E 080B7B99 ; Entry #$15F 080B7C11 ; Entry #$160 080B7C15 ; Entry #$161 080B7C41 ; Entry #$162 080B7C6D ; Entry #$163 080B7C99 ; Entry #$164 080B7CA5 ; Entry #$165 080B83F5 ; Entry #$166 080B846D ; Entry #$167 080B84D1 ; Entry #$168 080B84D1 ; Entry #$169 080B84F9 ; Entry #$16A 080B84F9 ; Entry #$16B 080B8561 ; Entry #$16C 080B8569 ; Entry #$16D 080B7CA9 ; Entry #$16E 080B7D09 ; Entry #$16F 080B7DD5 ; Entry #$170 080B8571 ; Entry #$171 080B85D5 ; Entry #$172 080B8671 ; Entry #$173 080B8671 ; Entry #$174 080B8699 ; Entry #$175 080B8699 ; Entry #$176 080B86D1 ; Entry #$177 080B86D9 ; Entry #$178 080B7EA1 ; Entry #$179 080B7EC5 ; Entry #$17A 080B7ED9 ; Entry #$17B 080B87C1 ; Entry #$17C 080B887D ; Entry #$17D 080B8979 ; Entry #$17E 080B8A2D ; Entry #$17F 080B9C05 ; Entry #$180 080B9C3D ; Entry #$181 080B9C75 ; Entry #$182
$08699AA4 - Address Table for Graphic Data
The program adds #$08699AA4 to the entries to get the actual position of the Data
$0000002C ; Entry #$00 - $08699AD0 - Title "Magical Vacation" writing (COMPRESSED) $00000BCC ; Entry #$01 - $0869A670 - Title Menu Plates, Part 1 (COMPRESSED) $00001DE4 ; Entry #$02 - $0869B888 - Title Menu Plates, Part 2 (COMPRESSED) $00002328 ; Entry #$03 - $0869BDCC - Palette (for Title) (UNCOMPRESSED) $00002388 ; Entry #$04 - $0869BE2C - Intro Glare Effect (Suns) (COMPRESSED) $00002884 ; Entry #$05 - $0869C328 - Palette (for Glare Effect) (UNCOMPRESSED) $000028A4 ; Entry #$06 - $0869C348 - Intro Sky/Castle Tiles (COMPRESSED) $0000AB34 ; Entry #$07 - $086A45D8 - Intro Sky/Castle Palette (UNCOMPRESSED) $0000AD34 ; Entry #$08 - $086A47D8 - Title Screen Tilemap (UNCOMPRESSED) $0000BB44 ; Entry #$09 - $086A55E8 - ???
$086A55E8 - Address Table for Graphic Data
$00000038 ; Entry #$00 - $086A5620 - Tiles Intro Image: Barren Battlefield $00008158 ; Entry #$01 - $086AD740 - Palette Intro Image: Barren Battlefield $00008358 ; Entry #$02 - $086AD940 - Tiles Intro Image: Red Battle Scene $0001120C ; Entry #$03 - $086B67F4 - Palette Intro Image: Red Battle Scene $0001140C ; Entry #$04 - $086B69F4 - Tiles Intro Image: Town Scene $00019C64 ; Entry #$05 - $086BF24C - Palette Intro Image: Town Scene $00019E64 ; Entry #$06 - $086BF44C - Tiles Intro Image: Man running on a Hill $00022860 ; Entry #$07 - $086C7C48 - Palette Intro Image: Man running on a Hill
Internal Data for Magical Vacation
| |
---|---|