merge upstream, fix non-conflict in trade.s

This commit is contained in:
paul 2018-10-14 16:36:53 +02:00
commit 3037f37cc6
36 changed files with 2578 additions and 3690 deletions

View File

@ -1835,7 +1835,7 @@ _08010CE2:
bl sub_8010414
bl sub_801017C
bl sub_8044708
ldr r0, _08010D4C @ =gUnknown_201C000
ldr r0, _08010D4C @ =gDecompressionBuffer
ldr r1, _08010D50 @ =gPlayerParty
movs r2, 0x96
lsls r2, 1
@ -1877,7 +1877,7 @@ _08010D3A:
beq _08010D6E
b _08010D9C
.align 2, 0
_08010D4C: .4byte gUnknown_201C000
_08010D4C: .4byte gDecompressionBuffer
_08010D50: .4byte gPlayerParty
_08010D54: .4byte sub_800F6FC
_08010D58: .4byte gTasks
@ -1940,14 +1940,14 @@ _08010DC2:
bl bitmask_all_link_players_but_self
lsls r0, 24
lsrs r0, 24
ldr r1, _08010DDC @ =gUnknown_201C000
ldr r1, _08010DDC @ =gDecompressionBuffer
movs r2, 0xC8
bl SendBlock
ldr r1, _08010DD8 @ =gUnknown_2023E82
b _080110EA
.align 2, 0
_08010DD8: .4byte gUnknown_2023E82
_08010DDC: .4byte gUnknown_201C000
_08010DDC: .4byte gDecompressionBuffer
_08010DE0:
bl GetBlockReceivedStatus
movs r1, 0xF

View File

@ -1726,12 +1726,12 @@ _080D8084:
movs r0, 0xD
_080D8094:
muls r1, r0
ldr r0, _080D80A0 @ =gUnknown_823E558
ldr r0, _080D80A0 @ =gTrainerClassNames
adds r4, r1, r0
b _080D8382
.align 2, 0
_080D809C: .4byte gTrainers
_080D80A0: .4byte gUnknown_823E558
_080D80A0: .4byte gTrainerClassNames
_080D80A4:
ldr r0, _080D80E8 @ =gTrainerBattleOpponent_A
ldrh r2, [r0]

View File

@ -4942,7 +4942,7 @@ sub_80D2EA4: @ 80D2EA4
adds r2, 0x2A
lsls r2, 16
asrs r2, 16
ldr r5, _080D3004 @ =gUnknown_201C000
ldr r5, _080D3004 @ =gDecompressionBuffer
str r5, [sp]
movs r3, 0
bl CreateTrainerSprite
@ -5077,7 +5077,7 @@ sub_80D2EA4: @ 80D2EA4
_080D2FF8: .4byte gReservedSpritePaletteCount
_080D2FFC: .4byte gUnknown_83FA494
_080D3000: .4byte gUnknown_83FA4AE
_080D3004: .4byte gUnknown_201C000
_080D3004: .4byte gDecompressionBuffer
_080D3008: .4byte gSaveBlock2Ptr
_080D300C: .4byte gSprites
_080D3010: .4byte sub_80D301C

View File

@ -27,7 +27,7 @@ LoadCompressedObjectPic: @ 800EBCC
sub sp, 0x8
adds r4, r0, 0
ldr r0, [r4]
ldr r5, _0800EBFC @ =gUnknown_201C000
ldr r5, _0800EBFC @ =gDecompressionBuffer
adds r1, r5, 0
bl LZ77UnCompWram
str r5, [sp]
@ -45,7 +45,7 @@ LoadCompressedObjectPic: @ 800EBCC
pop {r1}
bx r1
.align 2, 0
_0800EBFC: .4byte gUnknown_201C000
_0800EBFC: .4byte gDecompressionBuffer
thumb_func_end LoadCompressedObjectPic
thumb_func_start LoadCompressedObjectPicOverrideBuffer
@ -76,7 +76,7 @@ LoadCompressedObjectPalette: @ 800EC28
sub sp, 0x8
adds r5, r0, 0
ldr r0, [r5]
ldr r4, _0800EC54 @ =gUnknown_201C000
ldr r4, _0800EC54 @ =gDecompressionBuffer
adds r1, r4, 0
bl LZ77UnCompWram
str r4, [sp]
@ -93,7 +93,7 @@ LoadCompressedObjectPalette: @ 800EC28
pop {r0}
bx r0
.align 2, 0
_0800EC54: .4byte gUnknown_201C000
_0800EC54: .4byte gDecompressionBuffer
_0800EC58: .4byte 0xffff0000
thumb_func_end LoadCompressedObjectPalette

View File

@ -429,7 +429,7 @@ Task_Hof_InitTeamSaveData: @ 80F2114
lsls r0, 24
lsrs r0, 24
mov r9, r0
ldr r7, _080F2140 @ =gUnknown_201C000
ldr r7, _080F2140 @ =gDecompressionBuffer
bl sub_8112450
ldr r0, _080F2144 @ =gUnknown_203AB44
ldrb r0, [r0]
@ -442,11 +442,11 @@ Task_Hof_InitTeamSaveData: @ 80F2114
bl memset
b _080F2162
.align 2, 0
_080F2140: .4byte gUnknown_201C000
_080F2140: .4byte gDecompressionBuffer
_080F2144: .4byte gUnknown_203AB44
_080F2148:
movs r0, 0x3
bl sub_80DA4FC
bl Save_LoadGameData
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -483,7 +483,7 @@ _080F218C:
cmp r5, 0x31
bls _080F21B2
_080F2190:
ldr r4, _080F220C @ =gUnknown_201C000
ldr r4, _080F220C @ =gDecompressionBuffer
adds r6, r4, 0
adds r4, 0x78
movs r5, 0
@ -541,7 +541,7 @@ _080F21B2:
bx r0
.align 2, 0
_080F2208: .4byte 0x000001ff
_080F220C: .4byte gUnknown_201C000
_080F220C: .4byte gDecompressionBuffer
_080F2210: .4byte gUnknown_203AB38
_080F2214: .4byte gUnknown_8419F54
_080F2218: .4byte gTasks
@ -554,7 +554,7 @@ sub_80F2220: @ 80F2220
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
ldr r1, _080F2254 @ =gUnknown_30053A4
ldr r1, _080F2254 @ =gGameContinueCallback
ldr r0, _080F2258 @ =CB2_DoHallOfFameScreenDontSaveData
str r0, [r1]
movs r0, 0x3
@ -574,7 +574,7 @@ sub_80F2220: @ 80F2220
pop {r0}
bx r0
.align 2, 0
_080F2254: .4byte gUnknown_30053A4
_080F2254: .4byte gGameContinueCallback
_080F2258: .4byte CB2_DoHallOfFameScreenDontSaveData
_080F225C: .4byte gTasks
_080F2260: .4byte sub_80F2264
@ -1609,7 +1609,7 @@ sub_80F2AA4: @ 80F2AA4
movs r3, 0xC
bl sub_810F558
movs r0, 0x3
bl sub_80DA4FC
bl Save_LoadGameData
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -1626,7 +1626,7 @@ _080F2AD8: .4byte 0x00000226
_080F2ADC: .4byte gTasks
_080F2AE0: .4byte sub_80F30A4
_080F2AE4:
ldr r0, _080F2B2C @ =gUnknown_201C000
ldr r0, _080F2B2C @ =gDecompressionBuffer
ldr r4, _080F2B30 @ =gUnknown_203AB38
ldr r1, [r4]
movs r2, 0x80
@ -1663,7 +1663,7 @@ _080F2B1A:
subs r0, r2, 0x1
b _080F2B46
.align 2, 0
_080F2B2C: .4byte gUnknown_201C000
_080F2B2C: .4byte gDecompressionBuffer
_080F2B30: .4byte gUnknown_203AB38
_080F2B34: .4byte 0x000001ff
_080F2B38: .4byte gTasks

View File

@ -463,7 +463,7 @@ _0813BC58: .4byte gUnknown_203F18A
thumb_func_start sub_813BC5C
sub_813BC5C: @ 813BC5C
push {lr}
ldr r0, _0813BC70 @ =gUnknown_201C000
ldr r0, _0813BC70 @ =gDecompressionBuffer
ldr r1, _0813BC74 @ =0x0600c000
movs r2, 0x80
lsls r2, 7
@ -472,7 +472,7 @@ sub_813BC5C: @ 813BC5C
pop {r0}
bx r0
.align 2, 0
_0813BC70: .4byte gUnknown_201C000
_0813BC70: .4byte gDecompressionBuffer
_0813BC74: .4byte 0x0600c000
thumb_func_end sub_813BC5C
@ -1586,7 +1586,7 @@ sub_813C4CC: @ 813C4CC
movs r1, 0xF
movs r2, 0x2
bl GenerateFontHalfRowLookupTable
ldr r1, _0813C508 @ =gUnknown_201C000
ldr r1, _0813C508 @ =gDecompressionBuffer
str r4, [sp]
movs r0, 0x1A
str r0, [sp, 0x4]
@ -1601,7 +1601,7 @@ sub_813C4CC: @ 813C4CC
pop {r0}
bx r0
.align 2, 0
_0813C508: .4byte gUnknown_201C000
_0813C508: .4byte gDecompressionBuffer
thumb_func_end sub_813C4CC
thumb_func_start sub_813C50C
@ -1617,7 +1617,7 @@ sub_813C50C: @ 813C50C
ldr r2, _0813C578 @ =0x0000eeee
adds r0, r2, 0
strh r0, [r1]
ldr r4, _0813C57C @ =gUnknown_201C000
ldr r4, _0813C57C @ =gDecompressionBuffer
ldr r2, _0813C580 @ =0x01001a00
adds r0, r1, 0
adds r1, r4, 0
@ -1658,7 +1658,7 @@ sub_813C50C: @ 813C50C
bx r0
.align 2, 0
_0813C578: .4byte 0x0000eeee
_0813C57C: .4byte gUnknown_201C000
_0813C57C: .4byte gDecompressionBuffer
_0813C580: .4byte 0x01001a00
thumb_func_end sub_813C50C
@ -1751,7 +1751,7 @@ sub_813C624: @ 813C624
ldr r2, _0813C640 @ =0x0000ffff
adds r0, r2, 0
strh r0, [r1]
ldr r1, _0813C644 @ =gUnknown_201C000
ldr r1, _0813C644 @ =gDecompressionBuffer
ldr r2, _0813C648 @ =0x01001a00
mov r0, sp
bl CpuSet
@ -1760,7 +1760,7 @@ sub_813C624: @ 813C624
bx r0
.align 2, 0
_0813C640: .4byte 0x0000ffff
_0813C644: .4byte gUnknown_201C000
_0813C644: .4byte gDecompressionBuffer
_0813C648: .4byte 0x01001a00
thumb_func_end sub_813C624

View File

@ -321,7 +321,7 @@ sub_812B40C: @ 812B40C
ldrb r0, [r0]
cmp r0, 0x1
beq _0812B42E
ldr r0, _0812B438 @ =gUnknown_30053A0
ldr r0, _0812B438 @ =gSaveFileStatus
ldrh r0, [r0]
cmp r0, 0
beq _0812B440
@ -337,7 +337,7 @@ _0812B42E:
b _0812B44E
.align 2, 0
_0812B434: .4byte gUnknown_203B0EE
_0812B438: .4byte gUnknown_30053A0
_0812B438: .4byte gSaveFileStatus
_0812B43C: .4byte 0x0000083c
_0812B440:
ldr r0, _0812B454 @ =0x0000083c

View File

@ -306,10 +306,10 @@ c2_copyright_1: @ 80EC820
cmp r0, 0
bne _080EC858
bl sub_8054A28
bl ResetSaveCounters
bl Save_ResetSaveCounters
movs r0, 0
bl sub_80DA4FC
ldr r0, _080EC85C @ =gUnknown_30053A0
bl Save_LoadGameData
ldr r0, _080EC85C @ =gSaveFileStatus
ldrh r0, [r0]
cmp r0, 0
beq _080EC846
@ -328,7 +328,7 @@ _080EC858:
pop {r0}
bx r0
.align 2, 0
_080EC85C: .4byte gUnknown_30053A0
_080EC85C: .4byte gSaveFileStatus
_080EC860: .4byte gSaveBlock2Ptr
thumb_func_end c2_copyright_1

View File

@ -1033,7 +1033,7 @@ _08009CC0:
mov r10, r7
cmp r1, r0
bls _08009D10
ldr r0, _08009D08 @ =gUnknown_201C000
ldr r0, _08009D08 @ =gDecompressionBuffer
mov r8, r0
movs r2, 0
adds r5, r3, 0
@ -1058,7 +1058,7 @@ _08009CE4:
b _08009D40
.align 2, 0
_08009D04: .4byte gUnknown_3000E18
_08009D08: .4byte gUnknown_201C000
_08009D08: .4byte gDecompressionBuffer
_08009D0C: .4byte gUnknown_3003ED0
_08009D10:
movs r2, 0

View File

@ -10960,7 +10960,7 @@ sub_811B31C: @ 811B31C
lsrs r0, 16
movs r1, 0xD
muls r1, r0
ldr r0, _0811B4B4 @ =gUnknown_823E558
ldr r0, _0811B4B4 @ =gTrainerClassNames
adds r1, r0
adds r0, r6, 0
bl StringCopy
@ -11109,7 +11109,7 @@ _0811B45E:
b _0811B4F0
.align 2, 0
_0811B4B0: .4byte gUnknown_2039624
_0811B4B4: .4byte gUnknown_823E558
_0811B4B4: .4byte gTrainerClassNames
_0811B4B8: .4byte gUnknown_84594B0
_0811B4BC: .4byte gUnknown_84594C4
_0811B4C0: .4byte gStringVar4

View File

@ -12,22 +12,22 @@ CheckForFlashMemory: @ 804BFE4
lsls r0, 16
cmp r0, 0
bne _0804C000
ldr r1, _0804BFFC @ =gUnknown_3005004
ldr r1, _0804BFFC @ =gFlashMemoryPresent
movs r0, 0x1
str r0, [r1]
bl InitFlashTimer
b _0804C006
.align 2, 0
_0804BFFC: .4byte gUnknown_3005004
_0804BFFC: .4byte gFlashMemoryPresent
_0804C000:
ldr r1, _0804C00C @ =gUnknown_3005004
ldr r1, _0804C00C @ =gFlashMemoryPresent
movs r0, 0
str r0, [r1]
_0804C006:
pop {r0}
bx r0
.align 2, 0
_0804C00C: .4byte gUnknown_3005004
_0804C00C: .4byte gFlashMemoryPresent
thumb_func_end CheckForFlashMemory
thumb_func_start ClearSav2
@ -83,7 +83,7 @@ SetSaveBlocksPointers: @ 804C058
ldr r0, _0804C098 @ =gSaveBlock1
adds r0, r1, r0
str r0, [r4]
ldr r2, _0804C09C @ =gUnknown_3005010
ldr r2, _0804C09C @ =gPokemonStoragePtr
ldr r0, _0804C0A0 @ =gPokemonStorage
adds r1, r0
str r1, [r2]
@ -98,7 +98,7 @@ _0804C08C: .4byte gSaveBlock1Ptr
_0804C090: .4byte gSaveBlock2Ptr
_0804C094: .4byte gSaveBlock2
_0804C098: .4byte gSaveBlock1
_0804C09C: .4byte gUnknown_3005010
_0804C09C: .4byte gPokemonStoragePtr
_0804C0A0: .4byte gPokemonStorage
thumb_func_end SetSaveBlocksPointers
@ -134,7 +134,7 @@ sub_804C0A4: @ 804C0A4
ldr r0, _0804C178 @ =gHeap + 0xf24
adds r2, r7, 0
bl memcpy
ldr r6, _0804C17C @ =gUnknown_3005010
ldr r6, _0804C17C @ =gPokemonStoragePtr
ldr r1, [r6]
ldr r0, _0804C180 @ =0x000083d0
mov r8, r0
@ -195,7 +195,7 @@ _0804C16C: .4byte 0x00000f24
_0804C170: .4byte gSaveBlock1Ptr
_0804C174: .4byte 0x00003d68
_0804C178: .4byte gHeap + 0xf24
_0804C17C: .4byte gUnknown_3005010
_0804C17C: .4byte gPokemonStoragePtr
_0804C180: .4byte 0x000083d0
_0804C184: .4byte gHeap + 0x4c8c
thumb_func_end sub_804C0A4

View File

@ -254,7 +254,7 @@ _0800C4E8:
movs r0, 0x54
movs r1, 0x7
bl SetGpuReg
ldr r0, _0800C53C @ =gUnknown_30053A0
ldr r0, _0800C53C @ =gSaveFileStatus
ldrh r4, [r0]
cmp r4, 0x2
beq _0800C58C
@ -267,7 +267,7 @@ _0800C4E8:
b _0800C5E8
.align 2, 0
_0800C538: .4byte gUnknown_2037AB8
_0800C53C: .4byte gUnknown_30053A0
_0800C53C: .4byte gSaveFileStatus
_0800C540:
cmp r4, 0x4
beq _0800C60C

View File

@ -122,7 +122,7 @@ _081436B8: .4byte gUnknown_3003F84
thumb_func_start sub_81436BC
sub_81436BC: @ 81436BC
push {lr}
ldr r0, _081436E0 @ =gUnknown_201C000
ldr r0, _081436E0 @ =gDecompressionBuffer
movs r2, 0x80
lsls r2, 6
movs r1, 0
@ -137,7 +137,7 @@ sub_81436BC: @ 81436BC
pop {r0}
bx r0
.align 2, 0
_081436E0: .4byte gUnknown_201C000
_081436E0: .4byte gDecompressionBuffer
_081436E4: .4byte gUnknown_202271A
_081436E8: .4byte 0x00005502
thumb_func_end sub_81436BC
@ -775,7 +775,7 @@ _08143C12:
strb r0, [r4, 0x8]
b _08143D1A
_08143C1C:
ldr r0, _08143C30 @ =gUnknown_201C000
ldr r0, _08143C30 @ =gDecompressionBuffer
bl sub_815D6B4
strb r0, [r4, 0xE]
ldrb r0, [r4, 0xE]
@ -784,7 +784,7 @@ _08143C1C:
strb r0, [r4, 0x8]
b _08143D1A
.align 2, 0
_08143C30: .4byte gUnknown_201C000
_08143C30: .4byte gDecompressionBuffer
_08143C34:
ldr r0, _08143C48 @ =gUnknown_3003F64
ldrb r0, [r0]
@ -803,7 +803,7 @@ _08143C4C:
strb r0, [r4, 0x8]
b _08143D1A
_08143C52:
ldr r0, _08143C70 @ =gUnknown_201C000
ldr r0, _08143C70 @ =gDecompressionBuffer
bl sub_815D794
cmp r0, 0
beq _08143C78
@ -815,7 +815,7 @@ _08143C52:
strb r0, [r4, 0x8]
b _08143D1A
.align 2, 0
_08143C70: .4byte gUnknown_201C000
_08143C70: .4byte gDecompressionBuffer
_08143C74: .4byte gUnknown_841DE99
_08143C78:
movs r0, 0x16

View File

@ -820,7 +820,7 @@ _08144E30:
.align 2, 0
_08144E48: .4byte gSaveBlock2Ptr
_08144E4C:
ldr r0, _08144E68 @ =gUnknown_201C000
ldr r0, _08144E68 @ =gDecompressionBuffer
ldr r1, [r4, 0x18]
movs r2, 0x80
lsls r2, 3
@ -837,7 +837,7 @@ _08144E62:
pop {r1}
bx r1
.align 2, 0
_08144E68: .4byte gUnknown_201C000
_08144E68: .4byte gDecompressionBuffer
thumb_func_end sub_8144CA0
thumb_func_start sub_8144E6C
@ -894,7 +894,7 @@ _08144EB4:
sub_8144EBC: @ 8144EBC
push {r4,lr}
adds r4, r0, 0
ldr r3, _08144EE4 @ =gUnknown_201C000
ldr r3, _08144EE4 @ =gDecompressionBuffer
adds r0, r4, 0x4
ldr r1, _08144EE8 @ =gSaveBlock2Ptr
ldr r1, [r1]
@ -913,7 +913,7 @@ _08144EDC:
pop {r1}
bx r1
.align 2, 0
_08144EE4: .4byte gUnknown_201C000
_08144EE4: .4byte gDecompressionBuffer
_08144EE8: .4byte gSaveBlock2Ptr
_08144EEC: .4byte gSaveBlock1Ptr
thumb_func_end sub_8144EBC

View File

@ -6926,7 +6926,7 @@ sub_8105D64: @ 8105D64
adds r0, r1
ldr r0, [r0]
mov r12, r0
ldr r7, _08105E18 @ =gUnknown_201C000
ldr r7, _08105E18 @ =gDecompressionBuffer
movs r5, 0
movs r1, 0
_08105DA6:
@ -6988,7 +6988,7 @@ _08105E02:
bx r0
.align 2, 0
_08105E14: .4byte gUnknown_843FAB0
_08105E18: .4byte gUnknown_201C000
_08105E18: .4byte gDecompressionBuffer
thumb_func_end sub_8105D64
thumb_func_start sub_8105E1C

View File

@ -8,14 +8,14 @@
thumb_func_start sub_808B9C0
sub_808B9C0: @ 808B9C0
push {lr}
ldr r1, _0808B9D0 @ =gUnknown_3005010
ldr r1, _0808B9D0 @ =gPokemonStoragePtr
ldr r1, [r1]
ldr r2, _0808B9D4 @ =0x000083d0
bl memcpy
pop {r0}
bx r0
.align 2, 0
_0808B9D0: .4byte gUnknown_3005010
_0808B9D0: .4byte gPokemonStoragePtr
_0808B9D4: .4byte 0x000083d0
thumb_func_end sub_808B9C0
@ -23,25 +23,25 @@ _0808B9D4: .4byte 0x000083d0
sub_808B9D8: @ 808B9D8
push {lr}
adds r1, r0, 0
ldr r0, _0808B9EC @ =gUnknown_3005010
ldr r0, _0808B9EC @ =gPokemonStoragePtr
ldr r0, [r0]
ldr r2, _0808B9F0 @ =0x000083d0
bl memcpy
pop {r0}
bx r0
.align 2, 0
_0808B9EC: .4byte gUnknown_3005010
_0808B9EC: .4byte gPokemonStoragePtr
_0808B9F0: .4byte 0x000083d0
thumb_func_end sub_808B9D8
thumb_func_start StorageGetCurrentBox
StorageGetCurrentBox: @ 808B9F4
ldr r0, _0808B9FC @ =gUnknown_3005010
ldr r0, _0808B9FC @ =gPokemonStoragePtr
ldr r0, [r0]
ldrb r0, [r0]
bx lr
.align 2, 0
_0808B9FC: .4byte gUnknown_3005010
_0808B9FC: .4byte gPokemonStoragePtr
thumb_func_end StorageGetCurrentBox
thumb_func_start sub_808BA00
@ -51,14 +51,14 @@ sub_808BA00: @ 808BA00
lsrs r1, r0, 24
cmp r1, 0xD
bhi _0808BA10
ldr r0, _0808BA14 @ =gUnknown_3005010
ldr r0, _0808BA14 @ =gPokemonStoragePtr
ldr r0, [r0]
strb r1, [r0]
_0808BA10:
pop {r0}
bx r0
.align 2, 0
_0808BA14: .4byte gUnknown_3005010
_0808BA14: .4byte gPokemonStoragePtr
thumb_func_end sub_808BA00
thumb_func_start GetBoxMonDataFromAnyBox
@ -73,7 +73,7 @@ GetBoxMonDataFromAnyBox: @ 808BA18
bhi _0808BA54
cmp r4, 0x1D
bhi _0808BA54
ldr r2, _0808BA50 @ =gUnknown_3005010
ldr r2, _0808BA50 @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@ -90,7 +90,7 @@ GetBoxMonDataFromAnyBox: @ 808BA18
bl GetBoxMonData
b _0808BA56
.align 2, 0
_0808BA50: .4byte gUnknown_3005010
_0808BA50: .4byte gPokemonStoragePtr
_0808BA54:
movs r0, 0
_0808BA56:
@ -112,7 +112,7 @@ SetBoxMonDataFromAnyBox: @ 808BA5C
bhi _0808BA94
cmp r4, 0x1D
bhi _0808BA94
ldr r2, _0808BA9C @ =gUnknown_3005010
ldr r2, _0808BA9C @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@ -133,7 +133,7 @@ _0808BA94:
pop {r0}
bx r0
.align 2, 0
_0808BA9C: .4byte gUnknown_3005010
_0808BA9C: .4byte gPokemonStoragePtr
thumb_func_end SetBoxMonDataFromAnyBox
thumb_func_start GetBoxMonDataFromSelectedBox
@ -143,7 +143,7 @@ GetBoxMonDataFromSelectedBox: @ 808BAA0
adds r2, r1, 0
lsls r3, 24
lsrs r3, 24
ldr r0, _0808BABC @ =gUnknown_3005010
ldr r0, _0808BABC @ =gPokemonStoragePtr
ldr r0, [r0]
ldrb r0, [r0]
adds r1, r3, 0
@ -151,7 +151,7 @@ GetBoxMonDataFromSelectedBox: @ 808BAA0
pop {r1}
bx r1
.align 2, 0
_0808BABC: .4byte gUnknown_3005010
_0808BABC: .4byte gPokemonStoragePtr
thumb_func_end GetBoxMonDataFromSelectedBox
thumb_func_start SetBoxMonDataFromSelectedBox
@ -162,7 +162,7 @@ SetBoxMonDataFromSelectedBox: @ 808BAC0
adds r3, r2, 0
lsls r4, 24
lsrs r4, 24
ldr r0, _0808BAE0 @ =gUnknown_3005010
ldr r0, _0808BAE0 @ =gPokemonStoragePtr
ldr r0, [r0]
ldrb r0, [r0]
adds r1, r4, 0
@ -172,7 +172,7 @@ SetBoxMonDataFromSelectedBox: @ 808BAC0
pop {r0}
bx r0
.align 2, 0
_0808BAE0: .4byte gUnknown_3005010
_0808BAE0: .4byte gPokemonStoragePtr
thumb_func_end SetBoxMonDataFromSelectedBox
thumb_func_start GetBoxMonNickFromAnyBox
@ -187,7 +187,7 @@ GetBoxMonNickFromAnyBox: @ 808BAE4
bhi _0808BB20
cmp r4, 0x1D
bhi _0808BB20
ldr r2, _0808BB1C @ =gUnknown_3005010
ldr r2, _0808BB1C @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@ -205,7 +205,7 @@ GetBoxMonNickFromAnyBox: @ 808BAE4
bl GetBoxMonData
b _0808BB24
.align 2, 0
_0808BB1C: .4byte gUnknown_3005010
_0808BB1C: .4byte gPokemonStoragePtr
_0808BB20:
movs r0, 0xFF
strb r0, [r5]
@ -227,7 +227,7 @@ SetBoxMonNickFromAnyBox: @ 808BB2C
bhi _0808BB62
cmp r4, 0x1D
bhi _0808BB62
ldr r2, _0808BB68 @ =gUnknown_3005010
ldr r2, _0808BB68 @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@ -248,7 +248,7 @@ _0808BB62:
pop {r0}
bx r0
.align 2, 0
_0808BB68: .4byte gUnknown_3005010
_0808BB68: .4byte gPokemonStoragePtr
thumb_func_end SetBoxMonNickFromAnyBox
thumb_func_start GetAndCopyBoxMonDataFromAnyBox
@ -264,7 +264,7 @@ GetAndCopyBoxMonDataFromAnyBox: @ 808BB6C
bhi _0808BBAC
cmp r4, 0x1D
bhi _0808BBAC
ldr r2, _0808BBA8 @ =gUnknown_3005010
ldr r2, _0808BBA8 @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@ -282,7 +282,7 @@ GetAndCopyBoxMonDataFromAnyBox: @ 808BB6C
bl GetBoxMonData
b _0808BBAE
.align 2, 0
_0808BBA8: .4byte gUnknown_3005010
_0808BBA8: .4byte gPokemonStoragePtr
_0808BBAC:
movs r0, 0
_0808BBAE:
@ -303,7 +303,7 @@ CopyBoxMonFromAnyBox: @ 808BBB4
bhi _0808BBEA
cmp r1, 0x1D
bhi _0808BBEA
ldr r0, _0808BBF0 @ =gUnknown_3005010
ldr r0, _0808BBF0 @ =gPokemonStoragePtr
ldr r0, [r0]
lsls r3, r1, 2
adds r3, r1
@ -324,7 +324,7 @@ _0808BBEA:
pop {r0}
bx r0
.align 2, 0
_0808BBF0: .4byte gUnknown_3005010
_0808BBF0: .4byte gPokemonStoragePtr
thumb_func_end CopyBoxMonFromAnyBox
thumb_func_start sub_808BBF4
@ -339,7 +339,7 @@ sub_808BBF4: @ 808BBF4
bhi _0808BC2A
cmp r2, 0x1D
bhi _0808BC2A
ldr r0, _0808BC30 @ =gUnknown_3005010
ldr r0, _0808BC30 @ =gPokemonStoragePtr
ldr r1, [r0]
lsls r3, r2, 2
adds r3, r2
@ -360,7 +360,7 @@ _0808BC2A:
pop {r0}
bx r0
.align 2, 0
_0808BC30: .4byte gUnknown_3005010
_0808BC30: .4byte gPokemonStoragePtr
thumb_func_end sub_808BBF4
thumb_func_start sub_808BC34
@ -395,7 +395,7 @@ sub_808BC34: @ 808BC34
bhi _0808BCA0
cmp r6, 0x1D
bhi _0808BCA0
ldr r2, _0808BCB0 @ =gUnknown_3005010
ldr r2, _0808BCB0 @ =gPokemonStoragePtr
lsls r0, r7, 2
adds r0, r7
lsls r1, r0, 4
@ -427,7 +427,7 @@ _0808BCA0:
pop {r0}
bx r0
.align 2, 0
_0808BCB0: .4byte gUnknown_3005010
_0808BCB0: .4byte gPokemonStoragePtr
thumb_func_end sub_808BC34
thumb_func_start sub_808BCB4
@ -441,7 +441,7 @@ sub_808BCB4: @ 808BCB4
bhi _0808BCE4
cmp r4, 0x1D
bhi _0808BCE4
ldr r2, _0808BCEC @ =gUnknown_3005010
ldr r2, _0808BCEC @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@ -460,7 +460,7 @@ _0808BCE4:
pop {r0}
bx r0
.align 2, 0
_0808BCEC: .4byte gUnknown_3005010
_0808BCEC: .4byte gPokemonStoragePtr
thumb_func_end sub_808BCB4
thumb_func_start sub_808BCF0
@ -475,7 +475,7 @@ sub_808BCF0: @ 808BCF0
bhi _0808BD24
cmp r4, 0x1D
bhi _0808BD24
ldr r2, _0808BD2C @ =gUnknown_3005010
ldr r2, _0808BD2C @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@ -495,7 +495,7 @@ _0808BD24:
pop {r0}
bx r0
.align 2, 0
_0808BD2C: .4byte gUnknown_3005010
_0808BD2C: .4byte gPokemonStoragePtr
thumb_func_end sub_808BCF0
thumb_func_start GetBoxedMonPtr
@ -509,7 +509,7 @@ GetBoxedMonPtr: @ 808BD30
bhi _0808BD64
cmp r4, 0x1D
bhi _0808BD64
ldr r2, _0808BD60 @ =gUnknown_3005010
ldr r2, _0808BD60 @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@ -524,7 +524,7 @@ GetBoxedMonPtr: @ 808BD30
adds r0, r1
b _0808BD66
.align 2, 0
_0808BD60: .4byte gUnknown_3005010
_0808BD60: .4byte gPokemonStoragePtr
_0808BD64:
movs r0, 0
_0808BD66:
@ -543,7 +543,7 @@ GetBoxNamePtr: @ 808BD6C
movs r0, 0
b _0808BD88
_0808BD7A:
ldr r0, _0808BD8C @ =gUnknown_3005010
ldr r0, _0808BD8C @ =gPokemonStoragePtr
lsls r1, r2, 3
adds r1, r2
ldr r2, _0808BD90 @ =0x00008344
@ -554,7 +554,7 @@ _0808BD88:
pop {r1}
bx r1
.align 2, 0
_0808BD8C: .4byte gUnknown_3005010
_0808BD8C: .4byte gPokemonStoragePtr
_0808BD90: .4byte 0x00008344
thumb_func_end GetBoxNamePtr
@ -568,7 +568,7 @@ sub_808BD94: @ 808BD94
movs r0, 0
b _0808BDAE
_0808BDA2:
ldr r0, _0808BDB4 @ =gUnknown_3005010
ldr r0, _0808BDB4 @ =gPokemonStoragePtr
ldr r0, [r0]
ldr r2, _0808BDB8 @ =0x000083c2
adds r0, r2
@ -578,7 +578,7 @@ _0808BDAE:
pop {r1}
bx r1
.align 2, 0
_0808BDB4: .4byte gUnknown_3005010
_0808BDB4: .4byte gPokemonStoragePtr
_0808BDB8: .4byte 0x000083c2
thumb_func_end sub_808BD94
@ -593,7 +593,7 @@ sub_808BDBC: @ 808BDBC
bhi _0808BDDA
cmp r1, 0xF
bhi _0808BDDA
ldr r0, _0808BDE0 @ =gUnknown_3005010
ldr r0, _0808BDE0 @ =gPokemonStoragePtr
ldr r0, [r0]
ldr r3, _0808BDE4 @ =0x000083c2
adds r0, r3
@ -603,7 +603,7 @@ _0808BDDA:
pop {r0}
bx r0
.align 2, 0
_0808BDE0: .4byte gUnknown_3005010
_0808BDE0: .4byte gPokemonStoragePtr
_0808BDE4: .4byte 0x000083c2
thumb_func_end sub_808BDBC

View File

@ -2194,9 +2194,9 @@ _08111980: .4byte gUnknown_3005E88
sub_8111984: @ 8111984
push {lr}
bl sub_806E6FC
bl ResetSaveCounters
bl Save_ResetSaveCounters
movs r0, 0
bl sub_80DA4FC
bl Save_LoadGameData
ldr r0, _081119B4 @ =sub_8057430
bl SetMainCallback2
ldr r1, _081119B8 @ =gUnknown_3005024

View File

@ -28,10 +28,10 @@ sub_8079B7C: @ 8079B7C
strb r0, [r1]
bl SetSaveBlocksPointers
bl sub_8054A28
bl ResetSaveCounters
bl Save_ResetSaveCounters
movs r0, 0
bl sub_80DA4FC
ldr r0, _08079BF8 @ =gUnknown_30053A0
bl Save_LoadGameData
ldr r0, _08079BF8 @ =gSaveFileStatus
ldrh r0, [r0]
cmp r0, 0
beq _08079BC4
@ -59,7 +59,7 @@ _08079BC8:
_08079BEC: .4byte 0x04000208
_08079BF0: .4byte gMain
_08079BF4: .4byte 0x00000439
_08079BF8: .4byte gUnknown_30053A0
_08079BF8: .4byte gSaveFileStatus
_08079BFC: .4byte gSaveBlock2Ptr
_08079C00: .4byte gHeap
_08079C04: .4byte sub_8056938

2156
asm/save.s

File diff suppressed because it is too large Load Diff

View File

@ -15,8 +15,8 @@ sub_80F50F4: @ 80F50F4
_080F50FC: .4byte gUnknown_3005430
thumb_func_end sub_80F50F4
thumb_func_start sub_80F5100
sub_80F5100: @ 80F5100
thumb_func_start DoSaveFailedScreen
DoSaveFailedScreen: @ 80F5100
lsls r0, 24
lsrs r0, 24
ldr r1, _080F5110 @ =gUnknown_203AB4C
@ -28,7 +28,7 @@ sub_80F5100: @ 80F5100
.align 2, 0
_080F5110: .4byte gUnknown_203AB4C
_080F5114: .4byte gUnknown_3005430
thumb_func_end sub_80F5100
thumb_func_end DoSaveFailedScreen
thumb_func_start sub_80F5118
sub_80F5118: @ 80F5118
@ -435,7 +435,7 @@ _080F5454: .4byte 0x01001180
sub_80F5458: @ 80F5458
push {r4,r5,lr}
movs r5, 0
ldr r0, _080F5490 @ =gUnknown_300538C
ldr r0, _080F5490 @ =gDamagedSaveSectors
ldr r1, [r0]
adds r4, r0, 0
cmp r1, 0
@ -447,12 +447,12 @@ _080F5466:
bne _080F5498
ldr r0, _080F5494 @ =gUnknown_203AB4C
ldrb r0, [r0]
bl sub_80DA248
bl HandleSavingData
adds r5, 0x1
ldr r0, [r4]
cmp r0, 0
beq _080F548C
ldr r4, _080F5490 @ =gUnknown_300538C
ldr r4, _080F5490 @ =gDamagedSaveSectors
cmp r5, 0x2
ble _080F5466
ldr r0, [r4]
@ -462,7 +462,7 @@ _080F548C:
movs r0, 0x1
b _080F549A
.align 2, 0
_080F5490: .4byte gUnknown_300538C
_080F5490: .4byte gDamagedSaveSectors
_080F5494: .4byte gUnknown_203AB4C
_080F5498:
movs r0, 0
@ -477,7 +477,7 @@ VerifySectorWipe: @ 80F54A0
push {r4,lr}
lsls r0, 16
lsrs r0, 16
ldr r4, _080F54C4 @ =gUnknown_2039A38
ldr r4, _080F54C4 @ =gSaveDataBuffer
movs r3, 0x80
lsls r3, 5
movs r1, 0
@ -492,7 +492,7 @@ _080F54B8:
movs r0, 0x1
b _080F54DA
.align 2, 0
_080F54C4: .4byte gUnknown_2039A38
_080F54C4: .4byte gSaveDataBuffer
_080F54C8: .4byte 0x000003ff
_080F54CC:
adds r0, r1, 0x1

View File

@ -1379,7 +1379,7 @@ _0806F814:
beq _0806F858
b _0806F864
_0806F81A:
ldr r0, _0806F838 @ =gUnknown_30053A0
ldr r0, _0806F838 @ =gSaveFileStatus
ldrh r0, [r0]
cmp r0, 0
beq _0806F826
@ -1396,7 +1396,7 @@ _0806F82E:
str r0, [r1]
b _0806F864
.align 2, 0
_0806F838: .4byte gUnknown_30053A0
_0806F838: .4byte gSaveFileStatus
_0806F83C: .4byte gUnknown_2031DB0
_0806F840: .4byte gUnknown_3000FA4
_0806F844: .4byte sub_806F86C

View File

@ -1107,10 +1107,10 @@ _08079248:
bl SeedRngAndSetTrainerId
bl SetSaveBlocksPointers
bl sub_8054A28
bl ResetSaveCounters
bl Save_ResetSaveCounters
movs r0, 0
bl sub_80DA4FC
ldr r0, _080792B4 @ =gUnknown_30053A0
bl Save_LoadGameData
ldr r0, _080792B4 @ =gSaveFileStatus
ldrh r0, [r0]
cmp r0, 0
beq _08079276
@ -1143,7 +1143,7 @@ _080792A6:
bx r0
.align 2, 0
_080792B0: .4byte gUnknown_2037AB8
_080792B4: .4byte gUnknown_30053A0
_080792B4: .4byte gSaveFileStatus
_080792B8: .4byte gSaveBlock2Ptr
_080792BC: .4byte gHeap
_080792C0: .4byte sub_800C300

View File

@ -648,7 +648,7 @@ _0804CB9C:
ldr r0, [r0]
ldr r6, _0804CC18 @ =gUnknown_2031C94
ldr r1, [r6]
ldr r5, _0804CC1C @ =gUnknown_201C000
ldr r5, _0804CC1C @ =gDecompressionBuffer
str r5, [sp]
movs r4, 0x3
str r4, [sp, 0x4]
@ -701,7 +701,7 @@ _0804CB9C:
.align 2, 0
_0804CC14: .4byte gSaveBlock2Ptr
_0804CC18: .4byte gUnknown_2031C94
_0804CC1C: .4byte gUnknown_201C000
_0804CC1C: .4byte gDecompressionBuffer
_0804CC20: .4byte gUnknown_2022744
_0804CC24: .4byte gUnknown_8261ECC
_0804CC28: .4byte gMain
@ -1338,7 +1338,7 @@ _0804D19C:
ldr r0, [r0]
ldr r6, _0804D218 @ =gUnknown_2031C94
ldr r1, [r6]
ldr r5, _0804D21C @ =gUnknown_201C000
ldr r5, _0804D21C @ =gDecompressionBuffer
str r5, [sp]
movs r4, 0x3
str r4, [sp, 0x4]
@ -1392,7 +1392,7 @@ _0804D200:
.align 2, 0
_0804D214: .4byte gSaveBlock2Ptr
_0804D218: .4byte gUnknown_2031C94
_0804D21C: .4byte gUnknown_201C000
_0804D21C: .4byte gDecompressionBuffer
_0804D220: .4byte gUnknown_2022744
_0804D224: .4byte gUnknown_8261ECC
_0804D228: .4byte gMain
@ -6024,7 +6024,7 @@ _0804F71E:
sub_804F728: @ 804F728
push {lr}
sub sp, 0x8
ldr r2, _0804F744 @ =gUnknown_201C000
ldr r2, _0804F744 @ =gDecompressionBuffer
str r2, [sp]
movs r2, 0x6
str r2, [sp, 0x4]
@ -6035,7 +6035,7 @@ sub_804F728: @ 804F728
pop {r0}
bx r0
.align 2, 0
_0804F744: .4byte gUnknown_201C000
_0804F744: .4byte gDecompressionBuffer
thumb_func_end sub_804F728
thumb_func_start sub_804F748
@ -7852,7 +7852,7 @@ sub_80504CC: @ 80504CC
bl sub_80F696C
ldr r0, _080505BC @ =gFile_graphics_interface_menu_map_tilemap
mov r8, r0
ldr r4, _080505C0 @ =gUnknown_201C000
ldr r4, _080505C0 @ =gDecompressionBuffer
adds r1, r4, 0
bl LZDecompressWram
movs r0, 0
@ -7897,8 +7897,13 @@ sub_80504CC: @ 80504CC
.align 2, 0
_080505B4: .4byte gUnknown_826D1D4
_080505B8: .4byte gUnknown_8D00000
<<<<<<< HEAD
_080505BC: .4byte gFile_graphics_interface_menu_map_tilemap
_080505C0: .4byte gUnknown_201C000
=======
_080505BC: .4byte gUnknown_8D0051C
_080505C0: .4byte gDecompressionBuffer
>>>>>>> upstream/master
_080505C4: .4byte gUnknown_8D004D8
_080505C8: .4byte gUnknown_826D1BC
thumb_func_end sub_80504CC

View File

@ -2787,13 +2787,13 @@ sub_814EC80: @ 814EC80
adds r6, r0, 0
movs r5, 0
ldr r0, _0814EC94 @ =gUnknown_8EB0ADC
ldr r4, _0814EC98 @ =gUnknown_201C000
ldr r4, _0814EC98 @ =gDecompressionBuffer
adds r1, r4, 0
bl LZ77UnCompWram
b _0814ECCA
.align 2, 0
_0814EC94: .4byte gUnknown_8EB0ADC
_0814EC98: .4byte gUnknown_201C000
_0814EC98: .4byte gDecompressionBuffer
_0814EC9C:
lsls r1, r5, 2
movs r2, 0xA2

12
common_syms/save.txt Normal file
View File

@ -0,0 +1,12 @@
gFirstSaveSector
gPrevSaveCounter
gLastKnownGoodSector
gDamagedSaveSectors
gSaveCounter
gFastSaveSection
gUnknown_3005398
gSaveUnusedVar
gSaveFileStatus
gGameContinueCallback
gRamSaveSectionLocations
gUnknown_3005420

View File

@ -118,9 +118,10 @@ gUnknown_8239FD4:: @ 8239FD4
gUnknown_823A004:: @ 823A004
.incbin "baserom.gba", 0x23A004, 0x4554
gUnknown_823E558:: @ 823E558
.incbin "baserom.gba", 0x23E558, 0x570
gTrainerClassNames:: @ 823E558
.include "data/text/trainer_class_names.inc"
.align 2, 0
gTrainers:: @ 823EAD8
.incbin "baserom.gba", 0x23EAC8, 0x7418

631
data/data_83F5738.s Normal file
View File

@ -0,0 +1,631 @@
.section .rodata
.align 2
gUnknown_83F5738:: @ 83F5738
.incbin "baserom.gba", 0x3F5738, 0xCC
gUnknown_83F5804:: @ 83F5804
.incbin "baserom.gba", 0x3F5804, 0x20
gUnknown_83F5824:: @ 83F5824
.incbin "baserom.gba", 0x3F5824, 0x20
gUnknown_83F5844:: @ 83F5844
.incbin "baserom.gba", 0x3F5844, 0x10
gUnknown_83F5854:: @ 83F5854
.incbin "baserom.gba", 0x3F5854, 0x10
gUnknown_83F5864:: @ 83F5864
.incbin "baserom.gba", 0x3F5864, 0x1E0
gUnknown_83F5A44:: @ 83F5A44
.incbin "baserom.gba", 0x3F5A44, 0xB4
gUnknown_83F5AF8:: @ 83F5AF8
.incbin "baserom.gba", 0x3F5AF8, 0x22
gUnknown_83F5B1A:: @ 83F5B1A
.incbin "baserom.gba", 0x3F5B1A, 0x16
gUnknown_83F5B30:: @ 83F5B30
.incbin "baserom.gba", 0x3F5B30, 0xC
gUnknown_83F5B3C:: @ 83F5B3C
.incbin "baserom.gba", 0x3F5B3C, 0x8
gUnknown_83F5B44:: @ 83F5B44
.incbin "baserom.gba", 0x3F5B44, 0x50
gUnknown_83F5B94:: @ 83F5B94
.incbin "baserom.gba", 0x3F5B94, 0x12
gUnknown_83F5BA6:: @ 83F5BA6
.incbin "baserom.gba", 0x3F5BA6, 0x12
gUnknown_83F5BB8:: @ 83F5BB8
.incbin "baserom.gba", 0x3F5BB8, 0x9
gUnknown_83F5BC1:: @ 83F5BC1
.incbin "baserom.gba", 0x3F5BC1, 0xB
gUnknown_83F5BCC:: @ 83F5BCC
.incbin "baserom.gba", 0x3F5BCC, 0x150
gUnknown_83F5D1C:: @ 83F5D1C
.incbin "baserom.gba", 0x3F5D1C, 0x10
gUnknown_83F5D2C:: @ 83F5D2C
.incbin "baserom.gba", 0x3F5D2C, 0x6
gUnknown_83F5D32:: @ 83F5D32
.incbin "baserom.gba", 0x3F5D32, 0x26
gUnknown_83F5D58:: @ 83F5D58
.incbin "baserom.gba", 0x3F5D58, 0x198
.align 2
gUnknown_83F5EF0:: @ 83F5EF0
.asciz "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/scr_tool.c"
.align 2
gUnknown_83F5F24:: @ 83F5F24
.asciz "0"
gUnknown_83F5F26:: @ 83F5F26
.incbin "baserom.gba", 0x3F5F26, 0x2A
gUnknown_83F5F50:: @ 83F5F50
.incbin "baserom.gba", 0x3F5F50, 0x160
gUnknown_83F60B0:: @ 83F60B0
.incbin "baserom.gba", 0x3F60B0, 0x20
gUnknown_83F60D0:: @ 83F60D0
.incbin "baserom.gba", 0x3F60D0, 0x100
gUnknown_83F61D0:: @ 83F61D0
.incbin "baserom.gba", 0x3F61D0, 0x20
gUnknown_83F61F0:: @ 83F61F0
.incbin "baserom.gba", 0x3F61F0, 0xB
gUnknown_83F61FB:: @ 83F61FB
.incbin "baserom.gba", 0x3F61FB, 0x8
gUnknown_83F6203:: @ 83F6203
.incbin "baserom.gba", 0x3F6203, 0x3
gUnknown_83F6206:: @ 83F6206
.incbin "baserom.gba", 0x3F6206, 0x160
gUnknown_83F6366:: @ 83F6366
.incbin "baserom.gba", 0x3F6366, 0x16
gUnknown_83F637C:: @ 83F637C
.incbin "baserom.gba", 0x3F637C, 0xC
gUnknown_83F6388:: @ 83F6388
.incbin "baserom.gba", 0x3F6388, 0xC0
gUnknown_83F6448:: @ 83F6448
.incbin "baserom.gba", 0x3F6448, 0x20
gUnknown_83F6468:: @ 83F6468
.incbin "baserom.gba", 0x3F6468, 0x800
gUnknown_83F6C68:: @ 83F6C68
.incbin "baserom.gba", 0x3F6C68, 0x10
gUnknown_83F6C78:: @ 83F6C78
.incbin "baserom.gba", 0x3F6C78, 0x4
gUnknown_83F6C7C:: @ 83F6C7C
.incbin "baserom.gba", 0x3F6C7C, 0x8
gUnknown_83F6C84:: @ 83F6C84
.incbin "baserom.gba", 0x3F6C84, 0x2C
gUnknown_83F6CB0:: @ 83F6CB0
.incbin "baserom.gba", 0x3F6CB0, 0x6F8
gUnknown_83F73A8:: @ 83F73A8
.incbin "baserom.gba", 0x3F73A8, 0x4E4
gUnknown_83F788C:: @ 83F788C
.incbin "baserom.gba", 0x3F788C, 0x4D4
gUnknown_83F7D60:: @ 83F7D60
.incbin "baserom.gba", 0x3F7D60, 0x6A0
gUnknown_83F8400:: @ 83F8400
.incbin "baserom.gba", 0x3F8400, 0x40
gUnknown_83F8440:: @ 83F8440
.incbin "baserom.gba", 0x3F8440, 0x2D
gUnknown_83F846D:: @ 83F846D
.incbin "baserom.gba", 0x3F846D, 0x10
gUnknown_83F847D:: @ 83F847D
.incbin "baserom.gba", 0x3F847D, 0x323
gUnknown_83F87A0:: @ 83F87A0
.incbin "baserom.gba", 0x3F87A0, 0x580
gUnknown_83F8D20:: @ 83F8D20
.incbin "baserom.gba", 0x3F8D20, 0x240
gUnknown_83F8F60:: @ 83F8F60
.incbin "baserom.gba", 0x3F8F60, 0x11E0
gUnknown_83FA140:: @ 83FA140
.incbin "baserom.gba", 0x3FA140, 0x1E0
gUnknown_83FA320:: @ 83FA320
.incbin "baserom.gba", 0x3FA320, 0x48
gUnknown_83FA368:: @ 83FA368
.incbin "baserom.gba", 0x3FA368, 0x48
gUnknown_83FA3B0:: @ 83FA3B0
.incbin "baserom.gba", 0x3FA3B0, 0x10
gUnknown_83FA3C0:: @ 83FA3C0
.incbin "baserom.gba", 0x3FA3C0, 0xC
gUnknown_83FA3CC:: @ 83FA3CC
.incbin "baserom.gba", 0x3FA3CC, 0x8
gUnknown_83FA3D4:: @ 83FA3D4
.incbin "baserom.gba", 0x3FA3D4, 0x8
gUnknown_83FA3DC:: @ 83FA3DC
.incbin "baserom.gba", 0x3FA3DC, 0x18
gUnknown_83FA3F4:: @ 83FA3F4
.incbin "baserom.gba", 0x3FA3F4, 0xC
gUnknown_83FA400:: @ 83FA400
.incbin "baserom.gba", 0x3FA400, 0x4
gUnknown_83FA404:: @ 83FA404
.incbin "baserom.gba", 0x3FA404, 0xA
gUnknown_83FA40E:: @ 83FA40E
.incbin "baserom.gba", 0x3FA40E, 0x6
gUnknown_83FA414:: @ 83FA414
.incbin "baserom.gba", 0x3FA414, 0x1C
gUnknown_83FA430:: @ 83FA430
.incbin "baserom.gba", 0x3FA430, 0x8
gUnknown_83FA438:: @ 83FA438
.incbin "baserom.gba", 0x3FA438, 0xC
gUnknown_83FA444:: @ 83FA444
.incbin "baserom.gba", 0x3FA444, 0x20
gUnknown_83FA464:: @ 83FA464
.incbin "baserom.gba", 0x3FA464, 0x8
gUnknown_83FA46C:: @ 83FA46C
.incbin "baserom.gba", 0x3FA46C, 0x28
gUnknown_83FA494:: @ 83FA494
.incbin "baserom.gba", 0x3FA494, 0x6
gUnknown_83FA49A:: @ 83FA49A
.incbin "baserom.gba", 0x3FA49A, 0x14
gUnknown_83FA4AE:: @ 83FA4AE
.incbin "baserom.gba", 0x3FA4AE, 0x16
gUnknown_83FA4C4:: @ 83FA4C4
.incbin "baserom.gba", 0x3FA4C4, 0x1C
gUnknown_83FA4E0:: @ 83FA4E0
.incbin "baserom.gba", 0x3FA4E0, 0x4
gUnknown_83FA4E4:: @ 83FA4E4
.incbin "baserom.gba", 0x3FA4E4, 0x4
gUnknown_83FA4E8:: @ 83FA4E8
.incbin "baserom.gba", 0x3FA4E8, 0xC
gUnknown_83FA4F4:: @ 83FA4F4
.incbin "baserom.gba", 0x3FA4F4, 0x14
gUnknown_83FA508:: @ 83FA508
.incbin "baserom.gba", 0x3FA508, 0xC
gUnknown_83FA514:: @ 83FA514
.incbin "baserom.gba", 0x3FA514, 0xC
gUnknown_83FA520:: @ 83FA520
.incbin "baserom.gba", 0x3FA520, 0x14
gUnknown_83FA534:: @ 83FA534
.incbin "baserom.gba", 0x3FA534, 0x46
gUnknown_83FA57A:: @ 83FA57A
.incbin "baserom.gba", 0x3FA57A, 0xE
gUnknown_83FA588:: @ 83FA588
.incbin "baserom.gba", 0x3FA588, 0x44
gUnknown_83FA5CC:: @ 83FA5CC
.incbin "baserom.gba", 0x3FA5CC, 0x6C
gUnknown_83FA638:: @ 83FA638
.incbin "baserom.gba", 0x3FA638, 0x108
gUnknown_83FA740:: @ 83FA740
.incbin "baserom.gba", 0x3FA740, 0x14
gUnknown_83FA754:: @ 83FA754
.incbin "baserom.gba", 0x3FA754, 0x30
gUnknown_83FA784:: @ 83FA784
.incbin "baserom.gba", 0x3FA784, 0x4B0
gUnknown_83FAC34:: @ 83FAC34
.incbin "baserom.gba", 0x3FAC34, 0x500
gUnknown_83FB134:: @ 83FB134
.incbin "baserom.gba", 0x3FB134, 0xA80
BattleText_MistShroud:: @ 83FBBB4
.incbin "baserom.gba", 0x3FBBB4, 0x35
BattleText_GetPumped:: @ 83FBBE9
.incbin "baserom.gba", 0x3FBBE9, 0xE43
gText_PkmnsXPreventsSwitching:: @ 83FCA2C
.incbin "baserom.gba", 0x3FCA2C, 0x11E
BattleText_Rose:: @ 83FCB4A
.incbin "baserom.gba", 0x3FCB4A, 0x20
BattleText_UnknownString3:: @ 83FCB6A
.incbin "baserom.gba", 0x3FCB6A, 0x120
gUnknown_83FCC8A:: @ 83FCC8A
.incbin "baserom.gba", 0x3FCC8A, 0x5A
gUnknown_83FCCE4:: @ 83FCCE4
.incbin "baserom.gba", 0x3FCCE4, 0x14
gUnknown_83FCCF8:: @ 83FCCF8
.incbin "baserom.gba", 0x3FCCF8, 0x17
gUnknown_83FCD0F:: @ 83FCD0F
.incbin "baserom.gba", 0x3FCD0F, 0x18
gUnknown_83FCD27:: @ 83FCD27
.incbin "baserom.gba", 0x3FCD27, 0x1A
gUnknown_83FCD41:: @ 83FCD41
.incbin "baserom.gba", 0x3FCD41, 0x25
gUnknown_83FCD66:: @ 83FCD66
.incbin "baserom.gba", 0x3FCD66, 0x2C
gUnknown_83FCD92:: @ 83FCD92
.incbin "baserom.gba", 0x3FCD92, 0xD
gUnknown_83FCD9F:: @ 83FCD9F
.incbin "baserom.gba", 0x3FCD9F, 0x428
gUnknown_83FD1C7:: @ 83FD1C7
.incbin "baserom.gba", 0x3FD1C7, 0xBD
gUnknown_83FD284:: @ 83FD284
.incbin "baserom.gba", 0x3FD284, 0x13
gUnknown_83FD297:: @ 83FD297
.incbin "baserom.gba", 0x3FD297, 0x13
gUnknown_83FD2AA:: @ 83FD2AA
.incbin "baserom.gba", 0x3FD2AA, 0x15
gUnknown_83FD2BF:: @ 83FD2BF
.incbin "baserom.gba", 0x3FD2BF, 0x1A
gUnknown_83FD2D9:: @ 83FD2D9
.incbin "baserom.gba", 0x3FD2D9, 0x34
gUnknown_83FD30D:: @ 83FD30D
.incbin "baserom.gba", 0x3FD30D, 0x59
gUnknown_83FD366:: @ 83FD366
.incbin "baserom.gba", 0x3FD366, 0x1D
gUnknown_83FD383:: @ 83FD383
.incbin "baserom.gba", 0x3FD383, 0x14
gUnknown_83FD397:: @ 83FD397
.incbin "baserom.gba", 0x3FD397, 0x1A
gUnknown_83FD3B1:: @ 83FD3B1
.incbin "baserom.gba", 0x3FD3B1, 0x16
gUnknown_83FD3C7:: @ 83FD3C7
.incbin "baserom.gba", 0x3FD3C7, 0x1D
gUnknown_83FD3E4:: @ 83FD3E4
.incbin "baserom.gba", 0x3FD3E4, 0x13
gUnknown_83FD3F7:: @ 83FD3F7
.incbin "baserom.gba", 0x3FD3F7, 0x10
gUnknown_83FD407:: @ 83FD407
.incbin "baserom.gba", 0x3FD407, 0x17
gUnknown_83FD41E:: @ 83FD41E
.incbin "baserom.gba", 0x3FD41E, 0x20
gUnknown_83FD43E:: @ 83FD43E
.incbin "baserom.gba", 0x3FD43E, 0x10
gUnknown_83FD44E:: @ 83FD44E
.incbin "baserom.gba", 0x3FD44E, 0x10
gUnknown_83FD45E:: @ 83FD45E
.incbin "baserom.gba", 0x3FD45E, 0x8
gUnknown_83FD466:: @ 83FD466
.incbin "baserom.gba", 0x3FD466, 0xF
gUnknown_83FD475:: @ 83FD475
.incbin "baserom.gba", 0x3FD475, 0x8
gUnknown_83FD47D:: @ 83FD47D
.incbin "baserom.gba", 0x3FD47D, 0xB
gUnknown_83FD488:: @ 83FD488
.incbin "baserom.gba", 0x3FD488, 0xF
gUnknown_83FD497:: @ 83FD497
.incbin "baserom.gba", 0x3FD497, 0x1E
gUnknown_83FD4B5:: @ 83FD4B5
.incbin "baserom.gba", 0x3FD4B5, 0x18
gUnknown_83FD4CD:: @ 83FD4CD
.incbin "baserom.gba", 0x3FD4CD, 0x1E
gUnknown_83FD4EB:: @ 83FD4EB
.incbin "baserom.gba", 0x3FD4EB, 0xF
gUnknown_83FD4FA:: @ 83FD4FA
.incbin "baserom.gba", 0x3FD4FA, 0x13
gUnknown_83FD50D:: @ 83FD50D
.incbin "baserom.gba", 0x3FD50D, 0x15
gUnknown_83FD522:: @ 83FD522
.incbin "baserom.gba", 0x3FD522, 0x13
gUnknown_83FD535:: @ 83FD535
.incbin "baserom.gba", 0x3FD535, 0x10
gUnknown_83FD545:: @ 83FD545
.incbin "baserom.gba", 0x3FD545, 0x10
gUnknown_83FD555:: @ 83FD555
.incbin "baserom.gba", 0x3FD555, 0x6
gUnknown_83FD55B:: @ 83FD55B
.incbin "baserom.gba", 0x3FD55B, 0x5
gUnknown_83FD560:: @ 83FD560
.incbin "baserom.gba", 0x3FD560, 0x4
gUnknown_83FD564:: @ 83FD564
.incbin "baserom.gba", 0x3FD564, 0x5
gUnknown_83FD569:: @ 83FD569
.incbin "baserom.gba", 0x3FD569, 0x4
gUnknown_83FD56D:: @ 83FD56D
.incbin "baserom.gba", 0x3FD56D, 0x5
gUnknown_83FD572:: @ 83FD572
.incbin "baserom.gba", 0x3FD572, 0x4
gUnknown_83FD576:: @ 83FD576
.incbin "baserom.gba", 0x3FD576, 0x5
gUnknown_83FD57B:: @ 83FD57B
.incbin "baserom.gba", 0x3FD57B, 0xB
gUnknown_83FD586:: @ 83FD586
.incbin "baserom.gba", 0x3FD586, 0x2
gUnknown_83FD588:: @ 83FD588
.incbin "baserom.gba", 0x3FD588, 0x2
gUnknown_83FD58A:: @ 83FD58A
.incbin "baserom.gba", 0x3FD58A, 0x2
gUnknown_83FD58C:: @ 83FD58C
.incbin "baserom.gba", 0x3FD58C, 0x2
gUnknown_83FD58E:: @ 83FD58E
.incbin "baserom.gba", 0x3FD58E, 0x42
gUnknown_83FD5D0:: @ 83FD5D0
.incbin "baserom.gba", 0x3FD5D0, 0x6C
gUnknown_83FD63C:: @ 83FD63C
.incbin "baserom.gba", 0x3FD63C, 0x1DE
gUnknown_83FD81A:: @ 83FD81A
.incbin "baserom.gba", 0x3FD81A, 0xA
gUnknown_83FD824:: @ 83FD824
.incbin "baserom.gba", 0x3FD824, 0x7E
gUnknown_83FD8A2:: @ 83FD8A2
.incbin "baserom.gba", 0x3FD8A2, 0xD
gUnknown_83FD8AF:: @ 83FD8AF
.incbin "baserom.gba", 0x3FD8AF, 0x19D
gUnknown_83FDA4C:: @ 83FDA4C
.incbin "baserom.gba", 0x3FDA4C, 0x96
gUnknown_83FDAE2:: @ 83FDAE2
.incbin "baserom.gba", 0x3FDAE2, 0xB0
gUnknown_83FDB92:: @ 83FDB92
.incbin "baserom.gba", 0x3FDB92, 0x5D
gUnknown_83FDBEF:: @ 83FDBEF
.incbin "baserom.gba", 0x3FDBEF, 0x69
gUnknown_83FDC58:: @ 83FDC58
.incbin "baserom.gba", 0x3FDC58, 0x3D
gUnknown_83FDC95:: @ 83FDC95
.incbin "baserom.gba", 0x3FDC95, 0x3D
gUnknown_83FDCD2:: @ 83FDCD2
.incbin "baserom.gba", 0x3FDCD2, 0x51
gUnknown_83FDD23:: @ 83FDD23
.incbin "baserom.gba", 0x3FDD23, 0x41
gUnknown_83FDD64:: @ 83FDD64
.incbin "baserom.gba", 0x3FDD64, 0x87
gUnknown_83FDDEB:: @ 83FDDEB
.incbin "baserom.gba", 0x3FDDEB, 0x151
gUnknown_83FDF3C:: @ 83FDF3C
.incbin "baserom.gba", 0x3FDF3C, 0x5D8
gUnknown_83FE514:: @ 83FE514
.incbin "baserom.gba", 0x3FE514, 0x150
gUnknown_83FE664:: @ 83FE664
.incbin "baserom.gba", 0x3FE664, 0xE
gUnknown_83FE672:: @ 83FE672
.incbin "baserom.gba", 0x3FE672, 0x16
gUnknown_83FE688:: @ 83FE688
.incbin "baserom.gba", 0x3FE688, 0x2D
gUnknown_83FE6B5:: @ 83FE6B5
.incbin "baserom.gba", 0x3FE6B5, 0x1B
gUnknown_83FE6D0:: @ 83FE6D0
.incbin "baserom.gba", 0x3FE6D0, 0x5
gUnknown_83FE6D5:: @ 83FE6D5
.incbin "baserom.gba", 0x3FE6D5, 0x11
gUnknown_83FE6E6:: @ 83FE6E6
.incbin "baserom.gba", 0x3FE6E6, 0x14
gUnknown_83FE6FA:: @ 83FE6FA
.incbin "baserom.gba", 0x3FE6FA, 0x1A
gUnknown_83FE714:: @ 83FE714
.incbin "baserom.gba", 0x3FE714, 0x11
gUnknown_83FE725:: @ 83FE725
.incbin "baserom.gba", 0x3FE725, 0x22
gUnknown_83FE747:: @ 83FE747
.incbin "baserom.gba", 0x3FE747, 0x1F
gUnknown_83FE766:: @ 83FE766
.incbin "baserom.gba", 0x3FE766, 0x4
gUnknown_83FE76A:: @ 83FE76A
.incbin "baserom.gba", 0x3FE76A, 0x6
gUnknown_83FE770:: @ 83FE770
.incbin "baserom.gba", 0x3FE770, 0x21
gUnknown_83FE791:: @ 83FE791
.incbin "baserom.gba", 0x3FE791, 0xF
gUnknown_83FE7A0:: @ 83FE7A0
.incbin "baserom.gba", 0x3FE7A0, 0x6C
gUnknown_83FE80C:: @ 83FE80C
.incbin "baserom.gba", 0x3FE80C, 0x10
gUnknown_83FE81C:: @ 83FE81C
.incbin "baserom.gba", 0x3FE81C, 0x3D
gUnknown_83FE859:: @ 83FE859
.incbin "baserom.gba", 0x3FE859, 0x3
gUnknown_83FE85C:: @ 83FE85C
.incbin "baserom.gba", 0x3FE85C, 0x2
gUnknown_83FE85E:: @ 83FE85E
.incbin "baserom.gba", 0x3FE85E, 0x2
gUnknown_83FE860:: @ 83FE860
.incbin "baserom.gba", 0x3FE860, 0x4
gUnknown_83FE864:: @ 83FE864
.incbin "baserom.gba", 0x3FE864, 0x4
gText_BadEgg:: @ 83FE868
.incbin "baserom.gba", 0x3FE868, 0xC
gUnknown_83FE874:: @ 83FE874
.incbin "baserom.gba", 0x3FE874, 0x7
gUnknown_83FE87B:: @ 83FE87B
.incbin "baserom.gba", 0x3FE87B, 0x8
gUnknown_83FE883:: @ 83FE883
.incbin "baserom.gba", 0x3FE883, 0x8
gUnknown_83FE88B:: @ 83FE88B
.incbin "baserom.gba", 0x3FE88B, 0x4
gUnknown_83FE88F:: @ 83FE88F
.incbin "baserom.gba", 0x3FE88F, 0xF3
gUnknown_83FE982:: @ 83FE982
.incbin "baserom.gba", 0x3FE982, 0x16
gUnknown_83FE998:: @ 83FE998
.incbin "baserom.gba", 0x3FE998, 0x2C
gUnknown_83FE9C4:: @ 83FE9C4
.incbin "baserom.gba", 0x3FE9C4, 0x10
gUnknown_83FE9D4:: @ 83FE9D4
.incbin "baserom.gba", 0x3FE9D4, 0x10
gUnknown_83FE9E4:: @ 83FE9E4
.incbin "baserom.gba", 0x3FE9E4, 0x1B
gUnknown_83FE9FF:: @ 83FE9FF
.incbin "baserom.gba", 0x3FE9FF, 0x29
gUnknown_83FEA28:: @ 83FEA28
.incbin "baserom.gba", 0x3FEA28, 0x48
gUnknown_83FEA70:: @ 83FEA70
.incbin "baserom.gba", 0x3FEA70, 0xEC
gUnknown_83FEB5C:: @ 83FEB5C
.incbin "baserom.gba", 0x3FEB5C, 0x8
gUnknown_83FEB64:: @ 83FEB64
.incbin "baserom.gba", 0x3FEB64, 0x12C
gUnknown_83FEC90:: @ 83FEC90
.incbin "baserom.gba", 0x3FEC90, 0x4

File diff suppressed because it is too large Load Diff

689
data/data_8468C98.s Normal file
View File

@ -0,0 +1,689 @@
.section .rodata
.align 2
gUnknown_8468C98:: @ 8468C98
.incbin "baserom.gba", 0x468C98, 0x520
gUnknown_84691B8:: @ 84691B8
.incbin "baserom.gba", 0x4691B8, 0x20
gUnknown_84691D8:: @ 84691D8
.incbin "baserom.gba", 0x4691D8, 0x800
gUnknown_84699D8:: @ 84699D8
.incbin "baserom.gba", 0x4699D8, 0x1520
gUnknown_846AEF8:: @ 846AEF8
.incbin "baserom.gba", 0x46AEF8, 0x4
gUnknown_846AEFC:: @ 846AEFC
.incbin "baserom.gba", 0x46AEFC, 0x2C
gUnknown_846AF28:: @ 846AF28
.incbin "baserom.gba", 0x46AF28, 0x38
gUnknown_846AF60:: @ 846AF60
.incbin "baserom.gba", 0x46AF60, 0x18
gUnknown_846AF78:: @ 846AF78
.incbin "baserom.gba", 0x46AF78, 0x18
gUnknown_846AF90:: @ 846AF90
.incbin "baserom.gba", 0x46AF90, 0x40
gUnknown_846AFD0:: @ 846AFD0
.incbin "baserom.gba", 0x46AFD0, 0x45C
gUnknown_846B42C:: @ 846B42C
.incbin "baserom.gba", 0x46B42C, 0x10
gUnknown_846B43C:: @ 846B43C
.incbin "baserom.gba", 0x46B43C, 0x58
gUnknown_846B494:: @ 846B494
.incbin "baserom.gba", 0x46B494, 0x18
gUnknown_846B4AC:: @ 846B4AC
.incbin "baserom.gba", 0x46B4AC, 0x10
gUnknown_846B4BC:: @ 846B4BC
.incbin "baserom.gba", 0x46B4BC, 0x190
gUnknown_846B64C:: @ 846B64C
.incbin "baserom.gba", 0x46B64C, 0x24
gUnknown_846B670:: @ 846B670
.incbin "baserom.gba", 0x46B670, 0x24
gUnknown_846B694:: @ 846B694
.incbin "baserom.gba", 0x46B694, 0x10
gUnknown_846B6A4:: @ 846B6A4
.incbin "baserom.gba", 0x46B6A4, 0x8
gUnknown_846B6AC:: @ 846B6AC
.incbin "baserom.gba", 0x46B6AC, 0x8
gUnknown_846B6B4:: @ 846B6B4
.incbin "baserom.gba", 0x46B6B4, 0x90
gUnknown_846B744:: @ 846B744
.incbin "baserom.gba", 0x46B744, 0x18
gUnknown_846B75C:: @ 846B75C
.incbin "baserom.gba", 0x46B75C, 0x10
gUnknown_846B76C:: @ 846B76C
.incbin "baserom.gba", 0x46B76C, 0x28
gUnknown_846B794:: @ 846B794
.incbin "baserom.gba", 0x46B794, 0x20
gUnknown_846B7B4:: @ 846B7B4
.incbin "baserom.gba", 0x46B7B4, 0x20
gUnknown_846B7D4:: @ 846B7D4
.incbin "baserom.gba", 0x46B7D4, 0x22C
gUnknown_846BA00:: @ 846BA00
.incbin "baserom.gba", 0x46BA00, 0x1B0
gUnknown_846BBB0:: @ 846BBB0
.incbin "baserom.gba", 0x46BBB0, 0x20
gUnknown_846BBD0:: @ 846BBD0
.incbin "baserom.gba", 0x46BBD0, 0x950
gUnknown_846C520:: @ 846C520
.incbin "baserom.gba", 0x46C520, 0x3B8
gUnknown_846C8D8:: @ 846C8D8
.incbin "baserom.gba", 0x46C8D8, 0x20
gUnknown_846C8F8:: @ 846C8F8
.incbin "baserom.gba", 0x46C8F8, 0xAB0
gUnknown_846D3A8:: @ 846D3A8
.incbin "baserom.gba", 0x46D3A8, 0x52C
gUnknown_846D8D4:: @ 846D8D4
.incbin "baserom.gba", 0x46D8D4, 0x10
gUnknown_846D8E4:: @ 846D8E4
.incbin "baserom.gba", 0x46D8E4, 0x18
gUnknown_846D8FC:: @ 846D8FC
.incbin "baserom.gba", 0x46D8FC, 0x50
gUnknown_846D94C:: @ 846D94C
.incbin "baserom.gba", 0x46D94C, 0x4
gUnknown_846D950:: @ 846D950
.incbin "baserom.gba", 0x46D950, 0x3
gUnknown_846D953:: @ 846D953
.incbin "baserom.gba", 0x46D953, 0xD
gUnknown_846D960:: @ 846D960
.incbin "baserom.gba", 0x46D960, 0x8
gUnknown_846D968:: @ 846D968
.incbin "baserom.gba", 0x46D968, 0x40
gUnknown_846D9A8:: @ 846D9A8
.incbin "baserom.gba", 0x46D9A8, 0x2C
gUnknown_846D9D4:: @ 846D9D4
.incbin "baserom.gba", 0x46D9D4, 0x6DC
gUnknown_846E0B0:: @ 846E0B0
.incbin "baserom.gba", 0x46E0B0, 0x28
gUnknown_846E0D8:: @ 846E0D8
.incbin "baserom.gba", 0x46E0D8, 0x10
gUnknown_846E0E8:: @ 846E0E8
.incbin "baserom.gba", 0x46E0E8, 0x18
gUnknown_846E100:: @ 846E100
.incbin "baserom.gba", 0x46E100, 0x50
gUnknown_846E150:: @ 846E150
.incbin "baserom.gba", 0x46E150, 0x10
gUnknown_846E160:: @ 846E160
.incbin "baserom.gba", 0x46E160, 0x154
gUnknown_846E2B4:: @ 846E2B4
.incbin "baserom.gba", 0x46E2B4, 0x18
gUnknown_846E2CC:: @ 846E2CC
.incbin "baserom.gba", 0x46E2CC, 0x8
gUnknown_846E2D4:: @ 846E2D4
.incbin "baserom.gba", 0x46E2D4, 0xC
gUnknown_846E2E0:: @ 846E2E0
.incbin "baserom.gba", 0x46E2E0, 0x8
gUnknown_846E2E8:: @ 846E2E8
.incbin "baserom.gba", 0x46E2E8, 0x8
gUnknown_846E2F0:: @ 846E2F0
.incbin "baserom.gba", 0x46E2F0, 0x24
gUnknown_846E314:: @ 846E314
.incbin "baserom.gba", 0x46E314, 0x14
gUnknown_846E328:: @ 846E328
.incbin "baserom.gba", 0x46E328, 0x24
gUnknown_846E34C:: @ 846E34C
.incbin "baserom.gba", 0x46E34C, 0x68
gUnknown_846E3B4:: @ 846E3B4
.incbin "baserom.gba", 0x46E3B4, 0x10
gUnknown_846E3C4:: @ 846E3C4
.incbin "baserom.gba", 0x46E3C4, 0x4
gUnknown_846E3C8:: @ 846E3C8
.incbin "baserom.gba", 0x46E3C8, 0x4
gUnknown_846E3CC:: @ 846E3CC
.incbin "baserom.gba", 0x46E3CC, 0x4
gUnknown_846E3D0:: @ 846E3D0
.incbin "baserom.gba", 0x46E3D0, 0xC
gUnknown_846E3DC:: @ 846E3DC
.incbin "baserom.gba", 0x46E3DC, 0x3
gUnknown_846E3DF:: @ 846E3DF
.incbin "baserom.gba", 0x46E3DF, 0x3
gUnknown_846E3E2:: @ 846E3E2
.incbin "baserom.gba", 0x46E3E2, 0x3
gUnknown_846E3E5:: @ 846E3E5
.incbin "baserom.gba", 0x46E3E5, 0x6
gUnknown_846E3EB:: @ 846E3EB
.incbin "baserom.gba", 0x46E3EB, 0x5
gUnknown_846E3F0:: @ 846E3F0
.incbin "baserom.gba", 0x46E3F0, 0x8
gUnknown_846E3F8:: @ 846E3F8
.incbin "baserom.gba", 0x46E3F8, 0x50
gUnknown_846E448:: @ 846E448
.incbin "baserom.gba", 0x46E448, 0x8
gUnknown_846E450:: @ 846E450
.incbin "baserom.gba", 0x46E450, 0x940
gUnknown_846ED90:: @ 846ED90
.incbin "baserom.gba", 0x46ED90, 0x130
gUnknown_846EEC0:: @ 846EEC0
.incbin "baserom.gba", 0x46EEC0, 0x198
gUnknown_846F058:: @ 846F058
.incbin "baserom.gba", 0x46F058, 0x228
gUnknown_846F280:: @ 846F280
.incbin "baserom.gba", 0x46F280, 0x14
gUnknown_846F294:: @ 846F294
.incbin "baserom.gba", 0x46F294, 0x3C
gUnknown_846F2D0:: @ 846F2D0
.incbin "baserom.gba", 0x46F2D0, 0x1
gUnknown_846F2D1:: @ 846F2D1
.incbin "baserom.gba", 0x46F2D1, 0x5
gUnknown_846F2D6:: @ 846F2D6
.incbin "baserom.gba", 0x46F2D6, 0x1
gUnknown_846F2D7:: @ 846F2D7
.incbin "baserom.gba", 0x46F2D7, 0x15
gUnknown_846F2EC:: @ 846F2EC
.incbin "baserom.gba", 0x46F2EC, 0xC
gUnknown_846F2F8:: @ 846F2F8
.incbin "baserom.gba", 0x46F2F8, 0x28
gUnknown_846F320:: @ 846F320
.incbin "baserom.gba", 0x46F320, 0xF0
gUnknown_846F410:: @ 846F410
.incbin "baserom.gba", 0x46F410, 0x18
gUnknown_846F428:: @ 846F428
.incbin "baserom.gba", 0x46F428, 0x18
gUnknown_846F440:: @ 846F440
.incbin "baserom.gba", 0x46F440, 0x18
gUnknown_846F458:: @ 846F458
.incbin "baserom.gba", 0x46F458, 0x18
gUnknown_846F470:: @ 846F470
.incbin "baserom.gba", 0x46F470, 0x18
gUnknown_846F488:: @ 846F488
.incbin "baserom.gba", 0x46F488, 0x30
gUnknown_846F4B8:: @ 846F4B8
.incbin "baserom.gba", 0x46F4B8, 0x18
gUnknown_846F4D0:: @ 846F4D0
.incbin "baserom.gba", 0x46F4D0, 0x200
gUnknown_846F6D0:: @ 846F6D0
.incbin "baserom.gba", 0x46F6D0, 0x210
gUnknown_846F8E0:: @ 846F8E0
.incbin "baserom.gba", 0x46F8E0, 0x194
gUnknown_846FA74:: @ 846FA74
.incbin "baserom.gba", 0x46FA74, 0x8
gUnknown_846FA7C:: @ 846FA7C
.incbin "baserom.gba", 0x46FA7C, 0x30
gUnknown_846FAAC:: @ 846FAAC
.incbin "baserom.gba", 0x46FAAC, 0x14
gUnknown_846FAC0:: @ 846FAC0
.incbin "baserom.gba", 0x46FAC0, 0x48
gUnknown_846FB08:: @ 846FB08
.incbin "baserom.gba", 0x46FB08, 0x4
gUnknown_846FB0C:: @ 846FB0C
.incbin "baserom.gba", 0x46FB0C, 0x1000
gUnknown_8470B0C:: @ 8470B0C
.incbin "baserom.gba", 0x470B0C, 0xF40
gUnknown_8471A4C:: @ 8471A4C
.incbin "baserom.gba", 0x471A4C, 0x120
gUnknown_8471B6C:: @ 8471B6C
.incbin "baserom.gba", 0x471B6C, 0x280
gUnknown_8471DEC:: @ 8471DEC
.incbin "baserom.gba", 0x471DEC, 0xA0
gUnknown_8471E8C:: @ 8471E8C
.incbin "baserom.gba", 0x471E8C, 0x50
gUnknown_8471EDC:: @ 8471EDC
.incbin "baserom.gba", 0x471EDC, 0x74
gUnknown_8471F50:: @ 8471F50
.incbin "baserom.gba", 0x471F50, 0x113
gUnknown_8472063:: @ 8472063
.incbin "baserom.gba", 0x472063, 0x4B
gUnknown_84720AE:: @ 84720AE
.incbin "baserom.gba", 0x4720AE, 0x4E
gUnknown_84720FC:: @ 84720FC
.incbin "baserom.gba", 0x4720FC, 0x37
gUnknown_8472133:: @ 8472133
.incbin "baserom.gba", 0x472133, 0x3409
gUnknown_847553C:: @ 847553C
.incbin "baserom.gba", 0x47553C, 0xC
gUnknown_8475548:: @ 8475548
.incbin "baserom.gba", 0x475548, 0x8
gUnknown_8475550:: @ 8475550
.incbin "baserom.gba", 0x475550, 0x8
gUnknown_8475558:: @ 8475558
.incbin "baserom.gba", 0x475558, 0x20
gUnknown_8475578:: @ 8475578
.incbin "baserom.gba", 0x475578, 0x30
gUnknown_84755A8:: @ 84755A8
.incbin "baserom.gba", 0x4755A8, 0x30
gUnknown_84755D8:: @ 84755D8
.incbin "baserom.gba", 0x4755D8, 0x8
gUnknown_84755E0:: @ 84755E0
.incbin "baserom.gba", 0x4755E0, 0x8
gUnknown_84755E8:: @ 84755E8
.incbin "baserom.gba", 0x4755E8, 0x10
gUnknown_84755F8:: @ 84755F8
.incbin "baserom.gba", 0x4755F8, 0x4
gUnknown_84755FC:: @ 84755FC
.incbin "baserom.gba", 0x4755FC, 0x6
gUnknown_8475602:: @ 8475602
.incbin "baserom.gba", 0x475602, 0x6
gUnknown_8475608:: @ 8475608
.incbin "baserom.gba", 0x475608, 0x40
gUnknown_8475648:: @ 8475648
.incbin "baserom.gba", 0x475648, 0x14
gUnknown_847565C:: @ 847565C
.incbin "baserom.gba", 0x47565C, 0x18
gUnknown_8475674:: @ 8475674
.incbin "baserom.gba", 0x475674, 0x10
gUnknown_8475684:: @ 8475684
.incbin "baserom.gba", 0x475684, 0x8
gUnknown_847568C:: @ 847568C
.incbin "baserom.gba", 0x47568C, 0x10
gUnknown_847569C:: @ 847569C
.incbin "baserom.gba", 0x47569C, 0x8
gUnknown_84756A4:: @ 84756A4
.incbin "baserom.gba", 0x4756A4, 0x204
gUnknown_84758A8:: @ 84758A8
.incbin "baserom.gba", 0x4758A8, 0xC0
gUnknown_8475968:: @ 8475968
.incbin "baserom.gba", 0x475968, 0x1D4
gUnknown_8475B3C:: @ 8475B3C
.incbin "baserom.gba", 0x475B3C, 0x890
gUnknown_84763CC:: @ 84763CC
.incbin "baserom.gba", 0x4763CC, 0xDCC
gUnknown_8477198:: @ 8477198
.incbin "baserom.gba", 0x477198, 0x94
gUnknown_847722C:: @ 847722C
.incbin "baserom.gba", 0x47722C, 0x148
gUnknown_8477374:: @ 8477374
.incbin "baserom.gba", 0x477374, 0x121C
gUnknown_8478590:: @ 8478590
.incbin "baserom.gba", 0x478590, 0x26C
gUnknown_84787FC:: @ 84787FC
.incbin "baserom.gba", 0x4787FC, 0x250
gUnknown_8478A4C:: @ 8478A4C
.incbin "baserom.gba", 0x478A4C, 0x24C
gUnknown_8478C98:: @ 8478C98
.incbin "baserom.gba", 0x478C98, 0x48
gUnknown_8478CE0:: @ 8478CE0
.incbin "baserom.gba", 0x478CE0, 0xB0
gUnknown_8478D90:: @ 8478D90
.incbin "baserom.gba", 0x478D90, 0x8
gUnknown_8478D98:: @ 8478D98
.incbin "baserom.gba", 0x478D98, 0x8
gUnknown_8478DA0:: @ 8478DA0
.incbin "baserom.gba", 0x478DA0, 0x8
gUnknown_8478DA8:: @ 8478DA8
.incbin "baserom.gba", 0x478DA8, 0x24
gUnknown_8478DCC:: @ 8478DCC
.incbin "baserom.gba", 0x478DCC, 0x8
gUnknown_8478DD4:: @ 8478DD4
.incbin "baserom.gba", 0x478DD4, 0x8
gUnknown_8478DDC:: @ 8478DDC
.incbin "baserom.gba", 0x478DDC, 0x18
gUnknown_8478DF4:: @ 8478DF4
.incbin "baserom.gba", 0x478DF4, 0x18
gUnknown_8478E0C:: @ 8478E0C
.incbin "baserom.gba", 0x478E0C, 0x2
gUnknown_8478E0E:: @ 8478E0E
.incbin "baserom.gba", 0x478E0E, 0xA
gUnknown_8478E18:: @ 8478E18
.incbin "baserom.gba", 0x478E18, 0x8
gUnknown_8478E20:: @ 8478E20
.incbin "baserom.gba", 0x478E20, 0x18
gUnknown_8478E38:: @ 8478E38
.incbin "baserom.gba", 0x478E38, 0x3
gUnknown_8478E3B:: @ 8478E3B
.incbin "baserom.gba", 0x478E3B, 0x45
gUnknown_8478E80:: @ 8478E80
.incbin "baserom.gba", 0x478E80, 0x14
gUnknown_8478E94:: @ 8478E94
.incbin "baserom.gba", 0x478E94, 0x14
gUnknown_8478EA8:: @ 8478EA8
.incbin "baserom.gba", 0x478EA8, 0x8
gUnknown_8478EB0:: @ 8478EB0
.incbin "baserom.gba", 0x478EB0, 0xA
gUnknown_8478EBA:: @ 8478EBA
.incbin "baserom.gba", 0x478EBA, 0xA
gUnknown_8478EC4:: @ 8478EC4
.incbin "baserom.gba", 0x478EC4, 0x50
gUnknown_8478F14:: @ 8478F14
.incbin "baserom.gba", 0x478F14, 0x8
gUnknown_8478F1C:: @ 8478F1C
.incbin "baserom.gba", 0x478F1C, 0x144
gUnknown_8479060:: @ 8479060
.incbin "baserom.gba", 0x479060, 0x78
gUnknown_84790D8:: @ 84790D8
.incbin "baserom.gba", 0x4790D8, 0xC0
gUnknown_8479198:: @ 8479198
.incbin "baserom.gba", 0x479198, 0x10
gUnknown_84791A8:: @ 84791A8
.incbin "baserom.gba", 0x4791A8, 0x10
gUnknown_84791B8:: @ 84791B8
.incbin "baserom.gba", 0x4791B8, 0x14
gUnknown_84791CC:: @ 84791CC
.incbin "baserom.gba", 0x4791CC, 0x1C
gUnknown_84791E8:: @ 84791E8
.incbin "baserom.gba", 0x4791E8, 0xE8
gUnknown_84792D0:: @ 84792D0
.incbin "baserom.gba", 0x4792D0, 0x10
gUnknown_84792E0:: @ 84792E0
.incbin "baserom.gba", 0x4792E0, 0x10
gUnknown_84792F0:: @ 84792F0
.incbin "baserom.gba", 0x4792F0, 0x50
gUnknown_8479340:: @ 8479340
.incbin "baserom.gba", 0x479340, 0x28
gUnknown_8479368:: @ 8479368
.incbin "baserom.gba", 0x479368, 0x18
gUnknown_8479380:: @ 8479380
.incbin "baserom.gba", 0x479380, 0x10
gUnknown_8479390:: @ 8479390
.incbin "baserom.gba", 0x479390, 0x1B8
gUnknown_8479548:: @ 8479548
.incbin "baserom.gba", 0x479548, 0x18
gUnknown_8479560:: @ 8479560
.incbin "baserom.gba", 0x479560, 0x18
gUnknown_8479578:: @ 8479578
.incbin "baserom.gba", 0x479578, 0x18
gUnknown_8479590:: @ 8479590
.incbin "baserom.gba", 0x479590, 0x28
gUnknown_84795B8:: @ 84795B8
.incbin "baserom.gba", 0x4795B8, 0x10
gUnknown_84795C8:: @ 84795C8
.incbin "baserom.gba", 0x4795C8, 0x90
gUnknown_8479658:: @ 8479658
.incbin "baserom.gba", 0x479658, 0x600
gUnknown_8479C58:: @ 8479C58
.incbin "baserom.gba", 0x479C58, 0x30
gUnknown_8479C88:: @ 8479C88
.incbin "baserom.gba", 0x479C88, 0x38
gUnknown_8479CC0:: @ 8479CC0
.incbin "baserom.gba", 0x479CC0, 0x18
.align 2
gUnknown_8479CD8:: @ 8479CD8
.asciz "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/cereader_tool.c"
.align 2
gUnknown_8479D10:: @ 8479D10
.asciz "ttdata->dummy == 0"
.align 2
gUnknown_8479D24:: @ 8479D24
.asciz "ttdata->id == 0"
gUnknown_8479D34:: @ 8479D34
.incbin "baserom.gba", 0x479D34, 0x4
gUnknown_8479D38:: @ 8479D38
.incbin "baserom.gba", 0x479D38, 0x8
gUnknown_8479D40:: @ 8479D40
.incbin "baserom.gba", 0x479D40, 0x8
gUnknown_8479D48:: @ 8479D48
.incbin "baserom.gba", 0x479D48, 0x190
gUnknown_8479ED8:: @ 8479ED8
.incbin "baserom.gba", 0x479ED8, 0x14C
gUnknown_847A024:: @ 847A024
.incbin "baserom.gba", 0x47A024, 0x50
gUnknown_847A074:: @ 847A074
.incbin "baserom.gba", 0x47A074, 0x1A4
gUnknown_847A218:: @ 847A218
.incbin "baserom.gba", 0x47A218, 0x14
gUnknown_847A22C:: @ 847A22C
.incbin "baserom.gba", 0x47A22C, 0x4
gUnknown_847A230:: @ 847A230
.incbin "baserom.gba", 0x47A230, 0x54
gUnknown_847A284:: @ 847A284
.incbin "baserom.gba", 0x47A284, 0x30
gUnknown_847A2B4:: @ 847A2B4
.incbin "baserom.gba", 0x47A2B4, 0x1E
gUnknown_847A2D2:: @ 847A2D2
.incbin "baserom.gba", 0x47A2D2, 0x1C
gUnknown_847A2EE:: @ 847A2EE
.incbin "baserom.gba", 0x47A2EE, 0x10
gUnknown_847A2FE:: @ 847A2FE
.incbin "baserom.gba", 0x47A2FE, 0x10
gUnknown_847A30E:: @ 847A30E
.incbin "baserom.gba", 0x47A30E, 0x48E
gUnknown_847A79C:: @ 847A79C
.incbin "baserom.gba", 0x47A79C, 0x8
gUnknown_847A7A4:: @ 847A7A4
.incbin "baserom.gba", 0x47A7A4, 0xBC
gUnknown_847A860:: @ 847A860
.incbin "baserom.gba", 0x47A860, 0x18
gUnknown_847A878:: @ 847A878
.incbin "baserom.gba", 0x47A878, 0x18
gUnknown_847A890:: @ 847A890
.incbin "baserom.gba", 0x47A890, 0x7F1C
gUnknown_84827AC:: @ 84827AC
.incbin "baserom.gba", 0x4827AC, 0x8
gUnknown_84827B4:: @ 84827B4
.incbin "baserom.gba", 0x4827B4, 0x5F34
gUnknown_84886E8:: @ 84886E8
.incbin "baserom.gba", 0x4886E8, 0x588
gUnknown_8488C70:: @ 8488C70
.incbin "baserom.gba", 0x488C70, 0x32
gUnknown_8488CA2:: @ 8488CA2
.incbin "baserom.gba", 0x488CA2, 0x2C
gUnknown_8488CCE:: @ 8488CCE
.incbin "baserom.gba", 0x488CCE, 0x28
gUnknown_8488CF6:: @ 8488CF6
.incbin "baserom.gba", 0x488CF6, 0x34
gUnknown_8488D2A:: @ 8488D2A
.incbin "baserom.gba", 0x488D2A, 0x36
gUnknown_8488D60:: @ 8488D60
.incbin "baserom.gba", 0x488D60, 0x1C
gUnknown_8488D7C:: @ 8488D7C
.incbin "baserom.gba", 0x488D7C, 0x12
gUnknown_8488D8E:: @ 8488D8E
.incbin "baserom.gba", 0x488D8E, 0x2F
gUnknown_8488DBD:: @ 8488DBD
.incbin "baserom.gba", 0x488DBD, 0x40
gUnknown_8488DFD:: @ 8488DFD
.incbin "baserom.gba", 0x488DFD, 0xB6B

View File

@ -0,0 +1,107 @@
.string "{PKMN} TRAINER$", 13
.string "{PKMN} TRAINER$", 13
.string "AQUA LEADER$", 13
.string "TEAM AQUA$", 13
.string "AROMA LADY$", 13
.string "RUIN MANIAC$", 13
.string "INTERVIEWER$", 13
.string "TUBER$", 13
.string "TUBER$", 13
.string "COOLTRAINER$", 13
.string "HEX MANIAC$", 13
.string "LADY$", 13
.string "BEAUTY$", 13
.string "RICH BOY$", 13
.string "POKéMANIAC$", 13
.string "SWIMMER♂$", 13
.string "BLACK BELT$", 13
.string "GUITARIST$", 13
.string "KINDLER$", 13
.string "CAMPER$", 13
.string "BUG MANIAC$", 13
.string "PSYCHIC$", 13
.string "GENTLEMAN$", 13
.string "ELITE FOUR$", 13
.string "LEADER$", 13
.string "SCHOOL KID$", 13
.string "SR. AND JR.$", 13
.string "POKéFAN$", 13
.string "EXPERT$", 13
.string "YOUNGSTER$", 13
.string "CHAMPION$", 13
.string "FISHERMAN$", 13
.string "TRIATHLETE$", 13
.string "DRAGON TAMER$", 13
.string "BIRD KEEPER$", 13
.string "NINJA BOY$", 13
.string "BATTLE GIRL$", 13
.string "PARASOL LADY$", 13
.string "SWIMMER♀$", 13
.string "PICNICKER$", 13
.string "TWINS$", 13
.string "SAILOR$", 13
.string "BOARDER$", 13
.string "COLLECTOR$", 13
.string "{PKMN} TRAINER$", 13
.string "{PKMN} BREEDER$", 13
.string "{PKMN} RANGER$", 13
.string "MAGMA LEADER$", 13
.string "TEAM MAGMA$", 13
.string "LASS$", 13
.string "BUG CATCHER$", 13
.string "HIKER$", 13
.string "YOUNG COUPLE$", 13
.string "OLD COUPLE$", 13
.string "SIS AND BRO$", 13
.string "AQUA ADMIN$", 13
.string "MAGMA ADMIN$", 13
.string "YOUNGSTER$", 13
.string "BUG CATCHER$", 13
.string "LASS$", 13
.string "SAILOR$", 13
.string "CAMPER$", 13
.string "PICNICKER$", 13
.string "POKéMANIAC$", 13
.string "SUPER NERD$", 13
.string "HIKER$", 13
.string "BIKER$", 13
.string "BURGLAR$", 13
.string "ENGINEER$", 13
.string "FISHERMAN$", 13
.string "SWIMMER♂$", 13
.string "CUE BALL$", 13
.string "GAMER$", 13
.string "BEAUTY$", 13
.string "SWIMMER♀$", 13
.string "PSYCHIC$", 13
.string "ROCKER$", 13
.string "JUGGLER$", 13
.string "TAMER$", 13
.string "BIRD KEEPER$", 13
.string "BLACK BELT$", 13
.string "RIVAL$", 13
.string "SCIENTIST$", 13
.string "BOSS$", 13
.string "LEADER$", 13
.string "TEAM ROCKET$", 13
.string "COOLTRAINER$", 13
.string "ELITE FOUR$", 13
.string "GENTLEMAN$", 13
.string "RIVAL$", 13
.string "CHAMPION$", 13
.string "CHANNELER$", 13
.string "TWINS$", 13
.string "COOL COUPLE$", 13
.string "YOUNG COUPLE$", 13
.string "CRUSH KIN$", 13
.string "SIS AND BRO$", 13
.string "{PKMN} PROF.$", 13
.string "PLAYER$", 13
.string "CRUSH GIRL$", 13
.string "TUBER$", 13
.string "{PKMN} BREEDER$", 13
.string "{PKMN} RANGER$", 13
.string "AROMA LADY$", 13
.string "RUIN MANIAC$", 13
.string "LADY$", 13
.string "PAINTER$", 13

View File

@ -32,6 +32,9 @@ char* strcpy(char *dst0, const char *src0);
#define POKEMON_NAME_LENGTH 10
#define OT_NAME_LENGTH 7
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) >= (b) ? (a) : (b))
// There are many quirks in the source code which have overarching behavioral differences from
// a number of other files. For example, diploma.c seems to declare rodata before each use while
// other files declare out of order and must be at the beginning. There are also a number of
@ -510,6 +513,7 @@ struct SaveBlock1
/*0x361C*/ struct RamScript ramScript;
/*0x3A08*/ u8 filler3A08[0x44];
/*0x3A4C*/ u8 rivalName[PLAYER_NAME_LENGTH];
/*0x3A54*/ u8 filler3A54[0x314];
};
extern struct SaveBlock1* gSaveBlock1Ptr;

View File

@ -1,11 +1,27 @@
#ifndef GUARD_SAVE_H
#define GUARD_SAVE_H
extern u16 gSaveFileStatus;
#define NUM_SECTORS 32 // defined in agb_flash but not in a header
struct SaveSectionLocation
#define SAVE_STATUS_EMPTY 0
#define SAVE_STATUS_OK 1
#define SAVE_STATUS_INVALID 2
#define SAVE_STATUS_NO_FLASH 4
#define SAVE_STATUS_ERROR 0xFF
enum
{
void *data;
SAVE_NORMAL,
SAVE_LINK,
SAVE_EREADER,
SAVE_HALL_OF_FAME,
SAVE_OVERWRITE_DIFFERENT_FILE,
SAVE_HALL_OF_FAME_ERASE_BEFORE, // unused
};
struct SaveBlockChunk
{
u8 *data;
u16 size;
};
@ -14,7 +30,7 @@ struct SaveSection
u8 data[0xFF4];
u16 id;
u16 checksum;
u32 security;
u32 signature;
u32 counter;
}; // size is 0x1000
@ -22,21 +38,21 @@ struct SaveSection
struct UnkSaveSection
{
u8 data[0xFF4];
u32 security;
u32 signature;
}; // size is 0xFF8
struct SaveSectionOffsets
{
u16 toAdd;
u16 size;
u16 toAdd;
u16 size;
};
// Emerald changes this definition to be the sectors per slot.
#define NUM_SECTORS_PER_SLOT 16 // move to save.h
#define NUM_SECTORS_PER_SAVE_SLOT 14 // Number of sectors occupied by a save slot
#define UNKNOWN_CHECK_VALUE 0x8012025
// SetDamagedSectorBits states
// SetSectorDamagedStatus states
enum
{
ENABLE,
@ -49,49 +65,59 @@ enum
{
NORMAL_SAVE,
LINK_SAVE,
//EREADER_SAVE, // depreciated in Emerald
LINK2_SAVE, // unknown 2nd link save
EREADER_SAVE,
HOF_SAVE,
DIFFERENT_FILE_SAVE,
HOF_DELETE_SAVE // unused
};
#define SECTION_ID_RECORDED_BATTLE 31
extern u16 gFirstSaveSector;
extern u32 gPrevSaveCounter;
extern u16 gLastKnownGoodSector;
extern u32 gDamagedSaveSectors;
extern u32 gSaveCounter;
extern struct SaveSection *gFastSaveSection; // the pointer is in fast IWRAM but may sometimes point to the slower EWRAM.
extern u16 gUnknown_3005398;
extern u16 gSaveUnusedVar;
extern u16 gSaveFileStatus;
extern void (*gGameContinueCallback)(void);
extern struct SaveBlockChunk gRamSaveSectionLocations[0xE];
extern u16 gUnknown_3005420;
extern struct SaveSection gSaveDataBuffer;
void ClearSaveData(void);
void ResetSaveCounters(void);
bool32 SetDamagedSectorBits(u8 op, u8 bit);
u8 save_write_to_flash(u16 a1, const struct SaveSectionLocation *location);
u8 HandleWriteSector(u16 a1, const struct SaveSectionLocation *location);
void Save_ResetSaveCounters(void);
bool32 SetSectorDamagedStatus(u8 op, u8 bit);
u8 save_write_to_flash(u16 a1, const struct SaveBlockChunk *location);
u8 HandleWriteSector(u16 a1, const struct SaveBlockChunk *location);
u8 HandleWriteSectorNBytes(u8 sector, u8 *data, u16 size);
u8 TryWriteSector(u8 sector, u8 *data);
u32 RestoreSaveBackupVarsAndIncrement(const struct SaveSectionLocation *location);
u32 RestoreSaveBackupVars(const struct SaveSectionLocation *location);
u8 sub_81529D4(u16 a1, const struct SaveSectionLocation *location);
u8 sub_8152A34(u16 a1, const struct SaveSectionLocation *location);
u8 ClearSaveData_2(u16 a1, const struct SaveSectionLocation *location);
u8 sav12_xor_get(u16 a1, const struct SaveSectionLocation *location);
u8 sub_8152CAC(u16 a1, const struct SaveSectionLocation *location);
u8 sub_8152D44(u16 a1, const struct SaveSectionLocation *location);
u8 sub_8152DD0(u16 a1, const struct SaveSectionLocation *location);
u8 sub_8152E10(u16 a1, const struct SaveSectionLocation *location);
u8 GetSaveValidStatus(const struct SaveSectionLocation *location);
u8 sub_81530DC(u8 a1, u8 *data, u16 size);
u32 RestoreSaveBackupVarsAndIncrement(const struct SaveBlockChunk *location);
u32 RestoreSaveBackupVars(const struct SaveBlockChunk *location);
u8 sub_80D9AA4(u16 a1, const struct SaveBlockChunk *location);
u8 sub_80D9B04(u16 a1, const struct SaveBlockChunk *location);
u8 ClearSaveData_2(u16 a1, const struct SaveBlockChunk *location);
u8 sav12_xor_get(u16 a1, const struct SaveBlockChunk *location);
u8 sub_80D9D88(u16 a1, const struct SaveBlockChunk *location);
u8 sub_80D9E14(u16 a1, const struct SaveBlockChunk *location);
u8 sub_80D9E54(u16 a1, const struct SaveBlockChunk *location);
u8 GetSaveValidStatus(const struct SaveBlockChunk *location);
u8 sub_80DA120(u8 a1, u8 *data, u16 size);
u8 DoReadFlashWholeSection(u8 sector, struct SaveSection *section);
u16 CalculateChecksum(void *data, u16 size);
void UpdateSaveAddresses(void);
u8 HandleSavingData(u8 saveType);
u8 TrySavingData(u8 saveType);
u8 sub_8153380(void);
bool8 sub_81533AC(void);
u8 sub_81533E0(void);
u8 sub_8153408(void);
u8 sub_8153430(void);
bool8 sub_8153474(void);
u8 sub_81534D0(u8 a1);
u16 sub_815355C(void);
u8 sub_80DA3AC(void);
bool8 sub_80DA3D8(void);
u8 sub_80DA40C(void);
u8 sub_80DA434(void);
u8 sub_80DA45C(void);
bool8 sub_80DA4A0(void);
u8 Save_LoadGameData(u8 a1);
u32 TryCopySpecialSaveSection(u8 sector, u8* dst);
u32 sub_8153634(u8 sector, u8* src);
void sub_8153688(u8 taskId);
u32 sub_80DA5E0(u8 sector, u8* src);
void sub_80DA634(u8 taskId);
#endif // GUARD_SAVE_H

View File

@ -181,7 +181,7 @@ SECTIONS {
asm/math_util.o(.text);
asm/roulette_util.o(.text);
asm/cable_car_util.o(.text);
asm/save.o(.text);
src/save.o(.text);
asm/mystery_event_script.o(.text);
asm/field_effect_helpers.o(.text);
asm/battle_anim_sound_tasks.o(.text);
@ -365,9 +365,11 @@ SECTIONS {
src/string_util.o(.rodata);
data/data.o(.rodata);
src/battle_ai_script_commands.o(.rodata);
data/data_84827AC.o(.rodata);
data/data_83F5738.o(.rodata);
src/save.o(.rodata);
data/data_83FECCC.o(.rodata);
src/menews_jisan.o(.rodata);
data/data_84827AC.o(.rodata.8468C98);
data/data_8468C98.o(.rodata);
src/m4a_tables.o(.rodata);
data/sound_data.o(.rodata);
} =0

919
src/save.c Normal file
View File

@ -0,0 +1,919 @@
#include "global.h"
#include "save.h"
#include "decompress.h"
#include "main.h"
#include "overworld.h"
#include "load_save.h"
#include "task.h"
#include "link.h"
#include "gba/flash_internal.h"
#define FILE_SIGNATURE 0x08012025 // signature value to determine if a sector is in use
#define TOTAL_FLASH_SECTORS 32
// Divide save blocks into individual chunks to be written to flash sectors
// Each 4 KiB flash sector contains 3968 bytes of actual data followed by a 128 byte footer
#define SECTOR_DATA_SIZE 3968
#define SECTOR_FOOTER_SIZE 128
/*
* Sector Layout:
*
* Sectors 0 - 13: Save Slot 1
* Sectors 14 - 27: Save Slot 2
* Sectors 28 - 29: Hall of Fame
* Sector 30: e-Reader/Mystery Gift Stuff (note: e-Reader is deprecated in Emerald US)
* Sector 31: Recorded Battle
*
* There are two save slots for saving the player's game data. We alternate between
* them each time the game is saved, so that if the current save slot is corrupt,
* we can load the previous one. We also rotate the sectors in each save slot
* so that the same data is not always being written to the same sector. This
* might be done to reduce wear on the flash memory, but I'm not sure, since all
* 14 sectors get written anyway.
*/
// (u8 *)structure was removed from the first statement of the macro in Emerald
// and Fire Red/Leaf Green. This is because malloc is used to allocate addresses
// so storing the raw addresses should not be done in the offsets information.
#define SAVEBLOCK_CHUNK(structure, chunkNum) \
{ \
chunkNum * SECTOR_DATA_SIZE, \
min(sizeof(structure) - chunkNum * SECTOR_DATA_SIZE, SECTOR_DATA_SIZE) \
} \
// TODO: use gSaveblock2, gSaveblock1, gPokemonStorage instead of structs
// Will be done when load_save is decompiled.
const struct SaveSectionOffsets gSaveSectionOffsets[] =
{
SAVEBLOCK_CHUNK(struct SaveBlock2, 0),
SAVEBLOCK_CHUNK(struct SaveBlock1, 0),
SAVEBLOCK_CHUNK(struct SaveBlock1, 1),
SAVEBLOCK_CHUNK(struct SaveBlock1, 2),
SAVEBLOCK_CHUNK(struct SaveBlock1, 3),
SAVEBLOCK_CHUNK(struct PokemonStorage, 0),
SAVEBLOCK_CHUNK(struct PokemonStorage, 1),
SAVEBLOCK_CHUNK(struct PokemonStorage, 2),
SAVEBLOCK_CHUNK(struct PokemonStorage, 3),
SAVEBLOCK_CHUNK(struct PokemonStorage, 4),
SAVEBLOCK_CHUNK(struct PokemonStorage, 5),
SAVEBLOCK_CHUNK(struct PokemonStorage, 6),
SAVEBLOCK_CHUNK(struct PokemonStorage, 7),
SAVEBLOCK_CHUNK(struct PokemonStorage, 8)
};
extern void DoSaveFailedScreen(u8 saveType); // save_failed_screen
extern void sub_800AB9C(void); // link
extern bool8 sub_800A4BC(void); // link
extern void sub_80590D8(void); // fieldmap
extern void sub_804C1C0(void); // load_save
extern void sav2_gender2_inplace_and_xFE(void); // load_save
// Sector num to begin writing save data. Sectors are rotated each time the game is saved. (possibly to avoid wear on flash memory?)
u16 gFirstSaveSector;
u32 gPrevSaveCounter;
u16 gLastKnownGoodSector;
u32 gDamagedSaveSectors;
u32 gSaveCounter;
struct SaveSection *gFastSaveSection; // the pointer is in fast IWRAM but may sometimes point to the slower EWRAM.
u16 gUnknown_3005398;
u16 gSaveUnusedVar;
u16 gSaveFileStatus;
void (*gGameContinueCallback)(void);
struct SaveBlockChunk gRamSaveSectionLocations[0xE];
u16 gUnknown_3005420;
EWRAM_DATA struct SaveSection gSaveDataBuffer = {0};
EWRAM_DATA u32 gSaveUnusedVar2 = 0;
void ClearSaveData(void)
{
u16 i;
for (i = 0; i < NUM_SECTORS; i++)
EraseFlashSector(i);
}
void Save_ResetSaveCounters(void)
{
gSaveCounter = 0;
gFirstSaveSector = 0;
gDamagedSaveSectors = 0;
}
bool32 SetSectorDamagedStatus(u8 op, u8 sectorNum)
{
bool32 retVal = FALSE;
switch (op)
{
case ENABLE:
gDamagedSaveSectors |= (1 << sectorNum);
break;
case DISABLE:
gDamagedSaveSectors &= ~(1 << sectorNum);
break;
case CHECK: // unused
if (gDamagedSaveSectors & (1 << sectorNum))
retVal = TRUE;
break;
}
return retVal;
}
// If chunkId is 0xFFFF, this function will write all of the chunks pointed to by 'chunks'.
// Otherwise, it will write a single chunk with the given 'chunkId'.
u8 save_write_to_flash(u16 chunkId, const struct SaveBlockChunk *chunks)
{
u32 retVal;
u16 i;
gFastSaveSection = &gSaveDataBuffer;
if (chunkId != 0xFFFF) // write single chunk
{
retVal = HandleWriteSector(chunkId, chunks);
}
else // write all chunks
{
gLastKnownGoodSector = gFirstSaveSector; // backup the current written sector before attempting to write.
gPrevSaveCounter = gSaveCounter;
gFirstSaveSector++;
gFirstSaveSector %= NUM_SECTORS_PER_SAVE_SLOT; // array count save sector locations
gSaveCounter++;
retVal = SAVE_STATUS_OK;
for (i = 0; i < NUM_SECTORS_PER_SAVE_SLOT; i++)
HandleWriteSector(i, chunks);
// Check for any bad sectors
if (gDamagedSaveSectors != 0) // skip the damaged sector.
{
retVal = SAVE_STATUS_ERROR;
gFirstSaveSector = gLastKnownGoodSector;
gSaveCounter = gPrevSaveCounter;
}
}
return retVal;
}
u8 HandleWriteSector(u16 chunkId, const struct SaveBlockChunk *chunks)
{
u16 i;
u16 sectorNum;
u8 *chunkData;
u16 chunkSize;
// select sector number
sectorNum = chunkId + gFirstSaveSector;
sectorNum %= NUM_SECTORS_PER_SAVE_SLOT;
// select save slot
sectorNum += NUM_SECTORS_PER_SAVE_SLOT * (gSaveCounter % 2);
chunkData = chunks[chunkId].data;
chunkSize = chunks[chunkId].size;
// clear save section.
for (i = 0; i < sizeof(struct SaveSection); i++)
((char *)gFastSaveSection)[i] = 0;
gFastSaveSection->id = chunkId;
gFastSaveSection->signature = FILE_SIGNATURE;
gFastSaveSection->counter = gSaveCounter;
for (i = 0; i < chunkSize; i++)
gFastSaveSection->data[i] = chunkData[i];
gFastSaveSection->checksum = CalculateChecksum(chunkData, chunkSize);
return TryWriteSector(sectorNum, gFastSaveSection->data);
}
u8 HandleWriteSectorNBytes(u8 sector, u8 *data, u16 size)
{
u16 i;
struct SaveSection *section = &gSaveDataBuffer;
for (i = 0; i < sizeof(struct SaveSection); i++)
((char *)section)[i] = 0;
section->signature = FILE_SIGNATURE;
for (i = 0; i < size; i++)
section->data[i] = data[i];
section->id = CalculateChecksum(data, size); // though this appears to be incorrect, it might be some sector checksum instead of a whole save checksum and only appears to be relevent to HOF data, if used.
return TryWriteSector(sector, section->data);
}
u8 TryWriteSector(u8 sectorNum, u8 *data)
{
if (ProgramFlashSectorAndVerify(sectorNum, data) != 0) // is damaged?
{
SetSectorDamagedStatus(ENABLE, sectorNum); // set damaged sector bits.
return SAVE_STATUS_ERROR;
}
else
{
SetSectorDamagedStatus(DISABLE, sectorNum); // unset damaged sector bits. it's safe now.
return SAVE_STATUS_OK;
}
}
u32 RestoreSaveBackupVarsAndIncrement(const struct SaveBlockChunk *chunk) // chunk is unused
{
gFastSaveSection = &gSaveDataBuffer;
gLastKnownGoodSector = gFirstSaveSector;
gPrevSaveCounter = gSaveCounter;
gFirstSaveSector++;
gFirstSaveSector %= NUM_SECTORS_PER_SAVE_SLOT;
gSaveCounter++;
gUnknown_3005398 = 0;
gDamagedSaveSectors = 0;
return 0;
}
u32 RestoreSaveBackupVars(const struct SaveBlockChunk *chunk) // chunk is unused
{
gFastSaveSection = &gSaveDataBuffer;
gLastKnownGoodSector = gFirstSaveSector;
gPrevSaveCounter = gSaveCounter;
gUnknown_3005398 = 0;
gDamagedSaveSectors = 0;
return 0;
}
u8 sub_80D9AA4(u16 a1, const struct SaveBlockChunk *chunk)
{
u8 retVal;
if (gUnknown_3005398 < a1 - 1)
{
retVal = SAVE_STATUS_OK;
HandleWriteSector(gUnknown_3005398, chunk);
gUnknown_3005398++;
if (gDamagedSaveSectors)
{
retVal = SAVE_STATUS_ERROR;
gFirstSaveSector = gLastKnownGoodSector;
gSaveCounter = gPrevSaveCounter;
}
}
else
{
retVal = SAVE_STATUS_ERROR;
}
return retVal;
}
u8 sub_80D9B04(u16 a1, const struct SaveBlockChunk *chunk)
{
u8 retVal = SAVE_STATUS_OK;
ClearSaveData_2(a1 - 1, chunk);
if (gDamagedSaveSectors)
{
retVal = SAVE_STATUS_ERROR;
gFirstSaveSector = gLastKnownGoodSector;
gSaveCounter = gPrevSaveCounter;
}
return retVal;
}
u8 ClearSaveData_2(u16 chunkId, const struct SaveBlockChunk *chunks)
{
u16 i;
u16 sector;
u8 *data;
u16 size;
u8 status;
// select sector number
sector = chunkId + gFirstSaveSector;
sector %= NUM_SECTORS_PER_SAVE_SLOT;
// select save slot
sector += NUM_SECTORS_PER_SAVE_SLOT * (gSaveCounter % 2);
data = chunks[chunkId].data;
size = chunks[chunkId].size;
// clear temp save section.
for (i = 0; i < sizeof(struct SaveSection); i++)
((char *)gFastSaveSection)[i] = 0;
gFastSaveSection->id = chunkId;
gFastSaveSection->signature = FILE_SIGNATURE;
gFastSaveSection->counter = gSaveCounter;
// set temp section's data.
for (i = 0; i < size; i++)
gFastSaveSection->data[i] = data[i];
// calculate checksum.
gFastSaveSection->checksum = CalculateChecksum(data, size);
EraseFlashSector(sector);
status = SAVE_STATUS_OK;
for (i = 0; i < sizeof(struct UnkSaveSection); i++)
{
if (ProgramFlashByte(sector, i, gFastSaveSection->data[i]))
{
status = SAVE_STATUS_ERROR;
break;
}
}
if (status == SAVE_STATUS_ERROR)
{
SetSectorDamagedStatus(ENABLE, sector);
return SAVE_STATUS_ERROR;
}
else
{
status = SAVE_STATUS_OK;
for (i = 0; i < 7; i++)
{
if (ProgramFlashByte(sector, 0xFF9 + i, ((u8 *)gFastSaveSection)[0xFF9 + i]))
{
status = SAVE_STATUS_ERROR;
break;
}
}
if (status == SAVE_STATUS_ERROR)
{
SetSectorDamagedStatus(ENABLE, sector);
return SAVE_STATUS_ERROR;
}
else
{
SetSectorDamagedStatus(DISABLE, sector);
return SAVE_STATUS_OK;
}
}
}
u8 sav12_xor_get(u16 a1, const struct SaveBlockChunk *chunk)
{
u16 sector;
// select sector number
sector = a1 + gFirstSaveSector - 1;
sector %= NUM_SECTORS_PER_SAVE_SLOT;
// select save slot
sector += NUM_SECTORS_PER_SAVE_SLOT * (gSaveCounter % 2);
if (ProgramFlashByte(sector, sizeof(struct UnkSaveSection), ((u8 *)gFastSaveSection)[sizeof(struct UnkSaveSection)]))
{
// sector is damaged, so enable the bit in gDamagedSaveSectors and restore the last written sector and save counter.
SetSectorDamagedStatus(ENABLE, sector);
gFirstSaveSector = gLastKnownGoodSector;
gSaveCounter = gPrevSaveCounter;
return SAVE_STATUS_ERROR;
}
else
{
SetSectorDamagedStatus(DISABLE, sector);
return SAVE_STATUS_OK;
}
}
u8 sub_80D9D88(u16 a1, const struct SaveBlockChunk *chunk)
{
u16 sector;
sector = a1 + gFirstSaveSector - 1;
sector %= NUM_SECTORS_PER_SAVE_SLOT;
sector += NUM_SECTORS_PER_SAVE_SLOT * (gSaveCounter % 2);
if (ProgramFlashByte(sector, sizeof(struct UnkSaveSection), 0x25))
{
// sector is damaged, so enable the bit in gDamagedSaveSectors and restore the last written sector and save counter.
SetSectorDamagedStatus(ENABLE, sector);
gFirstSaveSector = gLastKnownGoodSector;
gSaveCounter = gPrevSaveCounter;
return SAVE_STATUS_ERROR;
}
else
{
SetSectorDamagedStatus(DISABLE, sector);
return SAVE_STATUS_OK;
}
}
u8 sub_80D9E14(u16 a1, const struct SaveBlockChunk *chunk)
{
u8 retVal;
gFastSaveSection = &gSaveDataBuffer;
if (a1 != 0xFFFF)
{
retVal = SAVE_STATUS_ERROR;
}
else
{
retVal = GetSaveValidStatus(chunk);
sub_80D9E54(0xFFFF, chunk);
}
return retVal;
}
u8 sub_80D9E54(u16 a1, const struct SaveBlockChunk *chunks)
{
u16 i;
u16 checksum;
u16 sector = NUM_SECTORS_PER_SAVE_SLOT * (gSaveCounter % 2);
u16 id;
for (i = 0; i < NUM_SECTORS_PER_SAVE_SLOT; i++)
{
DoReadFlashWholeSection(i + sector, gFastSaveSection);
id = gFastSaveSection->id;
if (id == 0)
gFirstSaveSector = i;
checksum = CalculateChecksum(gFastSaveSection->data, chunks[id].size);
if (gFastSaveSection->signature == FILE_SIGNATURE
&& gFastSaveSection->checksum == checksum)
{
u16 j;
for (j = 0; j < chunks[id].size; j++)
chunks[id].data[j] = gFastSaveSection->data[j];
}
}
return 1;
}
u8 GetSaveValidStatus(const struct SaveBlockChunk *chunks)
{
u16 sector;
bool8 signatureValid;
u16 checksum;
u32 slot1saveCounter = 0;
u32 slot2saveCounter = 0;
u8 slot1Status;
u8 slot2Status;
u32 validSectors;
const u32 ALL_SECTORS = (1 << NUM_SECTORS_PER_SAVE_SLOT) - 1; // bitmask of all saveblock sectors
// check save slot 1.
validSectors = 0;
signatureValid = FALSE;
for (sector = 0; sector < NUM_SECTORS_PER_SAVE_SLOT; sector++)
{
DoReadFlashWholeSection(sector, gFastSaveSection);
if (gFastSaveSection->signature == FILE_SIGNATURE)
{
signatureValid = TRUE;
checksum = CalculateChecksum(gFastSaveSection->data, chunks[gFastSaveSection->id].size);
if (gFastSaveSection->checksum == checksum)
{
slot1saveCounter = gFastSaveSection->counter;
validSectors |= 1 << gFastSaveSection->id;
}
}
}
if (signatureValid)
{
if (validSectors == ALL_SECTORS)
slot1Status = SAVE_STATUS_OK;
else
slot1Status = SAVE_STATUS_ERROR;
}
else
{
slot1Status = SAVE_STATUS_EMPTY;
}
// check save slot 2.
validSectors = 0;
signatureValid = FALSE;
for (sector = 0; sector < NUM_SECTORS_PER_SAVE_SLOT; sector++)
{
DoReadFlashWholeSection(NUM_SECTORS_PER_SAVE_SLOT + sector, gFastSaveSection);
if (gFastSaveSection->signature == FILE_SIGNATURE)
{
signatureValid = TRUE;
checksum = CalculateChecksum(gFastSaveSection->data, chunks[gFastSaveSection->id].size);
if (gFastSaveSection->checksum == checksum)
{
slot2saveCounter = gFastSaveSection->counter;
validSectors |= 1 << gFastSaveSection->id;
}
}
}
if (signatureValid)
{
if (validSectors == ALL_SECTORS)
slot2Status = SAVE_STATUS_OK;
else
slot2Status = SAVE_STATUS_ERROR;
}
else
{
slot2Status = SAVE_STATUS_EMPTY;
}
if (slot1Status == SAVE_STATUS_OK && slot2Status == SAVE_STATUS_OK)
{
// Choose counter of the most recent save file
if ((slot1saveCounter == -1 && slot2saveCounter == 0) || (slot1saveCounter == 0 && slot2saveCounter == -1))
{
if ((unsigned)(slot1saveCounter + 1) < (unsigned)(slot2saveCounter + 1))
gSaveCounter = slot2saveCounter;
else
gSaveCounter = slot1saveCounter;
}
else
{
if (slot1saveCounter < slot2saveCounter)
gSaveCounter = slot2saveCounter;
else
gSaveCounter = slot1saveCounter;
}
return SAVE_STATUS_OK;
}
if (slot1Status == SAVE_STATUS_OK)
{
gSaveCounter = slot1saveCounter;
if (slot2Status == SAVE_STATUS_ERROR)
return SAVE_STATUS_ERROR;
else
return SAVE_STATUS_OK;
}
if (slot2Status == SAVE_STATUS_OK)
{
gSaveCounter = slot2saveCounter;
if (slot1Status == SAVE_STATUS_ERROR)
return SAVE_STATUS_ERROR;
else
return SAVE_STATUS_OK;
}
if (slot1Status == SAVE_STATUS_EMPTY && slot2Status == SAVE_STATUS_EMPTY)
{
gSaveCounter = 0;
gFirstSaveSector = 0;
return SAVE_STATUS_EMPTY;
}
gSaveCounter = 0;
gFirstSaveSector = 0;
return 2;
}
u8 sub_80DA120(u8 sector, u8 *data, u16 size)
{
u16 i;
struct SaveSection *section = &gSaveDataBuffer;
DoReadFlashWholeSection(sector, section);
if (section->signature == FILE_SIGNATURE)
{
u16 checksum = CalculateChecksum(section->data, size);
if (section->id == checksum)
{
for (i = 0; i < size; i++)
data[i] = section->data[i];
return SAVE_STATUS_OK;
}
else
{
return SAVE_STATUS_INVALID;
}
}
else
{
return SAVE_STATUS_EMPTY;
}
}
u8 DoReadFlashWholeSection(u8 sector, struct SaveSection *section)
{
ReadFlash(sector, 0, section->data, sizeof(struct SaveSection));
return 1;
}
u16 CalculateChecksum(void *data, u16 size)
{
u16 i;
u32 checksum = 0;
for (i = 0; i < (size / 4); i++)
checksum += *((u32 *)data)++;
return ((checksum >> 16) + checksum);
}
void UpdateSaveAddresses(void)
{
int i = 0;
gRamSaveSectionLocations[i].data = (void*)(gSaveBlock2Ptr) + gSaveSectionOffsets[i].toAdd;
gRamSaveSectionLocations[i].size = gSaveSectionOffsets[i].size;
for (i = 1; i < 5; i++)
{
gRamSaveSectionLocations[i].data = (void*)(gSaveBlock1Ptr) + gSaveSectionOffsets[i].toAdd;
gRamSaveSectionLocations[i].size = gSaveSectionOffsets[i].size;
}
for (i = 5; i < 14; i++)
{
gRamSaveSectionLocations[i].data = (void*)(gPokemonStoragePtr) + gSaveSectionOffsets[i].toAdd;
gRamSaveSectionLocations[i].size = gSaveSectionOffsets[i].size;
i++;i--; // needed to match
}
}
u8 HandleSavingData(u8 saveType)
{
u8 i;
u32 *backupPtr = gMain.vblankCounter1;
u8 *tempAddr;
gMain.vblankCounter1 = NULL;
UpdateSaveAddresses();
switch (saveType)
{
case SAVE_HALL_OF_FAME_ERASE_BEFORE: // deletes HOF before overwriting HOF completely. unused
for (i = 0xE * 2 + 0; i < 32; i++)
EraseFlashSector(i);
// fallthrough
case SAVE_HALL_OF_FAME: // hall of fame.
if (GetGameStat(GAME_STAT_ENTERED_HOF) < 999)
IncrementGameStat(GAME_STAT_ENTERED_HOF);
tempAddr = gDecompressionBuffer;
HandleWriteSectorNBytes(0x1C, tempAddr, 0xF80);
HandleWriteSectorNBytes(0x1D, tempAddr + 0xF80, 0xF80);
// fallthrough
case SAVE_NORMAL: // normal save. also called by overwriting your own save.
default:
SaveSerializedGame();
save_write_to_flash(0xFFFF, gRamSaveSectionLocations);
break;
case SAVE_LINK: // _081532C4
SaveSerializedGame();
for(i = 0; i < 5; i++)
save_write_to_flash(i, gRamSaveSectionLocations);
break;
case EREADER_SAVE:
SaveSerializedGame();
save_write_to_flash(0, gRamSaveSectionLocations);
break;
case SAVE_OVERWRITE_DIFFERENT_FILE:
for (i = (0xE * 2 + 0); i < 32; i++)
EraseFlashSector(i); // erase HOF.
SaveSerializedGame();
save_write_to_flash(0xFFFF, gRamSaveSectionLocations);
break;
}
gMain.vblankCounter1 = backupPtr;
return 0;
}
u8 TrySavingData(u8 saveType)
{
if(gFlashMemoryPresent == TRUE)
{
HandleSavingData(saveType);
if(gDamagedSaveSectors)
DoSaveFailedScreen(saveType);
else
goto OK; // really?
}
gUnknown_3005420 = 0xFF;
return 0xFF;
OK:
gUnknown_3005420 = 1;
return 1;
}
u8 sub_80DA3AC(void)
{
if (gFlashMemoryPresent != TRUE)
return 1;
UpdateSaveAddresses();
SaveSerializedGame();
RestoreSaveBackupVarsAndIncrement(gRamSaveSectionLocations);
return 0;
}
bool8 sub_80DA3D8(void)
{
u8 retVal = sub_80D9AA4(0xE, gRamSaveSectionLocations);
if (gDamagedSaveSectors)
DoSaveFailedScreen(0);
if (retVal == 0xFF)
return 1;
else
return 0;
}
u8 sub_80DA40C(void)
{
sub_80D9B04(0xE, gRamSaveSectionLocations);
if (gDamagedSaveSectors)
DoSaveFailedScreen(0);
return 0;
}
u8 sub_80DA434(void)
{
sav12_xor_get(0xE, gRamSaveSectionLocations);
if (gDamagedSaveSectors)
DoSaveFailedScreen(0);
return 0;
}
u8 sub_80DA45C(void)
{
if (gFlashMemoryPresent != TRUE)
return 1;
UpdateSaveAddresses();
SaveSerializedGame();
RestoreSaveBackupVars(gRamSaveSectionLocations);
sub_80D9B04(gUnknown_3005398 + 1, gRamSaveSectionLocations);
return 0;
}
bool8 sub_80DA4A0(void)
{
u8 retVal = FALSE;
u16 val = ++gUnknown_3005398;
if (val <= 4)
{
sub_80D9B04(gUnknown_3005398 + 1, gRamSaveSectionLocations);
sub_80D9D88(val, gRamSaveSectionLocations);
}
else
{
sub_80D9D88(val, gRamSaveSectionLocations);
retVal = TRUE;
}
if (gDamagedSaveSectors)
DoSaveFailedScreen(1);
return retVal;
}
u8 Save_LoadGameData(u8 a1)
{
u8 result;
if (gFlashMemoryPresent != TRUE)
{
gSaveFileStatus = 4;
return 0xFF;
}
UpdateSaveAddresses();
switch (a1)
{
case 0:
default:
result = sub_80D9E14(0xFFFF, gRamSaveSectionLocations);
LoadSerializedGame();
gSaveFileStatus = result;
gGameContinueCallback = 0;
break;
case 3:
result = sub_80DA120(0x1C, gDecompressionBuffer, 0xF80);
if(result == 1)
result = sub_80DA120(0x1D, gDecompressionBuffer + 0xF80, 0xF80);
break;
}
return result;
}
u32 TryCopySpecialSaveSection(u8 sector, u8* dst)
{
s32 i;
s32 size;
u8* savData;
if (sector != 30 && sector != 31)
return 0xFF;
ReadFlash(sector, 0, (u8 *)&gSaveDataBuffer, sizeof(struct SaveSection));
if (*(u32*)(&gSaveDataBuffer.data[0]) != 0xB39D)
return 0xFF;
// copies whole save section except u32 counter
i = 0;
size = 0xFFB;
savData = &gSaveDataBuffer.data[4];
for (; i <= size; i++)
dst[i] = savData[i];
return 1;
}
u32 sub_80DA5E0(u8 sector, u8* src)
{
s32 i;
s32 size;
u8* savData;
void* savDataBuffer;
if (sector != 30 && sector != 31)
return 0xFF;
savDataBuffer = &gSaveDataBuffer;
*(u32*)(savDataBuffer) = 0xB39D;
// copies whole save section except u32 counter
i = 0;
size = 0xFFB;
savData = &gSaveDataBuffer.data[4];
for (; i <= size; i++)
savData[i] = src[i];
if (ProgramFlashSectorAndVerify(sector, savDataBuffer) != 0)
return 0xFF;
return 1;
}
void sub_80DA634(u8 taskId)
{
switch (gTasks[taskId].data[0])
{
case 0:
gSoftResetDisabled = TRUE;
gTasks[taskId].data[0] = 1;
break;
case 1:
sub_800AB9C();
gTasks[taskId].data[0] = 2;
break;
case 2:
if (sub_800A4BC())
{
sub_80590D8();
gTasks[taskId].data[0] = 3;
}
break;
case 3:
sub_804C1C0();
sub_80DA3AC();
gTasks[taskId].data[0] = 4;
break;
case 4:
if (++gTasks[taskId].data[1] == 5)
{
gTasks[taskId].data[1] = 0;
gTasks[taskId].data[0] = 5;
}
break;
case 5:
if (sub_80DA3D8())
gTasks[taskId].data[0] = 6;
else
gTasks[taskId].data[0] = 4;
break;
case 6:
sub_80DA40C();
gTasks[taskId].data[0] = 7;
break;
case 7:
sav2_gender2_inplace_and_xFE();
sub_800AB9C();
gTasks[taskId].data[0] = 8;
break;
case 8:
if (sub_800A4BC())
{
sub_80DA434();
gTasks[taskId].data[0] = 9;
}
break;
case 9:
sub_800AB9C();
gTasks[taskId].data[0] = 10;
break;
case 10:
if (sub_800A4BC())
gTasks[taskId].data[0]++;
break;
case 11:
if (++gTasks[taskId].data[1] > 5)
{
gSoftResetDisabled = FALSE;
DestroyTask(taskId);
}
break;
}
}

View File

@ -135,7 +135,7 @@ gUnknown_3004FFC: @ 3004FFC
.include "random.o"
.align 2
gUnknown_3005004: @ 3005004
gFlashMemoryPresent: @ 3005004
.space 0x4
gSaveBlock1Ptr: @ 3005008
@ -144,7 +144,7 @@ gSaveBlock1Ptr: @ 3005008
gSaveBlock2Ptr: @ 300500C
.space 0x4
gUnknown_3005010: @ 3005010
gPokemonStoragePtr: @ 3005010
.space 0x4
gUnknown_3005014: @ 3005014
@ -240,39 +240,9 @@ gUnknown_3005378: @ 3005378
gUnknown_300537C: @ 300537C
.space 0x4
gUnknown_3005380: @ 3005380
.space 0x4
gUnknown_3005384: @ 3005384
.space 0x4
gUnknown_3005388: @ 3005388
.space 0x4
gUnknown_300538C: @ 300538C
.space 0x4
gUnknown_3005390: @ 3005390
.space 0x4
gUnknown_3005394: @ 3005394
.space 0x4
gUnknown_3005398: @ 3005398
.space 0x8
gUnknown_30053A0: @ 30053A0
.space 0x4
gUnknown_30053A4: @ 30053A4
.space 0xC
gUnknown_30053B0: @ 30053B0
.space 0x70
gUnknown_3005420: @ 3005420
.space 0x4
.include "save.o"
.align 2
gUnknown_3005424: @ 3005424
.space 0x4

View File

@ -1,4 +1,4 @@
gUnknown_201C000: @ 201C000
gDecompressionBuffer: @ 201C000
.space 0x20
gUnknown_201C020: @ 201C020
@ -1244,9 +1244,9 @@ gUnknown_2039A30: @ 2039A30
gUnknown_2039A34: @ 2039A34
.space 0x4
gUnknown_2039A38: @ 2039A38
.space 0x1004
.include "src/save.o"
.align 2
gUnknown_203AA3C: @ 203AA3C
.space 0x74