promotion related code review

1. Split and rename "branched_promotion*" to "classchg-*" to get aligned to efx proc names.

2. Decompile classchg-postconfirm code to complete the total bmpromote code.

Signed-off-by: mokhaleee <nkulyc@163.com>
This commit is contained in:
mokhaleee 2023-05-15 18:48:04 +08:00
parent d353426948
commit 79251edbb8
35 changed files with 2553 additions and 2644 deletions

View File

@ -2118,522 +2118,4 @@ ExecAllAIS: @ 0x0805A9F4
THUMB_FUNC_END ExecAllAIS
THUMB_FUNC_START NewEkrUnitMainMini
NewEkrUnitMainMini: @ 0x0805AA00
push {r4, r5, lr}
adds r4, r0, #0
ldr r0, _0805AA24 @ ProcScr_ekrUnitMainMini
movs r1, #4
bl Proc_Start
adds r5, r0, #0
adds r0, r4, #0
bl sub_805A60C
str r4, [r5, #0x5c]
str r5, [r4, #0x34]
movs r0, #1
strb r0, [r4]
pop {r4, r5}
pop {r0}
bx r0
.align 2, 0
_0805AA24: .4byte ProcScr_ekrUnitMainMini
THUMB_FUNC_END NewEkrUnitMainMini
THUMB_FUNC_START sub_805AA28
sub_805AA28: @ 0x0805AA28
push {r4, lr}
adds r4, r0, #0
ldr r0, [r4, #0x14]
bl AnimDelete
ldr r0, [r4, #0x18]
bl AnimDelete
movs r0, #0
str r0, [r4, #0x14]
str r0, [r4, #0x18]
ldr r0, [r4, #0x34]
bl Proc_End
pop {r4}
pop {r0}
bx r0
THUMB_FUNC_END sub_805AA28
THUMB_FUNC_START EkrUnitMainMiniMain
EkrUnitMainMiniMain: @ 0x0805AA4C
push {r4, lr}
ldr r4, [r0, #0x5c]
ldr r1, [r4, #0x14]
adds r0, r4, #0
bl sub_805A3DC
ldr r1, [r4, #0x18]
adds r0, r4, #0
bl sub_805A3DC
pop {r4}
pop {r0}
bx r0
THUMB_FUNC_END EkrUnitMainMiniMain
THUMB_FUNC_START sub_805AA68
sub_805AA68: @ 0x0805AA68
push {r4, r5, r6, r7, lr}
mov r7, r9
mov r6, r8
push {r6, r7}
sub sp, #0xc
adds r6, r0, #0
movs r0, #0
ldrsh r1, [r6, r0]
lsls r0, r1, #1
adds r0, r0, r1
lsls r0, r0, #3
ldr r2, _0805AAD0 @ battle_terrain_table
adds r0, r0, r2
mov r8, r0
movs r0, #6
ldrsh r1, [r6, r0]
lsls r0, r1, #1
adds r0, r0, r1
lsls r0, r0, #3
adds r5, r0, r2
movs r1, #0
ldrsh r0, [r6, r1]
movs r4, #1
negs r4, r4
cmp r0, r4
beq _0805AAA6
mov r2, r8
ldr r0, [r2, #0xc]
ldr r1, [r6, #0x20]
bl LZ77UnCompWram
_0805AAA6:
movs r1, #6
ldrsh r0, [r6, r1]
cmp r0, r4
beq _0805AABC
ldr r0, [r5, #0xc]
ldr r1, [r6, #0x20]
movs r2, #0x80
lsls r2, r2, #5
adds r1, r1, r2
bl LZ77UnCompWram
_0805AABC:
movs r1, #0xc
ldrsh r0, [r6, r1]
cmp r0, #3
bgt _0805AAD4
cmp r0, #1
bge _0805AAE2
cmp r0, #0
beq _0805AAD8
b _0805AAE2
.align 2, 0
_0805AAD0: .4byte battle_terrain_table
_0805AAD4:
cmp r0, #4
bne _0805AAE2
_0805AAD8:
ldr r3, [r6, #0x20]
movs r2, #0x80
lsls r2, r2, #5
adds r7, r3, r2
b _0805AAF0
_0805AAE2:
ldr r0, [r6, #0x20]
movs r1, #0x80
lsls r1, r1, #4
adds r3, r0, r1
movs r2, #0xc0
lsls r2, r2, #5
adds r7, r0, r2
_0805AAF0:
mov r0, r8
ldr r0, [r0, #0x10]
mov r8, r0
ldr r5, [r5, #0x10]
mov r9, r5
movs r1, #0xe
ldrsh r4, [r6, r1]
movs r0, #1
negs r0, r0
cmp r4, r0
beq _0805AB74
cmp r4, r0
blt _0805ABD4
cmp r4, #3
bgt _0805ABD4
movs r2, #4
ldrsh r0, [r6, r2]
adds r0, #0x40
lsls r0, r0, #5
movs r4, #0xc0
lsls r4, r4, #0x13
adds r0, r0, r4
ldr r1, [r6, #0x1c]
adds r1, r1, r0
movs r5, #0x80
lsls r5, r5, #4
adds r0, r3, #0
adds r2, r5, #0
bl RegisterDataMove
movs r1, #0xa
ldrsh r0, [r6, r1]
lsls r0, r0, #5
adds r0, r0, r4
ldr r1, [r6, #0x1c]
adds r1, r1, r0
adds r0, r7, #0
adds r2, r5, #0
bl RegisterDataMove
movs r2, #2
ldrsh r1, [r6, r2]
lsls r1, r1, #5
ldr r4, _0805AB70 @ gPaletteBuffer
adds r1, r1, r4
mov r0, r8
movs r2, #8
bl CpuFastSet
movs r0, #8
ldrsh r1, [r6, r0]
lsls r1, r1, #5
adds r1, r1, r4
mov r0, r9
movs r2, #8
bl CpuFastSet
bl EnablePaletteSync
adds r0, r6, #0
bl sub_805AE58
b _0805ABD4
.align 2, 0
_0805AB70: .4byte gPaletteBuffer
_0805AB74:
movs r1, #0
ldrsh r0, [r6, r1]
cmp r0, r4
beq _0805ABA2
movs r2, #4
ldrsh r0, [r6, r2]
lsls r0, r0, #5
ldr r1, [r6, #0x1c]
adds r1, r1, r0
movs r2, #0x80
lsls r2, r2, #4
adds r0, r3, #0
bl RegisterDataMove
movs r0, #2
ldrsh r1, [r6, r0]
lsls r1, r1, #5
ldr r0, _0805ABEC @ pPalette10Buffer
adds r1, r1, r0
mov r0, r8
movs r2, #8
bl CpuFastSet
_0805ABA2:
movs r1, #6
ldrsh r0, [r6, r1]
cmp r0, r4
beq _0805ABD0
movs r2, #0xa
ldrsh r0, [r6, r2]
lsls r0, r0, #5
ldr r1, [r6, #0x1c]
adds r1, r1, r0
movs r2, #0x80
lsls r2, r2, #4
adds r0, r7, #0
bl RegisterDataMove
movs r0, #8
ldrsh r1, [r6, r0]
lsls r1, r1, #5
ldr r0, _0805ABEC @ pPalette10Buffer
adds r1, r1, r0
mov r0, r9
movs r2, #8
bl CpuFastSet
_0805ABD0:
bl EnablePaletteSync
_0805ABD4:
ldrh r0, [r6, #0xe]
adds r0, #1
lsls r0, r0, #0x10
asrs r0, r0, #0x10
cmp r0, #4
bls _0805ABE2
b _0805AE02
_0805ABE2:
lsls r0, r0, #2
ldr r1, _0805ABF0 @ _0805ABF4
adds r0, r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_0805ABEC: .4byte pPalette10Buffer
_0805ABF0: .4byte _0805ABF4
_0805ABF4: @ jump table
.4byte _0805AC28 @ case 0
.4byte _0805AC08 @ case 1
.4byte _0805AC10 @ case 2
.4byte _0805AC18 @ case 3
.4byte _0805AC20 @ case 4
_0805AC08:
movs r0, #1
bl BG_EnableSyncByMask
b _0805AE02
_0805AC10:
movs r0, #2
bl BG_EnableSyncByMask
b _0805AE02
_0805AC18:
movs r0, #4
bl BG_EnableSyncByMask
b _0805AE02
_0805AC20:
movs r0, #8
bl BG_EnableSyncByMask
b _0805AE02
_0805AC28:
movs r0, #0
str r0, [r6, #0x14]
str r0, [r6, #0x18]
movs r2, #6
ldrsh r1, [r6, r2]
subs r0, #1
cmp r1, r0
beq _0805AD16
movs r1, #0xc
ldrsh r0, [r6, r1]
cmp r0, #4
bhi _0805AD16
lsls r0, r0, #2
ldr r1, _0805AC4C @ _0805AC50
adds r0, r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_0805AC4C: .4byte _0805AC50
_0805AC50: @ jump table
.4byte _0805AC64 @ case 0
.4byte _0805AC90 @ case 1
.4byte _0805ACBC @ case 2
.4byte _0805ACE8 @ case 3
.4byte _0805AC64 @ case 4
_0805AC64:
movs r2, #8
ldrsh r0, [r6, r2]
lsls r0, r0, #0xc
ldrh r1, [r6, #0xa]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805AC8C @ gUnknown_085C73B8
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0xa8
b _0805AD0C
.align 2, 0
_0805AC8C: .4byte gUnknown_085C73B8
_0805AC90:
movs r1, #8
ldrsh r0, [r6, r1]
lsls r0, r0, #0xc
ldrh r1, [r6, #0xa]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805ACB8 @ gUnknown_085C72AC
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0xb0
b _0805AD0C
.align 2, 0
_0805ACB8: .4byte gUnknown_085C72AC
_0805ACBC:
movs r1, #8
ldrsh r0, [r6, r1]
lsls r0, r0, #0xc
ldrh r1, [r6, #0xa]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805ACE4 @ gUnknown_085C72AC
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0xb0
b _0805AD0C
.align 2, 0
_0805ACE4: .4byte gUnknown_085C72AC
_0805ACE8:
movs r1, #8
ldrsh r0, [r6, r1]
lsls r0, r0, #0xc
ldrh r1, [r6, #0xa]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805AD34 @ gUnknown_085C72AC
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0x80
_0805AD0C:
movs r1, #0x68
movs r3, #2
bl NewEkrsubAnimeEmulator
str r0, [r6, #0x18]
_0805AD16:
movs r0, #0
ldrsh r1, [r6, r0]
movs r0, #1
negs r0, r0
cmp r1, r0
beq _0805AE02
movs r1, #0xc
ldrsh r0, [r6, r1]
cmp r0, #4
bhi _0805AE02
lsls r0, r0, #2
ldr r1, _0805AD38 @ _0805AD3C
adds r0, r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_0805AD34: .4byte gUnknown_085C72AC
_0805AD38: .4byte _0805AD3C
_0805AD3C: @ jump table
.4byte _0805AD50 @ case 0
.4byte _0805AD7C @ case 1
.4byte _0805ADA8 @ case 2
.4byte _0805ADD4 @ case 3
.4byte _0805AD50 @ case 4
_0805AD50:
movs r2, #2
ldrsh r0, [r6, r2]
lsls r0, r0, #0xc
ldrh r1, [r6, #4]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805AD78 @ gUnknown_085C7438
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0x48
b _0805ADF8
.align 2, 0
_0805AD78: .4byte gUnknown_085C7438
_0805AD7C:
movs r1, #2
ldrsh r0, [r6, r1]
lsls r0, r0, #0xc
ldrh r1, [r6, #4]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805ADA4 @ gUnknown_085C7338
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0x20
b _0805ADF8
.align 2, 0
_0805ADA4: .4byte gUnknown_085C7338
_0805ADA8:
movs r1, #2
ldrsh r0, [r6, r1]
lsls r0, r0, #0xc
ldrh r1, [r6, #4]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805ADD0 @ gUnknown_085C7338
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0x40
b _0805ADF8
.align 2, 0
_0805ADD0: .4byte gUnknown_085C7338
_0805ADD4:
movs r1, #2
ldrsh r0, [r6, r1]
lsls r0, r0, #0xc
ldrh r1, [r6, #4]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805AE10 @ gUnknown_085C7438
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0x78
_0805ADF8:
movs r1, #0x68
movs r3, #2
bl NewEkrsubAnimeEmulator
str r0, [r6, #0x14]
_0805AE02:
add sp, #0xc
pop {r3, r4}
mov r8, r3
mov r9, r4
pop {r4, r5, r6, r7}
pop {r0}
bx r0
.align 2, 0
_0805AE10: .4byte gUnknown_085C7438
THUMB_FUNC_END sub_805AA68
.align 2, 0

523
asm/banim-ekrmainmini.s Normal file
View File

@ -0,0 +1,523 @@
.INCLUDE "macro.inc"
.SYNTAX UNIFIED
THUMB_FUNC_START NewEkrUnitMainMini
NewEkrUnitMainMini: @ 0x0805AA00
push {r4, r5, lr}
adds r4, r0, #0
ldr r0, _0805AA24 @ ProcScr_ekrUnitMainMini
movs r1, #4
bl Proc_Start
adds r5, r0, #0
adds r0, r4, #0
bl sub_805A60C
str r4, [r5, #0x5c]
str r5, [r4, #0x34]
movs r0, #1
strb r0, [r4]
pop {r4, r5}
pop {r0}
bx r0
.align 2, 0
_0805AA24: .4byte ProcScr_ekrUnitMainMini
THUMB_FUNC_END NewEkrUnitMainMini
THUMB_FUNC_START sub_805AA28
sub_805AA28: @ 0x0805AA28
push {r4, lr}
adds r4, r0, #0
ldr r0, [r4, #0x14]
bl AnimDelete
ldr r0, [r4, #0x18]
bl AnimDelete
movs r0, #0
str r0, [r4, #0x14]
str r0, [r4, #0x18]
ldr r0, [r4, #0x34]
bl Proc_End
pop {r4}
pop {r0}
bx r0
THUMB_FUNC_END sub_805AA28
THUMB_FUNC_START EkrUnitMainMiniMain
EkrUnitMainMiniMain: @ 0x0805AA4C
push {r4, lr}
ldr r4, [r0, #0x5c]
ldr r1, [r4, #0x14]
adds r0, r4, #0
bl sub_805A3DC
ldr r1, [r4, #0x18]
adds r0, r4, #0
bl sub_805A3DC
pop {r4}
pop {r0}
bx r0
THUMB_FUNC_END EkrUnitMainMiniMain
THUMB_FUNC_START sub_805AA68
sub_805AA68: @ 0x0805AA68
push {r4, r5, r6, r7, lr}
mov r7, r9
mov r6, r8
push {r6, r7}
sub sp, #0xc
adds r6, r0, #0
movs r0, #0
ldrsh r1, [r6, r0]
lsls r0, r1, #1
adds r0, r0, r1
lsls r0, r0, #3
ldr r2, _0805AAD0 @ battle_terrain_table
adds r0, r0, r2
mov r8, r0
movs r0, #6
ldrsh r1, [r6, r0]
lsls r0, r1, #1
adds r0, r0, r1
lsls r0, r0, #3
adds r5, r0, r2
movs r1, #0
ldrsh r0, [r6, r1]
movs r4, #1
negs r4, r4
cmp r0, r4
beq _0805AAA6
mov r2, r8
ldr r0, [r2, #0xc]
ldr r1, [r6, #0x20]
bl LZ77UnCompWram
_0805AAA6:
movs r1, #6
ldrsh r0, [r6, r1]
cmp r0, r4
beq _0805AABC
ldr r0, [r5, #0xc]
ldr r1, [r6, #0x20]
movs r2, #0x80
lsls r2, r2, #5
adds r1, r1, r2
bl LZ77UnCompWram
_0805AABC:
movs r1, #0xc
ldrsh r0, [r6, r1]
cmp r0, #3
bgt _0805AAD4
cmp r0, #1
bge _0805AAE2
cmp r0, #0
beq _0805AAD8
b _0805AAE2
.align 2, 0
_0805AAD0: .4byte battle_terrain_table
_0805AAD4:
cmp r0, #4
bne _0805AAE2
_0805AAD8:
ldr r3, [r6, #0x20]
movs r2, #0x80
lsls r2, r2, #5
adds r7, r3, r2
b _0805AAF0
_0805AAE2:
ldr r0, [r6, #0x20]
movs r1, #0x80
lsls r1, r1, #4
adds r3, r0, r1
movs r2, #0xc0
lsls r2, r2, #5
adds r7, r0, r2
_0805AAF0:
mov r0, r8
ldr r0, [r0, #0x10]
mov r8, r0
ldr r5, [r5, #0x10]
mov r9, r5
movs r1, #0xe
ldrsh r4, [r6, r1]
movs r0, #1
negs r0, r0
cmp r4, r0
beq _0805AB74
cmp r4, r0
blt _0805ABD4
cmp r4, #3
bgt _0805ABD4
movs r2, #4
ldrsh r0, [r6, r2]
adds r0, #0x40
lsls r0, r0, #5
movs r4, #0xc0
lsls r4, r4, #0x13
adds r0, r0, r4
ldr r1, [r6, #0x1c]
adds r1, r1, r0
movs r5, #0x80
lsls r5, r5, #4
adds r0, r3, #0
adds r2, r5, #0
bl RegisterDataMove
movs r1, #0xa
ldrsh r0, [r6, r1]
lsls r0, r0, #5
adds r0, r0, r4
ldr r1, [r6, #0x1c]
adds r1, r1, r0
adds r0, r7, #0
adds r2, r5, #0
bl RegisterDataMove
movs r2, #2
ldrsh r1, [r6, r2]
lsls r1, r1, #5
ldr r4, _0805AB70 @ gPaletteBuffer
adds r1, r1, r4
mov r0, r8
movs r2, #8
bl CpuFastSet
movs r0, #8
ldrsh r1, [r6, r0]
lsls r1, r1, #5
adds r1, r1, r4
mov r0, r9
movs r2, #8
bl CpuFastSet
bl EnablePaletteSync
adds r0, r6, #0
bl sub_805AE58
b _0805ABD4
.align 2, 0
_0805AB70: .4byte gPaletteBuffer
_0805AB74:
movs r1, #0
ldrsh r0, [r6, r1]
cmp r0, r4
beq _0805ABA2
movs r2, #4
ldrsh r0, [r6, r2]
lsls r0, r0, #5
ldr r1, [r6, #0x1c]
adds r1, r1, r0
movs r2, #0x80
lsls r2, r2, #4
adds r0, r3, #0
bl RegisterDataMove
movs r0, #2
ldrsh r1, [r6, r0]
lsls r1, r1, #5
ldr r0, _0805ABEC @ pPalette10Buffer
adds r1, r1, r0
mov r0, r8
movs r2, #8
bl CpuFastSet
_0805ABA2:
movs r1, #6
ldrsh r0, [r6, r1]
cmp r0, r4
beq _0805ABD0
movs r2, #0xa
ldrsh r0, [r6, r2]
lsls r0, r0, #5
ldr r1, [r6, #0x1c]
adds r1, r1, r0
movs r2, #0x80
lsls r2, r2, #4
adds r0, r7, #0
bl RegisterDataMove
movs r0, #8
ldrsh r1, [r6, r0]
lsls r1, r1, #5
ldr r0, _0805ABEC @ pPalette10Buffer
adds r1, r1, r0
mov r0, r9
movs r2, #8
bl CpuFastSet
_0805ABD0:
bl EnablePaletteSync
_0805ABD4:
ldrh r0, [r6, #0xe]
adds r0, #1
lsls r0, r0, #0x10
asrs r0, r0, #0x10
cmp r0, #4
bls _0805ABE2
b _0805AE02
_0805ABE2:
lsls r0, r0, #2
ldr r1, _0805ABF0 @ _0805ABF4
adds r0, r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_0805ABEC: .4byte pPalette10Buffer
_0805ABF0: .4byte _0805ABF4
_0805ABF4: @ jump table
.4byte _0805AC28 @ case 0
.4byte _0805AC08 @ case 1
.4byte _0805AC10 @ case 2
.4byte _0805AC18 @ case 3
.4byte _0805AC20 @ case 4
_0805AC08:
movs r0, #1
bl BG_EnableSyncByMask
b _0805AE02
_0805AC10:
movs r0, #2
bl BG_EnableSyncByMask
b _0805AE02
_0805AC18:
movs r0, #4
bl BG_EnableSyncByMask
b _0805AE02
_0805AC20:
movs r0, #8
bl BG_EnableSyncByMask
b _0805AE02
_0805AC28:
movs r0, #0
str r0, [r6, #0x14]
str r0, [r6, #0x18]
movs r2, #6
ldrsh r1, [r6, r2]
subs r0, #1
cmp r1, r0
beq _0805AD16
movs r1, #0xc
ldrsh r0, [r6, r1]
cmp r0, #4
bhi _0805AD16
lsls r0, r0, #2
ldr r1, _0805AC4C @ _0805AC50
adds r0, r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_0805AC4C: .4byte _0805AC50
_0805AC50: @ jump table
.4byte _0805AC64 @ case 0
.4byte _0805AC90 @ case 1
.4byte _0805ACBC @ case 2
.4byte _0805ACE8 @ case 3
.4byte _0805AC64 @ case 4
_0805AC64:
movs r2, #8
ldrsh r0, [r6, r2]
lsls r0, r0, #0xc
ldrh r1, [r6, #0xa]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805AC8C @ gUnknown_085C73B8
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0xa8
b _0805AD0C
.align 2, 0
_0805AC8C: .4byte gUnknown_085C73B8
_0805AC90:
movs r1, #8
ldrsh r0, [r6, r1]
lsls r0, r0, #0xc
ldrh r1, [r6, #0xa]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805ACB8 @ gUnknown_085C72AC
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0xb0
b _0805AD0C
.align 2, 0
_0805ACB8: .4byte gUnknown_085C72AC
_0805ACBC:
movs r1, #8
ldrsh r0, [r6, r1]
lsls r0, r0, #0xc
ldrh r1, [r6, #0xa]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805ACE4 @ gUnknown_085C72AC
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0xb0
b _0805AD0C
.align 2, 0
_0805ACE4: .4byte gUnknown_085C72AC
_0805ACE8:
movs r1, #8
ldrsh r0, [r6, r1]
lsls r0, r0, #0xc
ldrh r1, [r6, #0xa]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805AD34 @ gUnknown_085C72AC
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0x80
_0805AD0C:
movs r1, #0x68
movs r3, #2
bl NewEkrsubAnimeEmulator
str r0, [r6, #0x18]
_0805AD16:
movs r0, #0
ldrsh r1, [r6, r0]
movs r0, #1
negs r0, r0
cmp r1, r0
beq _0805AE02
movs r1, #0xc
ldrsh r0, [r6, r1]
cmp r0, #4
bhi _0805AE02
lsls r0, r0, #2
ldr r1, _0805AD38 @ _0805AD3C
adds r0, r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_0805AD34: .4byte gUnknown_085C72AC
_0805AD38: .4byte _0805AD3C
_0805AD3C: @ jump table
.4byte _0805AD50 @ case 0
.4byte _0805AD7C @ case 1
.4byte _0805ADA8 @ case 2
.4byte _0805ADD4 @ case 3
.4byte _0805AD50 @ case 4
_0805AD50:
movs r2, #2
ldrsh r0, [r6, r2]
lsls r0, r0, #0xc
ldrh r1, [r6, #4]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805AD78 @ gUnknown_085C7438
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0x48
b _0805ADF8
.align 2, 0
_0805AD78: .4byte gUnknown_085C7438
_0805AD7C:
movs r1, #2
ldrsh r0, [r6, r1]
lsls r0, r0, #0xc
ldrh r1, [r6, #4]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805ADA4 @ gUnknown_085C7338
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0x20
b _0805ADF8
.align 2, 0
_0805ADA4: .4byte gUnknown_085C7338
_0805ADA8:
movs r1, #2
ldrsh r0, [r6, r1]
lsls r0, r0, #0xc
ldrh r1, [r6, #4]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805ADD0 @ gUnknown_085C7338
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0x40
b _0805ADF8
.align 2, 0
_0805ADD0: .4byte gUnknown_085C7338
_0805ADD4:
movs r1, #2
ldrsh r0, [r6, r1]
lsls r0, r0, #0xc
ldrh r1, [r6, #4]
orrs r0, r1
movs r2, #0xc0
lsls r2, r2, #4
adds r1, r2, #0
orrs r0, r1
lsls r0, r0, #0x10
lsrs r0, r0, #0x10
ldr r2, _0805AE10 @ gUnknown_085C7438
str r0, [sp]
movs r0, #0
str r0, [sp, #4]
movs r0, #4
str r0, [sp, #8]
movs r0, #0x78
_0805ADF8:
movs r1, #0x68
movs r3, #2
bl NewEkrsubAnimeEmulator
str r0, [r6, #0x14]
_0805AE02:
add sp, #0xc
pop {r3, r4}
mov r8, r3
mov r9, r4
pop {r4, r5, r6, r7}
pop {r0}
bx r0
.align 2, 0
_0805AE10: .4byte gUnknown_085C7438
THUMB_FUNC_END sub_805AA68
.align 2, 0

View File

@ -2,185 +2,6 @@
.SYNTAX UNIFIED
THUMB_FUNC_START sub_80CDDF0
sub_80CDDF0: @ 0x080CDDF0
push {r4, r5, r6, r7, lr}
adds r4, r0, #0
ldr r5, [r4, #0x14]
ldr r7, [r5, #0x14]
adds r0, r5, #0
adds r0, #0x38
ldrb r0, [r0]
bl GetUnitFromCharId
adds r6, r0, #0
cmp r6, #0
bne _080CDE10
adds r0, r4, #0
bl Proc_End
b _080CDE6A
_080CDE10:
bl GetGameLock
lsls r0, r0, #0x18
lsrs r0, r0, #0x18
adds r1, r4, #0
adds r1, #0x4c
strh r0, [r1]
ldr r2, _080CDE58 @ gLCDControlBuffer
ldrb r1, [r2, #1]
movs r0, #0x21
negs r0, r0
ands r0, r1
movs r1, #0x41
negs r1, r1
ands r0, r1
movs r1, #0x7f
ands r0, r1
strb r0, [r2, #1]
adds r0, r5, #0
adds r0, #0x3b
ldrb r1, [r0]
movs r2, #1
negs r2, r2
adds r0, r6, #0
movs r3, #0
bl ExecUnitPromotion
adds r0, r7, #0
adds r0, #0x31
ldrb r0, [r0]
cmp r0, #2
beq _080CDE60
ldr r1, _080CDE5C @ gBattleStats
movs r0, #0x88
lsls r0, r0, #1
b _080CDE64
.align 2, 0
_080CDE58: .4byte gLCDControlBuffer
_080CDE5C: .4byte gBattleStats
_080CDE60:
ldr r1, _080CDE70 @ gBattleStats
movs r0, #0x10
_080CDE64:
strh r0, [r1]
bl BeginBattleAnimations
_080CDE6A:
pop {r4, r5, r6, r7}
pop {r0}
bx r0
.align 2, 0
_080CDE70: .4byte gBattleStats
THUMB_FUNC_END sub_80CDDF0
THUMB_FUNC_START sub_80CDE74
sub_80CDE74: @ 0x080CDE74
push {r4, r5, lr}
adds r5, r0, #0
adds r0, #0x4c
movs r1, #0
ldrsh r4, [r0, r1]
bl GetGameLock
lsls r0, r0, #0x18
lsrs r0, r0, #0x18
cmp r4, r0
bne _080CDE90
adds r0, r5, #0
bl Proc_Break
_080CDE90:
pop {r4, r5}
pop {r0}
bx r0
THUMB_FUNC_END sub_80CDE74
THUMB_FUNC_START sub_80CDE98
sub_80CDE98: @ 0x080CDE98
push {lr}
ldr r0, [r0, #0x14]
adds r0, #0x38
ldrb r0, [r0]
bl GetUnitFromCharId
pop {r0}
bx r0
THUMB_FUNC_END sub_80CDE98
THUMB_FUNC_START PromoMain_PostSelect
PromoMain_PostSelect: @ 0x080CDEA8
push {r4, r5, lr}
sub sp, #4
adds r4, r0, #0
ldr r5, [r4, #0x14]
ldr r1, _080CDF40 @ gUnknown_03005398
movs r2, #1
negs r2, r2
adds r0, r2, #0
strb r0, [r1]
bl sub_808F270
bl ResetDialogueScreen
bl APProc_DeleteAll
bl EndBG3Slider_
ldr r3, _080CDF44 @ gLCDControlBuffer
ldrb r2, [r3, #0xc]
movs r1, #4
negs r1, r1
adds r0, r1, #0
ands r0, r2
strb r0, [r3, #0xc]
ldrb r2, [r3, #0x10]
adds r0, r1, #0
ands r0, r2
movs r2, #1
orrs r0, r2
strb r0, [r3, #0x10]
ldrb r0, [r3, #0x14]
ands r1, r0
movs r0, #2
orrs r1, r0
strb r1, [r3, #0x14]
ldrb r0, [r3, #0x18]
movs r1, #3
orrs r0, r1
strb r0, [r3, #0x18]
movs r0, #3
movs r1, #0
movs r2, #0
movs r3, #0x10
bl SetSpecialColorEffectsParameters
movs r0, #1
str r0, [sp]
movs r1, #1
movs r2, #1
movs r3, #1
bl SetBlendTargetA
adds r0, r4, #0
bl EndAllProcChildren
ldr r0, _080CDF48 @ ProcScr_PromoPostSel
adds r1, r4, #0
bl Proc_StartBlocking
adds r0, r5, #0
adds r0, #0x31
ldrb r0, [r0]
cmp r0, #0
beq _080CDF38
ldr r1, [r5, #0x3c]
movs r0, #1
negs r0, r0
cmp r1, r0
beq _080CDF38
ldr r0, [r5, #0x38]
bl UnitUpdateUsedItem
_080CDF38:
add sp, #4
pop {r4, r5}
pop {r0}
bx r0
.align 2, 0
_080CDF40: .4byte gUnknown_03005398
_080CDF44: .4byte gLCDControlBuffer
_080CDF48: .4byte ProcScr_PromoPostSel
THUMB_FUNC_END PromoMain_PostSelect
THUMB_FUNC_START sub_80CDF4C
sub_80CDF4C: @ 0x080CDF4C
push {r4, lr}
@ -234,7 +55,7 @@ sub_80CDF88: @ 0x080CDF88
movs r1, #0x10
movs r2, #8
bl PutSprite
ldr r5, _080CE018 @ gUnknown_08B12AA4
ldr r5, _080CE018 @ gpBuf
ldr r0, [r5]
adds r0, #0x2f
ldrb r0, [r0]
@ -292,7 +113,7 @@ _080CDFBC:
b _080CE11A
.align 2, 0
_080CE014: .4byte gUnknown_08B12AA8
_080CE018: .4byte gUnknown_08B12AA4
_080CE018: .4byte gpBuf
_080CE01C: .4byte gUnknown_08B12AC2
_080CE020: .4byte gUnknown_08B12AD0
_080CE024:
@ -322,7 +143,7 @@ _080CE04A:
cmp r0, #6
ble _080CE11A
_080CE054:
ldr r4, _080CE090 @ gUnknown_08B12AA4
ldr r4, _080CE090 @ gpBuf
ldr r0, [r4]
adds r0, #0x2a
ldrb r0, [r0]
@ -353,7 +174,7 @@ _080CE070:
blt _080CE0A4
b _080CE11A
.align 2, 0
_080CE090: .4byte gUnknown_08B12AA4
_080CE090: .4byte gpBuf
_080CE094: .4byte 0x000030E0
_080CE098:
adds r0, r1, #0
@ -419,7 +240,7 @@ _080CE0F8:
movs r3, #0
bl DisplayUiVArrow
_080CE11A:
ldr r0, _080CE144 @ gUnknown_08B12AA4
ldr r0, _080CE144 @ gpBuf
ldr r0, [r0]
adds r1, r0, #0
adds r1, #0x2c
@ -438,7 +259,7 @@ _080CE11A:
bx r0
.align 2, 0
_080CE140: .4byte 0x000030E0
_080CE144: .4byte gUnknown_08B12AA4
_080CE144: .4byte gpBuf
THUMB_FUNC_END sub_80CDF88
@ -446,7 +267,7 @@ _080CE144: .4byte gUnknown_08B12AA4
sub_80CE148: @ 0x080CE148
push {r4, lr}
sub sp, #8
ldr r4, _080CE1B0 @ gUnknown_08B12AA4
ldr r4, _080CE1B0 @ gpBuf
ldr r1, [r4]
adds r0, r1, #0
adds r0, #0x30
@ -493,7 +314,7 @@ _080CE1A8:
pop {r0}
bx r0
.align 2, 0
_080CE1B0: .4byte gUnknown_08B12AA4
_080CE1B0: .4byte gpBuf
_080CE1B4: .4byte 0x000005D4
_080CE1B8: .4byte gUnknown_02023130
_080CE1BC: .4byte gUnknown_08B12B04
@ -507,7 +328,7 @@ sub_80CE1C0: @ 0x080CE1C0
adds r5, r0, #0
adds r6, r1, #0
adds r7, r2, #0
ldr r4, _080CE1F8 @ gUnknown_08B12AA4
ldr r4, _080CE1F8 @ gpBuf
lsls r1, r6, #3
adds r1, #0x7c
ldr r0, [r4]
@ -529,7 +350,7 @@ sub_80CE1C0: @ 0x080CE1C0
ldr r0, [r0]
b _080CE210
.align 2, 0
_080CE1F8: .4byte gUnknown_08B12AA4
_080CE1F8: .4byte gpBuf
_080CE1FC: .4byte gUnknown_08B12AE0
_080CE200:
ldr r1, _080CE23C @ gUnknown_08B12B04
@ -543,7 +364,7 @@ _080CE200:
_080CE210:
bl GetStringFromIndex
adds r3, r0, #0
ldr r0, _080CE240 @ gUnknown_08B12AA4
ldr r0, _080CE240 @ gpBuf
lsls r1, r6, #3
adds r1, #0x7c
ldr r0, [r0]
@ -563,7 +384,7 @@ _080CE210:
bx r0
.align 2, 0
_080CE23C: .4byte gUnknown_08B12B04
_080CE240: .4byte gUnknown_08B12AA4
_080CE240: .4byte gpBuf
_080CE244: .4byte gUnknown_020234AC
THUMB_FUNC_END sub_80CE1C0
@ -571,7 +392,7 @@ _080CE244: .4byte gUnknown_020234AC
THUMB_FUNC_START sub_80CE248
sub_80CE248: @ 0x080CE248
push {r4, r5, r6, lr}
ldr r0, _080CE260 @ gUnknown_08B12AA4
ldr r0, _080CE260 @ gpBuf
ldr r1, [r0]
adds r0, r1, #0
adds r0, #0x30
@ -582,7 +403,7 @@ sub_80CE248: @ 0x080CE248
adds r0, #0x3c
b _080CE268
.align 2, 0
_080CE260: .4byte gUnknown_08B12AA4
_080CE260: .4byte gpBuf
_080CE264:
adds r0, r1, #0
adds r0, #0x3d
@ -687,7 +508,7 @@ sub_80CE2FC: @ 0x080CE2FC
adds r0, r4, #0
movs r1, #6
bl __modsi3
ldr r5, _080CE37C @ gUnknown_08B12AA4
ldr r5, _080CE37C @ gpBuf
lsls r0, r0, #3
adds r6, r0, #0
adds r6, #0xb4
@ -739,7 +560,7 @@ _080CE342:
pop {r0}
bx r0
.align 2, 0
_080CE37C: .4byte gUnknown_08B12AA4
_080CE37C: .4byte gpBuf
_080CE380: .4byte gUnknown_08B19E0C
_080CE384: .4byte gUnknown_020235FE
@ -755,7 +576,7 @@ sub_80CE388: @ 0x080CE388
adds r0, r4, #0
movs r1, #6
bl __modsi3
ldr r5, _080CE408 @ gUnknown_08B12AA4
ldr r5, _080CE408 @ gpBuf
lsls r0, r0, #3
adds r6, r0, #0
adds r6, #0xb4
@ -807,7 +628,7 @@ _080CE3CE:
pop {r0}
bx r0
.align 2, 0
_080CE408: .4byte gUnknown_08B12AA4
_080CE408: .4byte gpBuf
_080CE40C: .4byte gUnknown_08B19E0C
_080CE410: .4byte gUnknown_0202387E
@ -825,7 +646,7 @@ sub_80CE414: @ 0x080CE414
str r0, [sp, #8]
movs r5, #0
mov r8, r5
ldr r0, _080CE47C @ gUnknown_08B12AA4
ldr r0, _080CE47C @ gpBuf
ldr r0, [r0]
adds r0, #0x3e
mov r1, r8
@ -842,7 +663,7 @@ _080CE43C:
lsls r0, r0, #0x18
cmp r0, #0
beq _080CE4A8
ldr r0, _080CE47C @ gUnknown_08B12AA4
ldr r0, _080CE47C @ gpBuf
ldr r2, [r0]
adds r0, r2, #0
adds r0, #0x30
@ -868,7 +689,7 @@ _080CE43C:
strb r2, [r0]
b _080CE4A6
.align 2, 0
_080CE47C: .4byte gUnknown_08B12AA4
_080CE47C: .4byte gpBuf
_080CE480: .4byte gUnknown_08B19E0C
_080CE484:
adds r0, r2, #0
@ -900,7 +721,7 @@ _080CE4A8:
cmp r0, #0xc
bne _080CE43C
_080CE4B8:
ldr r1, _080CE580 @ gUnknown_08B12AA4
ldr r1, _080CE580 @ gpBuf
ldr r0, [r1]
adds r0, #0x3e
strb r5, [r0]
@ -998,7 +819,7 @@ _080CE56C:
bx r0
.align 2, 0
_080CE57C: .4byte gUnknown_08B19E0C
_080CE580: .4byte gUnknown_08B12AA4
_080CE580: .4byte gpBuf
_080CE584: .4byte gUnknown_020234BE
THUMB_FUNC_END sub_80CE414
@ -1100,7 +921,7 @@ _080CE61E:
adds r6, r0, #0
cmp r6, #0
bne _080CE61C
ldr r0, _080CE654 @ gUnknown_08B12AA4
ldr r0, _080CE654 @ gpBuf
ldr r1, [r0]
adds r1, #0x3f
strb r4, [r1]
@ -1121,7 +942,7 @@ _080CE61E:
adds r7, r1, #0
b _080CE660
.align 2, 0
_080CE654: .4byte gUnknown_08B12AA4
_080CE654: .4byte gpBuf
_080CE658:
subs r7, #4
cmp r7, #0
@ -1139,7 +960,7 @@ _080CE660:
beq _080CE73A
_080CE672:
bl sub_80CE588
ldr r5, _080CE6C0 @ gUnknown_08B12AA4
ldr r5, _080CE6C0 @ gpBuf
ldr r0, [r5]
adds r0, #0x2e
strb r7, [r0]
@ -1173,7 +994,7 @@ _080CE672:
mov r9, r0
b _080CE71E
.align 2, 0
_080CE6C0: .4byte gUnknown_08B12AA4
_080CE6C0: .4byte gpBuf
_080CE6C4: .4byte gUnknown_08B19E0C
_080CE6C8: .4byte gUnknown_020235FC
_080CE6CC:
@ -1183,7 +1004,7 @@ _080CE6CC:
movs r1, #5
bl __modsi3
adds r4, r0, #0
ldr r5, _080CE748 @ gUnknown_08B12AA4
ldr r5, _080CE748 @ gpBuf
lsls r4, r4, #3
adds r4, #0xbc
ldr r0, [r5]
@ -1240,7 +1061,7 @@ _080CE73A:
pop {r0}
bx r0
.align 2, 0
_080CE748: .4byte gUnknown_08B12AA4
_080CE748: .4byte gpBuf
_080CE74C: .4byte gUnknown_020234BE
THUMB_FUNC_END sub_80CE5F0
@ -1256,7 +1077,7 @@ sub_80CE750: @ 0x080CE750
mov r9, r1
movs r4, #0xd0
lsls r4, r4, #1
ldr r0, _080CE774 @ gUnknown_08B12AA4
ldr r0, _080CE774 @ gpBuf
ldr r0, [r0]
adds r0, #0x2f
ldrb r0, [r0]
@ -1266,7 +1087,7 @@ sub_80CE750: @ 0x080CE750
beq _080CE7DC
b _080CE83A
.align 2, 0
_080CE774: .4byte gUnknown_08B12AA4
_080CE774: .4byte gpBuf
_080CE778:
movs r0, #0
ldr r7, _080CE7D8 @ gBG1TilemapBuffer
@ -1393,7 +1214,7 @@ sub_80CE858: @ 0x080CE858
mov r8, r0
mov r9, r1
movs r4, #0xa0
ldr r0, _080CE87C @ gUnknown_08B12AA4
ldr r0, _080CE87C @ gpBuf
ldr r0, [r0]
adds r0, #0x2f
ldrb r0, [r0]
@ -1403,7 +1224,7 @@ sub_80CE858: @ 0x080CE858
beq _080CE8E4
b _080CE940
.align 2, 0
_080CE87C: .4byte gUnknown_08B12AA4
_080CE87C: .4byte gpBuf
_080CE880:
movs r0, #0
ldr r7, _080CE8E0 @ gBG1TilemapBuffer
@ -1529,7 +1350,7 @@ sub_80CE95C: @ 0x080CE95C
bl __modsi3
adds r4, r0, #0
ldr r2, _080CE998 @ gUnknown_08B19E0C
ldr r0, _080CE99C @ gUnknown_08B12AA4
ldr r0, _080CE99C @ gpBuf
ldr r0, [r0]
adds r1, r0, #0
adds r1, #0x2b
@ -1549,7 +1370,7 @@ sub_80CE95C: @ 0x080CE95C
b _080CE9A2
.align 2, 0
_080CE998: .4byte gUnknown_08B19E0C
_080CE99C: .4byte gUnknown_08B12AA4
_080CE99C: .4byte gpBuf
_080CE9A0:
subs r5, #1
_080CE9A2:
@ -1561,7 +1382,7 @@ _080CE9A2:
cmp r6, #0
bne _080CE9A0
_080CE9B2:
ldr r5, _080CE9E0 @ gUnknown_08B12AA4
ldr r5, _080CE9E0 @ gpBuf
lsls r4, r4, #3
adds r4, #0xbc
ldr r0, [r5]
@ -1583,7 +1404,7 @@ _080CE9B2:
pop {r0}
bx r0
.align 2, 0
_080CE9E0: .4byte gUnknown_08B12AA4
_080CE9E0: .4byte gpBuf
_080CE9E4: .4byte gUnknown_0202393E
THUMB_FUNC_END sub_80CE95C
@ -1738,7 +1559,7 @@ sub_80CEAE8: @ 0x080CEAE8
movs r5, #0
ldr r3, _080CEB5C @ gUnknown_08B19E0C
movs r1, #0
ldr r2, _080CEB60 @ gUnknown_08B12AA4
ldr r2, _080CEB60 @ gpBuf
_080CEAF4:
mov r4, sp
adds r0, r4, r5
@ -1769,7 +1590,7 @@ _080CEB22:
cmp r4, #0xc
bne _080CEB10
_080CEB2A:
ldr r0, _080CEB60 @ gUnknown_08B12AA4
ldr r0, _080CEB60 @ gpBuf
ldr r1, [r0]
adds r1, #0x3d
movs r2, #0
@ -1796,7 +1617,7 @@ _080CEB3A:
b _080CEB8C
.align 2, 0
_080CEB5C: .4byte gUnknown_08B19E0C
_080CEB60: .4byte gUnknown_08B12AA4
_080CEB60: .4byte gpBuf
_080CEB64:
movs r3, #0
ldrb r2, [r2]
@ -1842,7 +1663,7 @@ sub_80CEBA4: @ 0x080CEBA4
movs r5, #0
ldr r6, _080CEC20 @ gUnknown_08B19E0C
movs r4, #0xff
ldr r3, _080CEC24 @ gUnknown_08B12AA4
ldr r3, _080CEC24 @ gpBuf
movs r2, #0
_080CEBB2:
mov r1, sp
@ -1877,7 +1698,7 @@ _080CEBE6:
cmp r2, #0xc
bne _080CEBD2
_080CEBEE:
ldr r0, _080CEC24 @ gUnknown_08B12AA4
ldr r0, _080CEC24 @ gpBuf
ldr r1, [r0]
adds r1, #0x3c
movs r2, #0
@ -1905,7 +1726,7 @@ _080CEBFE:
b _080CEC50
.align 2, 0
_080CEC20: .4byte gUnknown_08B19E0C
_080CEC24: .4byte gUnknown_08B12AA4
_080CEC24: .4byte gpBuf
_080CEC28:
movs r4, #0
ldrb r3, [r3]
@ -1997,7 +1818,7 @@ sub_80CECB0: @ 0x080CECB0
movs r0, #0
mov sl, r0
bl SetupBackgrounds
ldr r5, _080CEED0 @ gUnknown_08B12AA4
ldr r5, _080CEED0 @ gpBuf
ldr r0, [r5]
adds r0, #0x2f
mov r1, sl
@ -2204,7 +2025,7 @@ _080CEE44:
movs r1, #0xe0
movs r2, #0x2f
bl PrepStartSideBarScroll
ldr r0, _080CEED0 @ gUnknown_08B12AA4
ldr r0, _080CEED0 @ gpBuf
ldr r0, [r0]
adds r1, r0, #0
adds r1, #0x2c
@ -2227,7 +2048,7 @@ _080CEE44:
pop {r0}
bx r0
.align 2, 0
_080CEED0: .4byte gUnknown_08B12AA4
_080CEED0: .4byte gpBuf
_080CEED4: .4byte gLCDControlBuffer
_080CEED8: .4byte gBG0TilemapBuffer
_080CEEDC: .4byte gBG1TilemapBuffer
@ -2278,7 +2099,7 @@ sub_80CEF10: @ 0x080CEF10
THUMB_FUNC_START sub_80CEF48
sub_80CEF48: @ 0x080CEF48
push {r4, lr}
ldr r1, _080CEF64 @ gUnknown_08B12AA4
ldr r1, _080CEF64 @ gpBuf
ldr r1, [r1]
adds r1, #0x2f
ldrb r2, [r1]
@ -2291,7 +2112,7 @@ sub_80CEF48: @ 0x080CEF48
beq _080CEF72
b _080CEFC0
.align 2, 0
_080CEF64: .4byte gUnknown_08B12AA4
_080CEF64: .4byte gpBuf
_080CEF68: .4byte gKeyStatusPtr
_080CEF6C:
cmp r2, #2
@ -2392,7 +2213,7 @@ _080CF00C:
movs r0, #0x6a
bl m4aSongNumStart
_080CF01E:
ldr r4, _080CF040 @ gUnknown_08B12AA4
ldr r4, _080CF040 @ gpBuf
ldr r1, [r4]
adds r1, #0x2f
ldrb r0, [r1]
@ -2409,7 +2230,7 @@ _080CF01E:
b _080CF43A
.align 2, 0
_080CF03C: .4byte gPlaySt
_080CF040: .4byte gUnknown_08B12AA4
_080CF040: .4byte gpBuf
_080CF044:
movs r0, #0x80
lsls r0, r0, #6
@ -2450,7 +2271,7 @@ _080CF04A:
.align 2, 0
_080CF090: .4byte gUnknown_08B19E0C
_080CF094:
ldr r0, _080CF0B0 @ gUnknown_08B12AA4
ldr r0, _080CF0B0 @ gpBuf
ldr r0, [r0]
adds r1, r0, #0
adds r1, #0x2b
@ -2464,9 +2285,9 @@ _080CF094:
bl sub_80CE5F0
b _080CF43A
.align 2, 0
_080CF0B0: .4byte gUnknown_08B12AA4
_080CF0B0: .4byte gpBuf
_080CF0B4:
ldr r0, _080CF0D0 @ gUnknown_08B12AA4
ldr r0, _080CF0D0 @ gpBuf
ldr r0, [r0]
adds r1, r0, #0
adds r1, #0x2b
@ -2480,7 +2301,7 @@ _080CF0B4:
bl sub_80CE5F0
b _080CF43A
.align 2, 0
_080CF0D0: .4byte gUnknown_08B12AA4
_080CF0D0: .4byte gpBuf
_080CF0D4:
ldr r0, _080CF108 @ gPlaySt
adds r0, #0x41
@ -2491,7 +2312,7 @@ _080CF0D4:
movs r0, #0x6b
bl m4aSongNumStart
_080CF0E6:
ldr r2, _080CF10C @ gUnknown_08B12AA4
ldr r2, _080CF10C @ gpBuf
ldr r0, [r2]
adds r1, r0, #0
adds r1, #0x2f
@ -2510,7 +2331,7 @@ _080CF0E6:
b _080CF43A
.align 2, 0
_080CF108: .4byte gPlaySt
_080CF10C: .4byte gUnknown_08B12AA4
_080CF10C: .4byte gpBuf
_080CF110:
movs r0, #0x80
lsls r0, r0, #5
@ -2541,7 +2362,7 @@ _080CF13C:
movs r0, #0x6a
bl m4aSongNumStart
_080CF14E:
ldr r3, _080CF174 @ gUnknown_08B12AA4
ldr r3, _080CF174 @ gpBuf
ldr r2, [r3]
adds r2, #0x30
ldrb r0, [r2]
@ -2559,12 +2380,12 @@ _080CF14E:
b _080CF17E
.align 2, 0
_080CF170: .4byte gPlaySt
_080CF174: .4byte gUnknown_08B12AA4
_080CF174: .4byte gpBuf
_080CF178:
movs r0, #0xb3
bl UnsetEventId
_080CF17E:
ldr r2, _080CF1A4 @ gUnknown_08B12AA4
ldr r2, _080CF1A4 @ gpBuf
ldr r0, [r2]
adds r0, #0x29
movs r1, #0
@ -2583,10 +2404,10 @@ _080CF17E:
bl Proc_StartBlocking
b _080CF43A
.align 2, 0
_080CF1A4: .4byte gUnknown_08B12AA4
_080CF1A4: .4byte gpBuf
_080CF1A8: .4byte gUnknown_08B12B3C
_080CF1AC:
ldr r6, _080CF1C8 @ gUnknown_08B12AA4
ldr r6, _080CF1C8 @ gpBuf
ldr r3, [r6]
adds r0, r3, #0
adds r0, #0x2f
@ -2602,7 +2423,7 @@ _080CF1BE:
beq _080CF1D4
b _080CF424
.align 2, 0
_080CF1C8: .4byte gUnknown_08B12AA4
_080CF1C8: .4byte gpBuf
_080CF1CC:
cmp r0, #2
bne _080CF1D2
@ -2741,7 +2562,7 @@ _080CF2C6:
ldr r0, _080CF2E0 @ gUnknown_08B12B9C
adds r1, r5, #0
bl Proc_Start
ldr r2, _080CF2E4 @ gUnknown_08B12AA4
ldr r2, _080CF2E4 @ gpBuf
ldr r0, [r2]
adds r0, #0x2b
movs r1, #0
@ -2752,7 +2573,7 @@ _080CF2C6:
b _080CF424
.align 2, 0
_080CF2E0: .4byte gUnknown_08B12B9C
_080CF2E4: .4byte gUnknown_08B12AA4
_080CF2E4: .4byte gpBuf
_080CF2E8:
ldr r0, _080CF348 @ gKeyStatusPtr
ldr r0, [r0]

View File

@ -1,34 +1,7 @@
.section .data
.global ProcScr_PromoPostSel
ProcScr_PromoPostSel: @ 0x08B12A64
@ PROC_WHILE
.short 0x14, 0x0
.word MusicProc4Exists
@ PROC_CALL
.short 0x2, 0x0
.word sub_80CDDF0
@ PROC_REPEAT
.short 0x3, 0x0
.word sub_80CDE74
@ PROC_SLEEP
.short 0xe, 0x8
.word 0x0
@ PROC_CALL
.short 0x2, 0x0
.word sub_80CDE98
@ PROC_SLEEP
.short 0xe, 0x5
.word 0x0
@ PROC_WHILE
.short 0x14, 0x0
.word MusicProc4Exists
@ PROC_END
.short 0x0, 0x0
.word 0x0
.global gUnknown_08B12AA4
gUnknown_08B12AA4: @ 0x08B12AA4
.global gpBuf
gpBuf: @ 0x08B12AA4
@ replacing .incbin "baserom.gba", 0x00b12aa4, 0x4
.4byte gGenericBuffer

View File

@ -99,7 +99,7 @@ enum {
BATTLE_CONFIG_ARENA = (1 << 5),
BATTLE_CONFIG_REFRESH = (1 << 6),
BATTLE_CONFIG_MAPANIMS = (1 << 7),
BATTLE_CONFIG_PROMOTION_CHAR100 = (1 << 8),
BATTLE_CONFIG_PROMOTION_PREP = (1 << 8),
BATTLE_CONFIG_DANCERING = (1 << 9),
};

View File

@ -2,6 +2,12 @@
#include "global.h"
struct TileMapArr {
u32 type : 8;
u32 size : 24;
u16 data[0x259]; /* todo */
};
enum interpolate_method {
INTERPOLATE_LINEAR,
INTERPOLATE_SQUARE,

View File

@ -1,176 +0,0 @@
#include "global.h"
#include "prepscreen.h"
enum promohandler_bmtype
{
PROMO_HANDLER_TYPE_TRANINEE,
PROMO_HANDLER_TYPE_BM,
PROMO_HANDLER_TYPE_PREP,
};
enum promohandler_stat
{
PROMO_HANDLER_STAT_INIT,
PROMO_HANDLER_STAT_IDLE,
PROMO_HANDLER_STAT_END,
};
struct ProcPromoHandler
{
PROC_HEADER;
ProcPtr promo_main;
u8 stat;
u8 bmtype;
s8 u32;
u8 pid;
u8 sel_en;
s8 jid;
struct Unit *unit;
s32 item_slot;
u32 u40;
u32 _u44;
u32 _u48;
u8 u4c;
struct MenuProc* u50;
};
enum promomain_proc_label {
PROMOMAIN_LABEL_START,
PROMOMAIN_LABEL_1,
PROMOMAIN_LABEL_TRAINEE,
PROMOMAIN_LABEL_3,
PROMOMAIN_LABEL_SEL_EN,
PROMOMAIN_LABEL_POST_SEL,
};
enum promomain_stat
{
PROMO_MAIN_STAT_INIT = 0,
PROMO_MAIN_STAT_SELECTION,
PROMO_MAIN_STAT_2,
PROMO_MAIN_STAT_TRAINEE_EVENT = 0xFF,
};
/* Seems like there are a couple of proc structures going on here */
struct ProcPromoMain
{
PROC_HEADER;
u8 stat;
struct Unit *unit;
u32 priv;
ProcPtr sel_en;
u8 pid;
u8 terrain;
s8 _u3a;
s8 jid;
};
struct ProcPromoSel
{
PROC_HEADER;
s8 _u29;
s8 _u2a;
s8 _u2b;
u16 u2c[3];
u16 u32[3];
s16 msg_desc[3];
u16 _u3e;
u8 u40;
u8 menu_index;
u16 pid;
u16 u44;
u8 u46;
u8 u47;
u16 u48;
u8 u4a[3];
u8 _u4d[3];
u32 u50;
ProcPtr menu_proc;
/* ... more maybe */
};
struct ProcPromoTraineeEvent
{
PROC_HEADER;
s8 _u29;
u16 pid;
u16 _u2c;
u8 face;
u8 _u2f;
ProcPtr u30;
};
// ??? MakePromotionScreen(???);
// ??? Make6C_PromotionMain(???);
// ??? PromoMain_InitScreen(???);
// ??? PromoMain_HandleType(???);
// ??? PromoHandleTraineePostType(???);
// ??? PromoMain_HandlePrepEndEffect(???);
// ??? PromoMain_OnEnd(???);
// ??? PromoHandler_SetupAndStartUI(???);
// ??? PromoHandler_SetInitStat(???);
// ??? PromoHandlerIdle(???);
void StartTraineePromoScreen(ProcPtr parent);
void StartPrepScreenPromotion(struct ProcPrepItemUse *proc);
// ??? StartBmPromotion(???);
// ??? ChangeClassDescription(???);
// ??? LoadClassReelFontPalette(???);
// ??? LoadClassNameInClassReelFont(???);
// ??? sub_80CCBD4(???);
// ??? LoadUIForPromoScreen(???);
// ??? sub_80CCC2C(???);
// ??? sub_80CCCA4(???);
// ??? StartPromoClassSelect(???);
// ??? SetupPromotionScreen(???);
// ??? sub_80CCF60(???);
// ??? LoadBattleSpritesForBranchScreen(???);
// ??? sub_80CD1D4(???);
// ??? sub_80CD218(???);
// ??? sub_80CD294(???);
// ??? sub_80CD2CC(???);
// ??? StartAndWaitPromoSelect(???);
// ??? sub_80CD330(???);
// ??? sub_80CD34C(???);
// ??? sub_80CD408(???);
// ??? sub_80CD47C(???);
// ??? LoadClassBattleSprite(???);
// ??? sub_80CD618(???);
// ??? sub_80CD62C(???);
// ??? PromoMain_SetupTraineeEvent(???);
// ??? StartPreTraineePromoEvent(???);
// ??? RemovePromoTraineeEventFace(???);
// ??? PromoTrainee_InitScreen(???);
// ??? PromoTrainee_OnEnd(???);
// ??? PromoTrainee_Talk1(???);
// ??? PromoTrainee_Talk2(???);
// ??? PromoTrainee_Talk3(???);
// ??? PromoTrainee_Talk4(???);
// ??? PromoTrainee_Talk5(???);
// ??? PromoMain_SetupTraineeEvent_(???);
// ??? PromoTraineeEventExists(???);
// ??? sub_80CDA4C(???);
// ??? PromoSelMenu_OnInit(???);
// ??? PromoSelMenu_OnEnd(???);
// ??? sub_80CDAD8(???);
// ??? PromoSelMenu_OnBPress(???);
// ??? PromoSelMenuOnInit(???);
// ??? PromoSelMenuOnEnd(???);
// ??? PromotionCommand_OnSelect(???);
// ??? PromoSelMenuOnPressB(???);
// ??? sub_80CDC48(???);
// ??? PromotionCommand_OnTextDraw(???);
// ??? PromotionCommand_OnChange(???);
// ??? Usability_ThirdPromotionOption(???);
// ??? BuildPromotionMenu(???);
// ??? sub_80CDDD4(???);
// ??? nullsub_61(???);
// ??? Make6C_PromotionMenuSelect(???);
// ??? sub_80CDDF0(???);
// ??? sub_80CDE74(???);
// ??? sub_80CDE98(???);
// ??? PromoMain_PostSelect(???);
void MakePromotionScreen(struct ProcPromoHandler *proc, u8 pid, u8 terrain);
extern struct ProcCmd ProcScr_PromoMain[];

212
include/classchg.h Normal file
View File

@ -0,0 +1,212 @@
#pragma once
#include "global.h"
#include "prepscreen.h"
#include "uimenu.h"
enum promohandler_proc_label {
PROMO_HANDLER_LABEL_REINIT,
PROMO_HANDLER_LABEL_IDLE,
PROMO_HANDLER_LABEL_END,
};
enum promohandler_bmtype {
PROMO_HANDLER_TYPE_TRANINEE,
PROMO_HANDLER_TYPE_BM,
PROMO_HANDLER_TYPE_PREP,
};
enum promohandler_stat {
PROMO_HANDLER_STAT_INIT,
PROMO_HANDLER_STAT_IDLE,
PROMO_HANDLER_STAT_END,
};
struct ProcPromoHandler {
PROC_HEADER;
/* 2C */ ProcPtr promo_main;
/* 30 */ u8 stat;
/* 31 */ u8 bmtype;
/* 32 */ s8 u32;
/* 33 */ u8 pid;
/* 34 */ u8 sel_en;
/* 35 */ s8 jid;
/* 38 */ struct Unit *unit;
/* 3C */ s32 item_slot;
/* 40 */ u32 game_lock;
/* 44 */ u32 _u44;
/* 48 */ u32 _u48;
/* 4C */ u8 u4c;
/* 50 */ struct MenuProc* u50;
};
enum promomain_proc_label {
PROMOMAIN_LABEL_START,
PROMOMAIN_LABEL_1,
PROMOMAIN_LABEL_TRAINEE,
PROMOMAIN_LABEL_3,
PROMOMAIN_LABEL_SEL_EN,
PROMOMAIN_LABEL_POST_SEL,
};
enum promomain_stat {
PROMO_MAIN_STAT_INIT = 0,
PROMO_MAIN_STAT_SELECTION,
PROMO_MAIN_STAT_2,
PROMO_MAIN_STAT_TRAINEE_EVENT = 0xFF,
};
/* Seems like there are a couple of proc structures going on here */
struct ProcPromoMain {
PROC_HEADER;
u8 stat;
struct Unit *unit;
u32 priv;
ProcPtr sel_en;
u8 pid;
u8 terrain;
s8 _u3a;
s8 jid;
};
enum classchg_proc_label {
PROC_CLASSCHG_SEL_INIT,
PROC_CLASSCHG_SEL_1,
PROC_CLASSCHG_SEL_2,
PROC_CLASSCHG_SEL_END1,
PROC_CLASSCHG_SEL_4,
PROC_CLASSCHG_SEL_END2
};
struct ProcPromoSel {
PROC_HEADER;
s8 _u29;
s8 _u2a;
s8 _u2b;
u16 jid[3];
u16 sprite[3];
s16 msg_desc[3];
u16 _u3e;
u8 stat;
u8 menu_index;
u16 pid;
u16 u44;
u8 u46;
u8 u47;
u16 weapon;
u8 use_wpn[3];
u8 _u4d[3];
u32 u50;
ProcPtr menu_proc;
/* ... more maybe */
};
struct ProcPromoTraineeEvent {
PROC_HEADER;
s8 _u29;
u16 pid;
u16 _u2c;
u8 face;
u8 _u2f;
ProcPtr u30;
};
struct ProcClassChgMenuSel {
PROC_HEADER;
STRUCT_PAD(0x29, 0x4C);
u8 unk4C;
struct MenuProc* pmenu;
};
struct ProcClassChgPostConfirm {
PROC_HEADER;
/* 29 */ STRUCT_PAD(0x29, 0x4C);
/* 4C */ s16 game_lock;
};
// extern ??? ProcScr_PromoMain
// extern ??? ProcScr_PromoHandler
extern CONST_DATA struct ProcCmd ProcScr_PromoSelect[];
extern CONST_DATA struct ProcCmd ProcScr_PromoSelectEnd[];
extern CONST_DATA struct ProcCmd ProcScr_PromoSelectEvent[];
extern CONST_DATA struct MenuDef Menu_PromoSubConfirm;
extern CONST_DATA struct MenuDef gMenuDef_PromoSel;
extern CONST_DATA struct ProcCmd ProcScr_ClassChgMenuSel[];
// extern ??? ClassChgMenuRect
extern CONST_DATA struct ProcCmd ProcScr_ClassChgReal[];
// ??? MakePromotionScreen(???);
// ??? Make6C_PromotionMain(???);
void PromoMain_InitScreen(struct ProcPromoMain *proc);
void PromoMain_HandleType(struct ProcPromoMain *proc);
void PromoHandleTraineePostType(struct ProcPromoMain *proc);
void PromoMain_HandlePrepEndEffect(struct ProcPromoMain *proc);
void PromoMain_OnEnd(struct ProcPromoMain *proc);
u32 PromoHandler_SetupAndStartUI(struct ProcPromoHandler *proc);
u8 PromoHandler_SetInitStat(struct ProcPromoHandler *proc);
void PromoHandlerIdle(struct ProcPromoHandler *proc);
void StartTraineePromoScreen(ProcPtr parent);
void StartPrepScreenPromotion(struct ProcPrepItemUse *proc);
void StartBmPromotion(ProcPtr);
void ChangeClassDescription(u32 msg);
void LoadClassReelFontPalette(struct ProcPromoSel *proc, int class_id);
void LoadClassNameInClassReelFont(struct ProcPromoSel *proc);
void ClassChgLoadEfxTerrain(void);
void ClassChgLoadUI(void);
// ??? ClassChgSelDrawPidName(???);
bool Check3rdTraineeEnabled(void);
void RegisterTsaWithOffset(u16 *_dst, u16 *_src, u32 offset);
ProcPtr StartPromoClassSelect(ProcPtr parent);
// ??? NewClassChgMenuSelect(???);
// ??? sub_80CCF60(???);
// ??? LoadBattleSpritesForBranchScreen(???);
// ??? sub_80CD1D4(???);
// ??? PrepClassChgOnCancel(???);
// ??? sub_80CD294(???);
// ??? sub_80CD2CC(???);
// ??? StartAndWaitPromoSelect(???);
// ??? sub_80CD330(???);
void sub_80CD34C(void);
void sub_80CD408(u32, s16, s16);
void sub_80CD47C(int, int, int, int, int);
u8 LoadClassBattleSprite(s16*, u16, u16);
// ??? NewCcramifyEnd(???);
// ??? sub_80CD62C(???);
void PromoMain_SetupTraineeEvent(struct ProcPromoMain *proc);
ProcPtr StartPromoTraineeEvent(ProcPtr proc);
bool RemovePromoTraineeEventFace(void);
void PromoTrainee_InitScreen(struct ProcPromoTraineeEvent *proc);
void PromoTrainee_OnEnd(struct ProcPromoTraineeEvent *proc);
void PromoTrainee_Talk1(struct ProcPromoTraineeEvent *proc);
void PromoTrainee_Talk2(struct ProcPromoTraineeEvent *proc);
void PromoTrainee_Talk3(struct ProcPromoTraineeEvent *proc);
void PromoTrainee_Talk4(struct ProcPromoTraineeEvent *proc);
void PromoTrainee_Talk5(struct ProcPromoTraineeEvent *proc);
// ??? PromoMain_SetupTraineeEvent_(???);
// ??? PromoTraineeEventExists(???);
void sub_80CDA4C(struct MenuProc *proc);
// ??? PromoSubConfirm_OnInit(???);
// ??? PromoSubConfirm_OnEnd(???);
// ??? PromoSubConfirmMenuOnSelect(???);
// ??? ClassChgMenuSel_OnBPress(???);
// ??? ClassChgMenuSelOnInit(???);
// ??? ClassChgMenuSelOnEnd(???);
// ??? ClassChgMenuItem_OnSelect(???);
// ??? ClassChgMenuSelOnPressB(???);
void ClassChgMenuOnDrawCore(struct MenuProc *a, struct MenuItemProc *b, char *c);
// ??? ClassChgMenuItem_OnTextDraw(???);
// ??? ClassChgMenuItem_OnChange(???);
// ??? ClassChgMenuItem_3rdUsability(???);
void ClassChgMenuExec(struct ProcClassChgMenuSel *proc);
void nullsub_80CDDD4(void);
void nullsub_61(void);
ProcPtr NewClassChgMenuSelect(ProcPtr);
void ClassChgExecPromotionReal(struct ProcClassChgPostConfirm *proc);
void ClassChgPostConfirmWaitBanimEnd(struct ProcClassChgPostConfirm *proc);
void sub_80CDE98(struct ProcClassChgPostConfirm *proc);
void ExecClassChgReal(struct ProcPromoMain *proc);
void MakePromotionScreen(struct ProcPromoHandler *proc, u8 pid, u8 terrain);
extern struct ProcCmd ProcScr_PromoMain[];

View File

@ -52,11 +52,11 @@ struct Unknown_030053A0 {
/* 10 */ u16 u10;
/* 14 */ struct Anim *anim1;
/* 18 */ struct Anim *anim2;
/* 1C */ u8 *u1c;
/* 20 */ u8 *u20;
/* 24 */ u8 *u24;
/* 28 */ u8 *u28;
/* 2C */ u8 *_u2c;
/* 1C */ void *u1c;
/* 20 */ void *u20;
/* 24 */ void *u24;
/* 28 */ void *u28;
/* 2C */ void *_u2c;
/* 30 */ struct Unknown_030053E0 * u30;
};

View File

@ -157,7 +157,7 @@ extern int *gpBanimModesLeft;
extern int *gpBanimModesRight;
extern struct ProcEkrBattle *gpProcEkrBattle;
extern struct ProcEkrGauge *gpProcEkrGauge;
// extern ??? gUnknown_02000088
extern u8 gUnknown_02000088[];
extern int gBanimLinkArenaFlag;
extern int gBattleDeamonActive;
@ -597,7 +597,7 @@ void sub_805A940(void*, u16, u16);
void NewEfxAnimeDrvProc(void);
void EndEfxAnimeDrvProc(void);
// ??? ExecAllAIS(???);
// ??? NewEkrUnitMainMini(???);
void NewEkrUnitMainMini(void *);
void sub_805AA28(void*);
// ??? EkrUnitMainMiniMain(???);
// void sub_805AA68(void *);

View File

@ -1990,7 +1990,7 @@ void sub_808E9D8(int);
// ??? sub_808F084(???);
// ??? sub_808F0C4(???);
// ??? sub_808F0EC(???);
void sub_808F128(int, int, int, int, int, int, s8, int);
void sub_808F128(int, int, int, int, int, void *, s8, int);
void sub_808F270(void); // ??? (text related)
bool SomeTalkProcExists(ProcPtr);
// ??? sub_808F2A0(???);

View File

@ -139,15 +139,15 @@ enum
// function decls
struct MenuProc* StartOrphanMenuAdjusted(const struct MenuDef* def, int xSubject, int xTileLeft, int xTileRight);
struct MenuProc* StartMenu(const struct MenuDef* def, struct Proc* parent);
struct MenuProc* StartMenu(const struct MenuDef* def, ProcPtr parent);
struct MenuProc* StartOrphanMenuAt(const struct MenuDef* def, struct MenuRect rect);
struct MenuProc* StartOrphanMenu(const struct MenuDef* def);
struct MenuProc* StartOrphanMenuAdjustedExt(const struct MenuDef* def, int xSubject, int xTileLeft, int xTileRight, int backBg, int tileref, int frontBg, int unk);
struct MenuProc* StartMenuExt(const struct MenuDef* def, int backBg, int tileref, int frontBg, int unk, struct Proc* parent);
struct MenuProc* StartMenuExt(const struct MenuDef* def, int backBg, int tileref, int frontBg, int unk, ProcPtr parent);
struct MenuProc* StartOrphanMenuAtExt(const struct MenuDef* def, struct MenuRect rect, int backBg, int tileref, int frontBg, int unk);
struct MenuProc* StartOrphanMenuExt(const struct MenuDef* def, int backBg, int tileref, int frontBg, int unk);
struct MenuProc* StartMenuAt(const struct MenuDef* def, struct MenuRect rect, struct Proc* parent);
struct MenuProc* StartMenuCore(const struct MenuDef* def, struct MenuRect rect, int backBg, int tileref, int frontBg, int unk, struct Proc* parent);
struct MenuProc* StartMenuAt(const struct MenuDef* def, struct MenuRect rect, ProcPtr parent);
struct MenuProc* StartMenuCore(const struct MenuDef* def, struct MenuRect rect, int backBg, int tileref, int frontBg, int unk, ProcPtr parent);
struct Proc* EndMenu(struct MenuProc* proc);
void EndAllMenus(void);

View File

@ -63,11 +63,11 @@ extern s16 gUnknown_02003FAC[];
// extern ??? gUnknown_0200400C
extern u16 gUnknown_02004054[];
// extern ??? gUnknown_0200407C
// extern ??? gBanimPal1
extern u16 gBanimPal1[];
extern u16 gUnknown_020040AE[];
// extern ??? gUnknown_020040B2
// extern ??? gBanimPal2
// extern ??? gBanimOaml
extern u16 gBanimPal2[];
extern u16 gBanimOaml[];
extern u16 gUnknown_0200422C[];
extern u16 gUnknown_02004254[];
extern s16 gUnknown_020044AC[];
@ -466,12 +466,12 @@ extern struct GMapData gGMData;
// extern ??? gUnknown_03005324
// extern ??? gUnknown_03005349
extern u16 gGmMonsterRnState[];
// extern ??? gUnknown_03005360
// extern ??? gUnknown_03005380
// extern ??? gUnknown_03005398
extern struct Font gFontClassChgMenu;
extern struct Font gFontClassChg;
extern s8 gUnknown_03005398;
// extern ??? gUnknown_030053E0
// extern ??? gUnknown_03005408
extern u16 gUnknown_03005408[];
// extern ??? gSoundInfo
extern struct MusicPlayerInfo gMPlayInfo_SE4_BMP2;
extern struct MusicPlayerInfo gMPlayInfo_SE5_BMP3;
@ -2959,6 +2959,7 @@ extern u16 gUnknown_08A2E8F0[]; // Pal
extern u8 gUnknown_08A301B0[]; // gfx?
extern u16 gUnknown_08A30780[]; // pal
extern u8 gUnknown_08A30800[]; // gfx
extern u16 gUnknown_08A30978[]; // tsa
extern u8 gUnknown_08A30E2C[]; // gfx
extern u8 gUnknown_08A35488[]; // tsa
extern u16 gUnknown_08A3593C[]; // pal
@ -3389,17 +3390,8 @@ extern u16 gPal_TitleSmallLightBubbles[];
// extern ??? gUnknown_08B11C0C
// extern ??? gUnknown_08B11D0C
// extern ??? gUnknown_08B125F4
// extern ??? ProcScr_PromoMain
// extern ??? ProcScr_PromoHandler
extern const struct ProcCmd ProcScr_PromoSelect[];
// extern ??? ProcScr_PromoSelectEnd
// extern ??? ProcScr_PromoSelectEvent
// extern ??? Menu_PromoSel
// extern ??? gMenuDef_PromoSel
// extern ??? ProcScr_PromoMenuSel
// extern ??? PromotionMenuRect
// extern ??? ProcScr_PromoPostSel
// extern ??? gUnknown_08B12AA4
/* #include classchg.h */
// extern ??? gpBuf
// extern ??? gUnknown_08B12AA8
// extern ??? gUnknown_08B12AC2
// extern ??? gUnknown_08B12AD0

View File

@ -137,7 +137,7 @@ SECTIONS
src/banim-ekrgauge.o(.text);
asm/banim-ekrgauge.o(.text);
src/banim-ekrdispup.o(.text);
src/banim-efxHPBar.o(.text);
src/banim-efxhpbar.o(.text);
asm/banim-efxbattle.o(.text);
asm/banim-ekrfxbg.o(.text);
src/banim-efxstatusunit.o(.text);
@ -150,7 +150,8 @@ SECTIONS
asm/banim-main.o(.text);
src/banim-ekrmain.o(.text);
asm/banim-ekrmain.o(.text);
src/banim-ekr805AE40.o(.text);
asm/banim-ekrmainmini.o(.text);
src/banim-ekrmainmini.o(.text);
asm/code_battleanim.o(.text);
asm/banim-efxop.o(.text);
src/banim-ekrdragonstatus.o(.text);
@ -240,9 +241,14 @@ SECTIONS
src/opsubtitle.o(.text);
src/titlescreen.o(.text);
asm/code_80C6474.o(.text);
src/branched_promotion_main.o(.text);
src/branched_promotion.o(.text);
asm/code_80CCA64.o(.text);
src/classchg-main.o(.text);
src/classchg-handler.o(.text);
src/classchg-sel.o(.text);
src/classchg-event.o(.text);
src/classchg-menuconfirm.o(.text);
src/classchg-menuselect.o(.text);
src/classchg-postconfirm.o(.text);
asm/bmguide.o(.text);
asm/m4a_1.o(.text);
src/m4a.o(.text);
asm/libagbsyscall.o(.text);
@ -354,7 +360,7 @@ SECTIONS
. = ALIGN(4); src/banim-ekrlvupfan.o(.rodata);
. = ALIGN(4); src/banim-ekrgauge.o(.rodata);
. = ALIGN(4); src/banim-ekrdispup.o(.rodata);
. = ALIGN(4); src/banim-efxHPBar.o(.rodata);
. = ALIGN(4); src/banim-efxhpbar.o(.rodata);
. = ALIGN(4); data/const_data_DA3A4.o(.rodata);
. = ALIGN(4); src/banim-ekrbattlestarting.o(.rodata);
. = ALIGN(4); data/const_data_DAD68.o(.rodata);
@ -398,8 +404,13 @@ SECTIONS
. = ALIGN(4); src/worldmap_face.o(.rodata);
. = ALIGN(4); data/const_data_205E94.o(.rodata);
. = ALIGN(4); src/opsubtitle.o(.rodata);
. = ALIGN(4); src/branched_promotion_main.o(.rodata);
. = ALIGN(4); src/branched_promotion.o(.rodata);
. = ALIGN(4); src/classchg-main.o(.rodata);
. = ALIGN(4); src/classchg-handler.o(.rodata);
. = ALIGN(4); src/classchg-sel.o(.rodata);
. = ALIGN(4); src/classchg-event.o(.rodata);
. = ALIGN(4); src/classchg-menuconfirm.o(.rodata);
. = ALIGN(4); src/classchg-menuselect.o(.rodata);
. = ALIGN(4); src/bmguide.o(.rodata);
. = ALIGN(4); INCLUDE "linker_script_sound.txt"
. = ALIGN(4); src/agb_sram.o(.rodata);
. = ALIGN(4); *libc.a:vfprintf.o(.rodata);
@ -497,7 +508,7 @@ SECTIONS
. = ALIGN(4); src/banim-ekrgauge.o(.data);
. = ALIGN(4); data/data-ekrgauge.o(.data);
. = ALIGN(4); src/banim-ekrdispup.o(.data);
. = ALIGN(4); src/banim-efxHPBar.o(.data);
. = ALIGN(4); src/banim-efxhpbar.o(.data);
. = ALIGN(4); data/data_banim_5B93D0.o(.data);
. = ALIGN(4); src/banim-ekrbattlestarting.o(.data);
. = ALIGN(4); data/banim-ekrbattlectrl.o(.data);
@ -533,7 +544,7 @@ SECTIONS
. = ALIGN(4); src/monstergen_data.o(.data);
. = ALIGN(4); data/data_bg.o(.data);
. = ALIGN(4); src/ectscr_.o(.data);
. = ALIGN(4); src/branched_promotion_data.o(.data);
. = ALIGN(4); src/classchg-data.o(.data);
. = ALIGN(4); data/data_95DFA4.o(.data);
. = ALIGN(4); data/data_map_anim_frames.o(.data);
. = ALIGN(4); data/data_99D6DC.o(.data);
@ -606,8 +617,13 @@ SECTIONS
. = ALIGN(4); data/data_opsubtitle.o(.data);
. = ALIGN(4); src/titlescreen.o(.data);
. = ALIGN(4); data/data_AA6BFA.o(.data);
. = ALIGN(4); src/branched_promotion_main.o(.data);
. = ALIGN(4); src/branched_promotion.o(.data);
. = ALIGN(4); src/classchg-main.o(.data);
. = ALIGN(4); src/classchg-handler.o(.data);
. = ALIGN(4); src/classchg-sel.o(.data);
. = ALIGN(4); src/classchg-event.o(.data);
. = ALIGN(4); src/classchg-menuconfirm.o(.data);
. = ALIGN(4); src/classchg-menuselect.o(.data);
. = ALIGN(4); src/classchg-postconfirm.o(.data);
. = ALIGN(4); data/data_B12A60.o(.data);
. = ALIGN(4); *libc.a:impure.o(.data);
. = ALIGN(4); *libc.a:locale.o(.data);

View File

@ -19,7 +19,7 @@ struct ProcEkrHensei {
int CheckBanimHensei(void)
{
if (gBattleStats.config & BATTLE_CONFIG_PROMOTION_CHAR100)
if (gBattleStats.config & BATTLE_CONFIG_PROMOTION_PREP)
return true;
return false;

13
src/bmguide.c Normal file
View File

@ -0,0 +1,13 @@
#include "global.h"
const char gProcName_E_guideSub[] = "E_guideSub";
const char gProcName_E_guMenu1ReWrite[] = "E_guMenu1ReWrite";
const char gProcName_E_guMenu2ReWriteFirst[] = "E_guMenu2ReWriteFirst";
const char gProcName_E_guMenu2ReWriteUp[] = "E_guMenu2ReWriteUp";
const char gProcName_E_guMenu2ReWriteDown[] = "E_guMenu2ReWriteDown";
const char gProcName_E_guMess3ReWrite[] = "E_guMess3ReWrite";
const char gProcName_E_Guide[] = "E_Guide";
// Pad the data here so that the linker script doesn't need to specify the
// exact location of data after this file.
const u8 TextFiller[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

View File

@ -116,18 +116,20 @@ void Decompress(const void* src, void* dst)
};
int is_wram;
const struct TileMapArr *tsa = src;
if ((((u32) dst) - VRAM) < VRAM_SIZE)
is_wram = FALSE; // is vram
else
is_wram = TRUE;
func_lut[is_wram + ((((u8 const *) src)[0] & 0xF0) >> 3)](src, dst);
func_lut[is_wram + ((tsa->type & 0xF0) >> 3)](src, dst);
}
int GetDataSize(const void* data)
{
return *((u32 const *) data) >> 8;
const struct TileMapArr *tsa = data;
return tsa->size;
}
void sub_8012F98(struct Struct8012F98 *buf, int arg_1, int arg_2)

View File

@ -20,6 +20,7 @@
#include "bmtarget.h"
#include "popup.h"
#include "bmudisp.h"
#include "classchg.h"
#include "bmusemind.h"
@ -67,9 +68,6 @@ void StartMineAnim(ProcPtr, int, int);
void sub_80831C8(s8, s8);
void sub_808320C(s8, s8);
// code.s
void StartBmPromotion(ProcPtr);
void ExecStandardHeal(ProcPtr proc) {
int amount;

File diff suppressed because it is too large Load Diff

303
src/classchg-event.c Normal file
View File

@ -0,0 +1,303 @@
#include "global.h"
#include "hardware.h"
#include "mu.h"
#include "face.h"
#include "proc.h"
#include "bmio.h"
#include "bmmap.h"
#include "bmudisp.h"
#include "uiutils.h"
#include "scene.h"
#include "bm.h"
#include "ap.h"
#include "bmlib.h"
#include "constants/characters.h"
#include "classchg.h"
void sub_80CD62C(void)
{
BMapDispResume();
RefreshBMapGraphics();
RefreshEntityBmMaps();
MU_EndAll();
MU_Create(gActiveUnit);
RenderBmMap();
RefreshUnitSprites();
}
CONST_DATA struct ProcCmd ProcScr_PromoSelectEvent[] = {
PROC_SLEEP(8),
PROC_NAME("ccramify_event"),
PROC_LABEL(0),
PROC_CALL(PromoTrainee_InitScreen),
PROC_LABEL(1),
PROC_CALL(StartMidFadeFromBlack),
PROC_REPEAT(WaitForFade),
PROC_CALL(PromoTrainee_Talk1),
PROC_WHILE(SomeTalkProcExists),
PROC_CALL(PromoTrainee_Talk2),
PROC_WHILE(SomeTalkProcExists),
PROC_CALL(PromoTrainee_Talk3),
PROC_WHILE(SomeTalkProcExists),
PROC_CALL(PromoTrainee_Talk4),
PROC_WHILE(SomeTalkProcExists),
PROC_CALL(PromoTrainee_Talk5),
PROC_WHILE(SomeTalkProcExists),
PROC_LABEL(3),
PROC_WHILE(RemovePromoTraineeEventFace),
PROC_LABEL(2),
PROC_CALL(PromoTrainee_OnEnd),
PROC_LABEL(4),
PROC_END,
};
void PromoMain_SetupTraineeEvent(struct ProcPromoMain *proc)
{
proc->priv = (u32)StartPromoTraineeEvent(proc);
}
ProcPtr StartPromoTraineeEvent(ProcPtr proc)
{
return Proc_StartBlocking(ProcScr_PromoSelectEvent, proc);
}
bool RemovePromoTraineeEventFace(void)
{
u16 start = gFaces[0]->xPos;
s16 cmp = start;
if (cmp > 0x150) {
return 0;
} else {
struct FaceProc *b = gFaces[1];
struct FaceProc *c = gFaces[2];
struct FaceProc *d = gFaces[3];
gFaces[0]->xPos = start + 4;
d->xPos = start + 4;
c->xPos = start + 4;
b->xPos = start + 4;
return 1;
}
}
void PromoTrainee_InitScreen(struct ProcPromoTraineeEvent *proc)
{
struct ProcPromoMain *parent = proc->proc_parent;
struct Unit *unit;
proc->pid = parent->pid;
unit = GetUnitFromCharId(proc->pid);
if (unit)
proc->face = unit->pCharacterData->portraitId;
else
proc->face = 0;
ResetFaces();
Font_InitForUIDefault();
LoadUiFrameGraphics();
LoadObjUIGfx();
gLCDControlBuffer.bg0cnt.priority = 0;
gLCDControlBuffer.bg1cnt.priority = 2;
gLCDControlBuffer.bg2cnt.priority = 1;
gLCDControlBuffer.bg3cnt.priority = 3;
BG_EnableSyncByMask(2);
EndSlidingWallEffectMaybe();
BG_Fill(gBG2TilemapBuffer, 0);
BG_EnableSyncByMask(0xf);
SetDispEnable(1, 0, 0, 1, 1);
InitTalk(0x200, 3, 1);
SetSpecialColorEffectsParameters(1, 14, 8, 0);
SetBlendTargetA(0, 0, 0, 0, 0);
SetBlendTargetB(0, 0, 0, 1, 0);
}
void PromoTrainee_OnEnd(struct ProcPromoTraineeEvent *proc)
{
struct ProcPromoMain *parent = proc->proc_parent;
parent->stat = PROMO_MAIN_STAT_TRAINEE_EVENT;
ResetDialogueScreen();
EndPrepSpecialCharEffect();
APProc_DeleteAll();
EndBG3Slider_();
BG_SetPosition(1, 0, 0);
BG_SetPosition(2, 0, 0);
BG_SetPosition(4, 0, 0);
BG_SetPosition(8, 0, 0);
BG_EnableSyncByMask(15);
SetDispEnable(1, 1, 1, 1, 1);
}
void PromoTrainee_Talk1(struct ProcPromoTraineeEvent *proc)
{
struct FaceProc *b, *c, *d;
u8 i;
const u32 msgs[3] = {
0xC44, /* [ToggleSmile]Wow... Would you look at[NL]these muscles![A][ToggleSmile] */
0xC48, /* [ToggleSmile]I'm ready to fight now![.][A][ToggleSmile] */
0xC4D /* [ToggleSmile]Oh, my... Look at this![.][A][ToggleSmile] */
};
switch (proc->pid) {
case CHARACTER_AMELIA:
i = 1;
break;
case CHARACTER_EWAN:
i = 2;
break;
case CHARACTER_ROSS:
default:
i = 0;
break;
}
StartTalkFace(proc->face, 0xd4, 0x50, 0x82, 0);
sub_808F128(0x16, 0x12, 0x12, 4, msgs[i], OBJ_VRAM0 + 0x1800, -1, 0);
sub_808E9D8(0xa);
gFaces[0]->displayBits = FACE_DISP_KIND(2) | FACE_DISP_HLAYER(2);
b = gFaces[1];
c = gFaces[2];
d = gFaces[3];
d->displayBits = FACE_DISP_BIT_14;
c->displayBits = FACE_DISP_BIT_14;
b->displayBits = FACE_DISP_BIT_14;
gUnknown_03005398 = -1;
}
void PromoTrainee_Talk2(struct ProcPromoTraineeEvent *proc)
{
u8 i;
const u32 msgs[3] = {
0xC45, /* [ToggleSmile]I had no idea how much[NL]stronger I'd gotten...[A][ToggleSmile] */
0xC49, /* [ToggleSmile]This armor used to be too[.][NL]heavy for me to wear...[.][A][ToggleSmile] */
0xC4E /* [ToggleSmile]Magic used to seem so hard,[.][NL]but I...I think I've got it.[A][ToggleSmile] */
};
switch (proc->pid) {
case CHARACTER_AMELIA:
i = 1;
break;
case CHARACTER_EWAN:
i = 2;
break;
case CHARACTER_ROSS:
default:
i = 0;
break;
}
sub_808F128(0x16, 0x12, 0x12, 4, msgs[i], OBJ_VRAM0 + 0x1800, -1, 0);
sub_808E9D8(0xa);
}
void PromoTrainee_Talk3(struct ProcPromoTraineeEvent *proc)
{
u8 i;
const u32 msgs[3] = {
0xC46, /* [ToggleSmile]Why, I bet I could take on my[.][NL]dad or just about anyone![.][A][ToggleSmile] */
0xC4A, /* [ToggleSmile]But now, it's no problem![.][NL]I've come a long way.[.][A][ToggleSmile] */
0xC4F /* [ToggleSmile]I've turned a corner in my[NL]education. I'm a real mage![.][A][ToggleSmile] */
};
switch (proc->pid) {
case CHARACTER_AMELIA:
i = 1;
break;
case CHARACTER_EWAN:
i = 2;
break;
case CHARACTER_ROSS:
default:
i = 0;
break;
}
sub_808F128(0x16, 0x12, 0x12, 4, msgs[i], OBJ_VRAM0 + 0x1800, -1, 0);
sub_808E9D8(0xa);
}
void PromoTrainee_Talk4(struct ProcPromoTraineeEvent *proc)
{
u8 i;
const u32 msgs[3] = {
0xC47, /* [ToggleSmile]I knew if I worked at it, I'd[.][NL]become a great warrior![.][A][ToggleSmile] */
0xC4B, /* [ToggleSmile]That's right. I'm a real[NL]soldier now![A][ToggleSmile] */
0xC50 /* [ToggleSmile]But I'm not going to stop[.][NL]studying...[.][A][ToggleSmile] */
};
switch (proc->pid) {
case CHARACTER_AMELIA:
i = 1;
break;
case CHARACTER_EWAN:
i = 2;
break;
case CHARACTER_ROSS:
default:
i = 0;
break;
}
sub_808F128(0x16, 0x12, 0x12, 4, msgs[i], OBJ_VRAM0 + 0x1800, -1, 0);
sub_808E9D8(0xa);
}
void PromoTrainee_Talk5(struct ProcPromoTraineeEvent *proc) {
u8 i;
const u32 msgs[3] = {
-1,
0xC4C, /* [ToggleSmile]But I'm not about to stop.[NL]I'm just getting started![.][A][ToggleSmile] */
0xC51 /* [ToggleSmile]Not until I've become a[.][NL]great sage, like my teacher.[A][ToggleSmile] */
};
switch (proc->pid) {
case CHARACTER_AMELIA:
i = 1;
break;
case CHARACTER_EWAN:
i = 2;
break;
case CHARACTER_ROSS:
default:
i = 0;
break;
}
if (msgs[i] == (u32)-1) {
Proc_Goto(proc, 3);
return;
}
else {
sub_808F128(0x16, 0x12, 0x12, 4, msgs[i], OBJ_VRAM0 + 0x1800, -1, 0);
sub_808E9D8(0xa);
}
}
int PromoMain_SetupTraineeEvent_(struct ProcPromoMain *proc) {
PromoMain_SetupTraineeEvent(proc);
return 0;
}
bool PromoTraineeEventExists(struct ProcPromoMain *proc) {
if (proc->stat == PROMO_MAIN_STAT_TRAINEE_EVENT)
return false;
else
return true;
}

246
src/classchg-handler.c Normal file
View File

@ -0,0 +1,246 @@
#include "global.h"
#include "classchg.h"
#include "proc.h"
#include "constants/characters.h"
#include "constants/classes.h"
#include "bmio.h"
#include "bmmap.h"
#include "bmitem.h"
#include "mu.h"
CONST_DATA struct ProcCmd ProcScr_PromoHandler[] = {
PROC_SLEEP(3),
PROC_LABEL(0),
PROC_CALL(PromoHandler_SetInitStat),
PROC_LABEL(1),
PROC_REPEAT(PromoHandlerIdle),
PROC_LABEL(7),
PROC_END,
};
CONST_DATA u32 gUnknown_08B12704[] = {
0x00011e05,
0x28050008,
0x50050003,
0x00080001,
0x00032805,
0x00000000,
};
struct TraineeData {
u8 charId;
u8 promotionLevel;
u8 class;
};
u32 PromoHandler_SetupAndStartUI(struct ProcPromoHandler *proc)
{
struct Unit *unit;
u8 classNumber;
u32 terrain;
struct TraineeData trainees[3] = {
{ CHARACTER_ROSS, 10, CLASS_JOURNEYMAN },
{ CHARACTER_AMELIA, 10, CLASS_RECRUIT },
{ CHARACTER_EWAN, 10, CLASS_PUPIL },
};
switch (gPlaySt.chapterModeIndex) {
case CHAPTER_MODE_EIRIKA:
default:
terrain = TERRAIN_PLAINS;
break;
case CHAPTER_MODE_EPHRAIM:
terrain = TERRAIN_DESERT;
break;
}
if (proc->bmtype == PROMO_HANDLER_TYPE_TRANINEE) {
u8 i;
u8 flag;
proc->bmtype = PROMO_HANDLER_TYPE_TRANINEE;
proc->sel_en = 1;
// This probably loops over trainee units - not sure why it goes to 6 though.
flag = 0;
/* This maybe a bug?
*
* for (i = 0; i < 3; i++) {
*/
for (i = 0; i < 7; i++) {
unit = GetUnitFromCharId(trainees[i].charId);
if (!unit)
flag = true;
if (unit->state & (US_BIT16 | US_DEAD))
flag = true;
if (unit->level < trainees[i].promotionLevel)
flag = true;
classNumber = unit->pClassData->number;
if (classNumber != trainees[i].class)
flag = true;
if (!gPromoJidLut[classNumber][0] && !gPromoJidLut[classNumber][1])
flag = true;
if (!flag) {
if (gPromoJidLut[classNumber][0] && !gPromoJidLut[classNumber][1]) {
proc->jid = gPromoJidLut[classNumber][0];
proc->sel_en = 0;
}
if (!gPromoJidLut[classNumber][0] && gPromoJidLut[classNumber][1]) {
proc->jid = gPromoJidLut[classNumber][1];
proc->sel_en = 0;
}
if (trainees[i].charId != terrain)
MakePromotionScreen(proc, trainees[i].charId, terrain);
else
MakePromotionScreen(proc, trainees[i].charId, TERRAIN_ROAD);
return PROMO_HANDLER_STAT_IDLE;
}
flag = 0;
}
return PROMO_HANDLER_STAT_END;
} else if (proc->bmtype == PROMO_HANDLER_TYPE_BM) {
proc->bmtype = PROMO_HANDLER_TYPE_BM;
proc->sel_en = 1;
unit = GetUnitFromCharId(proc->pid);
classNumber = unit->pClassData->number;
/* If no class to promote, end the handler proc */
if (!gPromoJidLut[classNumber][0] && !gPromoJidLut[classNumber][1])
return PROMO_HANDLER_STAT_END;
if (gPromoJidLut[classNumber][0] && !gPromoJidLut[classNumber][1]) {
proc->jid = gPromoJidLut[classNumber][0];
proc->sel_en = 0;
}
if (!gPromoJidLut[classNumber][0] && gPromoJidLut[classNumber][1]) {
proc->jid = gPromoJidLut[classNumber][1];
proc->sel_en = 0;
}
MakePromotionScreen(proc, proc->pid, TERRAIN_PLAINS);
return PROMO_HANDLER_STAT_IDLE;
} else if (proc->bmtype == PROMO_HANDLER_TYPE_PREP) {
proc->bmtype = PROMO_HANDLER_TYPE_PREP;
proc->sel_en = 1;
unit = GetUnitFromCharId(proc->pid);
classNumber = unit->pClassData->number;
if (!gPromoJidLut[classNumber][0] && !gPromoJidLut[classNumber][1]) {
BMapDispResume();
RefreshBMapGraphics();
return PROMO_HANDLER_STAT_END;
}
if (gPromoJidLut[classNumber][0] && !gPromoJidLut[classNumber][1]) {
proc->jid = gPromoJidLut[classNumber][0];
proc->sel_en = 0;
}
if (!gPromoJidLut[classNumber][0] && gPromoJidLut[classNumber][1]) {
proc->jid = gPromoJidLut[classNumber][1];
proc->sel_en = 0;
}
MakePromotionScreen(proc, proc->pid, TERRAIN_PLAINS);
return PROMO_HANDLER_STAT_IDLE;
}
else
return PROMO_HANDLER_STAT_END;
}
u8 PromoHandler_SetInitStat(struct ProcPromoHandler *proc)
{
proc->stat = PROMO_HANDLER_STAT_INIT;
return 0;
}
void PromoHandlerIdle(struct ProcPromoHandler *proc)
{
switch (proc->stat) {
case PROMO_HANDLER_STAT_IDLE:
default:
return;
case PROMO_HANDLER_STAT_INIT:
proc->stat = PromoHandler_SetupAndStartUI(proc);
break;
case PROMO_HANDLER_STAT_END:
Proc_Break(proc);
break;
}
}
void StartTraineePromoScreen(ProcPtr parent)
{
struct BattleUnit *actor, *target;
struct ProcPromoHandler *proc = Proc_StartBlocking(ProcScr_PromoHandler, parent);
proc->bmtype = PROMO_HANDLER_TYPE_TRANINEE;
proc->u32 = 0;
proc->unit = NULL;
proc->item_slot = -1;
actor = &gBattleActor;
target = &gBattleTarget;
target->weaponBefore = 0;
actor->weaponBefore = 0;
target->weapon = 0;
actor->weapon = 0;
target->statusOut = -1;
}
void StartPrepScreenPromotion(struct ProcPrepItemUse *proc)
{
struct BattleUnit *actor, *target;
struct ProcPromoHandler *new_proc;
struct ProcPrepItemUse *parent;
u32 weapon;
u32 slot = proc->slot;
if (slot != -1) {
struct BattleUnit *actor, *target;
actor = &gBattleActor;
target = &gBattleTarget;
target->weaponBefore = proc->unit->items[slot];
actor->weaponBefore = proc->unit->items[slot];
}
weapon = GetUnitEquippedWeapon(proc->unit);
actor = &gBattleActor;
target = &gBattleTarget;
target->weapon = weapon;
actor->weapon = weapon;
target->statusOut = -1;
new_proc = Proc_StartBlocking(ProcScr_PromoHandler, proc);
new_proc->bmtype = PROMO_HANDLER_TYPE_BM;
new_proc->u32 = 0;
parent = new_proc->proc_parent;
new_proc->pid = parent->unit->pCharacterData->number;
new_proc->unit = parent->unit;
new_proc->item_slot = parent->slot;
}
void StartBmPromotion(ProcPtr proc)
{
struct Unit *unit;
struct ProcPromoHandler *new_proc = Proc_StartBlocking(ProcScr_PromoHandler, proc);
new_proc->bmtype = PROMO_HANDLER_TYPE_PREP;
new_proc->u32 = 0;
unit = GetUnit(gActionData.subjectIndex);
new_proc->pid = unit->pCharacterData->number;
new_proc->unit = GetUnit(gActionData.subjectIndex);
new_proc->item_slot = gActionData.itemSlotIndex;
BMapDispSuspend();
MU_EndAll();
}

View File

@ -1,4 +1,4 @@
#include "branched_promotion.h"
#include "classchg.h"
#include "bm.h"
#include "bmio.h"
@ -11,20 +11,12 @@
#include "statscreen.h"
#include "uiutils.h"
void PromoMain_InitScreen(struct ProcPromoMain *proc);
void PromoMain_HandleType(struct ProcPromoMain *proc);
int PromoMain_SetupTraineeEvent_(struct ProcPromoMain *proc);
bool PromoTraineeEventExists(struct ProcPromoMain *proc);
void PromoHandleTraineePostType(struct ProcPromoMain *proc);
bool StartAndWaitPromoSelect(ProcPtr proc);
u32 sub_80CD330(struct ProcPromoMain *proc);
void PromoMain_PostSelect(struct ProcPromoMain *proc);
void PromoMain_HandlePrepEndEffect(struct ProcPromoMain *proc);
void PromoMain_OnEnd(struct ProcPromoMain *proc);
bool sub_80CD330(struct ProcPromoMain *proc);
CONST_DATA
struct ProcCmd ProcScr_PromoMain[] =
{
CONST_DATA struct ProcCmd ProcScr_PromoMain[] = {
PROC_NAME("ccramify"),
PROC_LABEL(PROMOMAIN_LABEL_START),
@ -45,7 +37,7 @@ PROC_LABEL(PROMOMAIN_LABEL_SEL_EN),
PROC_REPEAT(sub_80CD330),
PROC_LABEL(PROMOMAIN_LABEL_POST_SEL),
PROC_CALL(PromoMain_PostSelect),
PROC_CALL(ExecClassChgReal),
PROC_SLEEP(2),
PROC_LABEL(6),
@ -99,7 +91,7 @@ void PromoMain_InitScreen(struct ProcPromoMain *proc)
SetupBackgrounds(0);
EndGreenTextColorManager();
gparent->u40 = GetGameLock();
gparent->game_lock = GetGameLock();
EndHelpPromptSprite();
EndSmallBrownNameBoxes();
EndAllParallelWorkers();

View File

@ -0,0 +1,85 @@
#include "global.h"
#include "classchg.h"
#include "uimenu.h"
#include "fontgrp.h"
#include "hardware.h"
void sub_80CDA4C(struct MenuProc *proc)
{
int i;
for (i = 0; i < proc->itemCount; i++)
if (proc->menuItems[i]->def->onDraw == 0)
Text_SetXCursor(&proc->menuItems[i]->text, 0);
}
int PromoSubConfirm_OnInit(struct MenuProc *proc)
{
SyncMenuBgs(proc);
return 0;
}
int PromoSubConfirm_OnEnd(struct MenuProc *proc)
{
TileMap_FillRect(TILEMAP_LOCATED(gBG0TilemapBuffer, 8, 4), 0xA, 6, 0);
TileMap_FillRect(TILEMAP_LOCATED(gBG2TilemapBuffer, 8, 4), 0xA, 6, 0);
SetFont(&gFontClassChg);
sub_80CDA4C(proc->proc_parent);
RedrawMenu(proc->proc_parent);
SyncMenuBgs(proc);
return 0;
}
u8 PromoSubConfirmMenuOnSelect(struct MenuProc *proc, struct MenuItemProc *b)
{
if (b->itemNumber == 0) {
ProcPtr found;
EndMenu(proc);
EndMenu(proc->proc_parent);
found = Proc_Find(ProcScr_PromoMain);
EndAllProcChildren(found);
ClassChgLoadEfxTerrain();
Proc_Goto(found, PROMOMAIN_LABEL_POST_SEL);
}
return MENU_ACT_SKIPCURSOR | MENU_ACT_END | MENU_ACT_SND6A;
}
u8 ClassChgMenuSel_OnBPress(struct MenuProc *_proc, struct MenuItemProc *_proc2)
{
return MENU_ACT_SKIPCURSOR | MENU_ACT_END | MENU_ACT_SND6B;
}
CONST_DATA struct MenuItemDef MenuItem_PromoSubConfirm[] = {
{
"\x81\x40\x8c\x88\x92\xe8",
0x23, /* Change */
0, TEXT_COLOR_NORMAL, 0,
MenuAlwaysEnabled,
NULL,
PromoSubConfirmMenuOnSelect,
NULL, NULL
},
{
"\x81\x40\x82\xe2\x82\xdf\x82\xe9",
0x24, /* Cancel */
0, TEXT_COLOR_NORMAL, 1,
MenuAlwaysEnabled,
NULL,
PromoSubConfirmMenuOnSelect,
NULL,
NULL
},
{0},
};
CONST_DATA struct MenuDef Menu_PromoSubConfirm = {
{ 9, 4, 6, 0 },
1,
MenuItem_PromoSubConfirm,
(void(*)(struct MenuProc*)) PromoSubConfirm_OnInit,
(void(*)(struct MenuProc*)) PromoSubConfirm_OnEnd,
NULL,
ClassChgMenuSel_OnBPress,
NULL,
MenuStdHelpBox
};

272
src/classchg-menuselect.c Normal file
View File

@ -0,0 +1,272 @@
#include "global.h"
#include "classchg.h"
#include "uimenu.h"
#include "fontgrp.h"
#include "bmunit.h"
#include "proc.h"
#include "hardware.h"
#include "bmarch.h"
#include "scene.h"
#include "constants/classes.h"
u32 ClassChgMenuSelOnInit(struct MenuProc *proc)
{
SyncMenuBgs(proc);
return 0;
}
u32 ClassChgMenuSelOnEnd(struct MenuProc *proc)
{
SyncMenuBgs(proc);
return 0;
}
u8 ClassChgMenuItem_OnSelect(struct MenuProc *pmenu, struct MenuItemProc *pmitem) {
struct ProcClassChgMenuSel *parent;
struct ProcPromoSel *gparent;
struct ProcPromoMain *ggparent;
parent = pmenu->proc_parent;
gparent = parent->proc_parent;
ggparent = gparent->proc_parent;
if (gparent->stat == 0) {
struct Unit *unit = GetUnitFromCharId(ggparent->pid);
u8 classnumber = unit->pClassData->number;
if (pmitem->itemNumber <= 1) {
classnumber = gPromoJidLut[classnumber][pmitem->itemNumber];
ggparent->jid = classnumber;
} else {
if (pmitem->itemNumber == 2) {
switch (classnumber) {
case CLASS_JOURNEYMAN:
ggparent->jid = CLASS_JOURNEYMAN_T1;
break;
case CLASS_PUPIL:
ggparent->jid = CLASS_PUPIL_T1;
break;
case CLASS_RECRUIT:
ggparent->jid = CLASS_RECRUIT_T1;
break;
default:
ggparent->jid = classnumber;
break;
}
}
}
switch ((u8) ggparent->jid) {
case CLASS_RANGER:
case CLASS_RANGER_F:
if (unit->state & US_IN_BALLISTA) {
TryRemoveUnitFromBallista(unit);
}
break;
}
Font_InitForUI(&gFontClassChgMenu, (void *)BG_VRAM + 0x1000, 0x80, 0x5);
TileMap_FillRect(TILEMAP_LOCATED(gBG0TilemapBuffer, 9, 4), 0xA, 0x6, 0);
BG_EnableSyncByMask(BG0_SYNC_BIT);
StartMenuExt(&Menu_PromoSubConfirm, 2, 0, 0, 0, pmenu);
}
return 0;
}
u8 ClassChgMenuSelOnPressB(struct MenuProc *pmenu, struct MenuItemProc *pmitem) {
struct ProcClassChgMenuSel *parent;
struct ProcPromoSel *gparent;
struct ProcPromoMain *ggparent;
struct ProcPromoHandler *gggparent;
parent = pmenu->proc_parent;
gparent = parent->proc_parent;
ggparent = gparent->proc_parent;
gggparent = ggparent->proc_parent;
if (gggparent->bmtype == PROMO_HANDLER_TYPE_TRANINEE)
return 0;
if (gggparent->bmtype == PROMO_HANDLER_TYPE_BM) {
Proc_End(parent);
Proc_Goto(gparent, PROC_CLASSCHG_SEL_2);
return MENU_ACT_SKIPCURSOR | MENU_ACT_END | MENU_ACT_SND6B;
}
if (gggparent->bmtype == PROMO_HANDLER_TYPE_PREP) {
Proc_End(parent);
Proc_Goto(gparent, PROC_CLASSCHG_SEL_2);
return MENU_ACT_SKIPCURSOR | MENU_ACT_END | MENU_ACT_SND6B;;
}
return 0;
}
void ClassChgMenuOnDrawCore(struct MenuProc *pmenu, struct MenuItemProc *pmitem, char *str)
{
u8 unused_stack[32];
u16 *mapbuf;
if (pmitem->def->color)
Text_SetColorId(&pmitem->text, pmitem->def->color);
if (pmitem->availability == MENU_DISABLED)
Text_SetColorId(&pmitem->text, TEXT_COLOR_GRAY);
sub_8003E00(&pmitem->text, 0, 20);
Text_SetXCursor(&pmitem->text, 8);
Text_AppendString(&pmitem->text, str);
mapbuf = BG_GetMapBuffer(pmenu->frontBg);
Text_Draw(&pmitem->text, &mapbuf[pmitem->yTile * 32 + pmitem->xTile]);
}
int ClassChgMenuItem_OnTextDraw(struct MenuProc *pmenu, struct MenuItemProc *pmitem)
{
u8 unused_stack[0x48];
struct ProcClassChgMenuSel *parent;
struct ProcPromoSel *gparent;
parent = pmenu->proc_parent;
gparent = parent->proc_parent;
ClassChgMenuOnDrawCore(pmenu, pmitem, GetStringFromIndex(GetClassData(gparent->jid[pmitem->itemNumber])->nameTextId));
}
int ClassChgMenuItem_OnChange(struct MenuProc *pmenu, struct MenuItemProc *pmitem)
{
struct ProcClassChgMenuSel *parent;
struct ProcPromoSel *gparent;
parent = pmenu->proc_parent;
gparent = parent->proc_parent;
gparent->stat = 1;
gparent->menu_index = pmitem->itemNumber;
ChangeClassDescription(gparent->msg_desc[gparent->menu_index]);
SetTalkPrintDelay(-1);
}
u8 ClassChgMenuItem_3rdUsability(const struct MenuItemDef * _def, int _number)
{
struct ProcClassChgMenuSel *proc = Proc_Find(ProcScr_ClassChgMenuSel);
struct ProcPromoSel *parent = proc->proc_parent;
struct ProcPromoMain *gparent = parent->proc_parent;
if (Check3rdTraineeEnabled()) {
switch (GetUnitFromCharId(gparent->pid)->pClassData->number) {
case CLASS_JOURNEYMAN:
case CLASS_PUPIL:
case CLASS_RECRUIT:
return MENU_ENABLED;
default:
return MENU_NOTSHOWN;
}
}
return MENU_NOTSHOWN;
}
CONST_DATA struct MenuItemDef gMenuItem_PromoSel[] = {
{
"\x81\x40\x91\xe6\x82\x50\x95\xba\x8e\xed", /* " 第1兵種" */
0,
0x6DC, /* Discard items. Important[NL]items cannot be discarded. */
TEXT_COLOR_NORMAL,
0,
MenuAlwaysEnabled,
ClassChgMenuItem_OnTextDraw,
ClassChgMenuItem_OnSelect,
0,
ClassChgMenuItem_OnChange,
0
},
{
"\x81\x40\x91\xe6\x82\x51\x95\xba\x8e\xed", /* " 第2兵種" */
0,
0x6DC, /* Discard items. Important[NL]items cannot be discarded. */
TEXT_COLOR_NORMAL,
1,
MenuAlwaysEnabled,
ClassChgMenuItem_OnTextDraw,
ClassChgMenuItem_OnSelect,
0,
ClassChgMenuItem_OnChange,
0
},
{
"\x81\x40\x91\xe6\x82\x52\x95\xba\x8e\xed", /* " 第3兵種" */
0,
0x6DC, /* Discard items. Important[NL]items cannot be discarded. */
TEXT_COLOR_NORMAL,
2,
ClassChgMenuItem_3rdUsability,
ClassChgMenuItem_OnTextDraw,
ClassChgMenuItem_OnSelect,
0,
ClassChgMenuItem_OnChange,
0
},
{0}
};
CONST_DATA struct MenuDef gMenuDef_PromoSel = {
.rect = { 16, 2, 8, 0 },
.menuItems = gMenuItem_PromoSel,
.onInit = (void(*)(struct MenuProc*)) ClassChgMenuSelOnInit,
.onEnd = (void(*)(struct MenuProc*)) ClassChgMenuSelOnEnd,
.onBPress = ClassChgMenuSelOnPressB,
};
CONST_DATA struct ProcCmd ProcScr_ClassChgMenuSel[] = {
PROC_SLEEP(6),
PROC_NAME("CCRamifyMenuSelect"),
PROC_CALL(ClassChgMenuExec),
PROC_REPEAT(nullsub_80CDDD4),
PROC_YIELD,
PROC_LABEL(0),
PROC_GOTO(2),
PROC_LABEL(1),
PROC_CALL(nullsub_61),
PROC_LABEL(2),
PROC_END,
};
CONST_DATA struct MenuRect ClassChgMenuRect = {
.x = 1,
.y = 1,
.w = 12,
.h = 0
};
void ClassChgMenuExec(struct ProcClassChgMenuSel *proc)
{
proc->unk4C = 0;
Font_ResetAllocation();
Font_InitForUIDefault();
SetFontGlyphSet(0);
Font_InitForUI(&gFontClassChg, (void *)BG_VRAM + 0x1400, 160, 5);
SetFont(&gFontClassChg);
proc->pmenu = StartMenuCore(
&gMenuDef_PromoSel,
ClassChgMenuRect,
2,
0,
0,
0,
(struct Proc *) proc);
}
void nullsub_80CDDD4(void)
{
return;
}
void nullsub_61(void)
{
return;
}
ProcPtr NewClassChgMenuSelect(ProcPtr parent)
{
return Proc_Start(ProcScr_ClassChgMenuSel, parent);
}

View File

@ -0,0 +1,87 @@
#include "global.h"
#include "classchg.h"
#include "proc.h"
#include "bmbattle.h"
#include "bm.h"
#include "hardware.h"
#include "bmusemind.h"
#include "ap.h"
#include "soundwrapper.h"
CONST_DATA struct ProcCmd ProcScr_ClassChgReal[] = {
PROC_WHILE(MusicProc4Exists),
PROC_CALL(ClassChgExecPromotionReal),
PROC_REPEAT(ClassChgPostConfirmWaitBanimEnd),
PROC_SLEEP(0x8),
PROC_CALL(sub_80CDE98),
PROC_SLEEP(0x5),
PROC_WHILE(MusicProc4Exists),
PROC_END
};
void ClassChgExecPromotionReal(struct ProcClassChgPostConfirm *proc)
{
struct ProcPromoMain *parent = proc->proc_parent;
struct ProcPromoHandler *gparent = parent->proc_parent;
struct Unit *unit = GetUnitFromCharId(parent->pid);
if (unit == NULL) {
Proc_End(proc);
return;
}
proc->game_lock = GetGameLock();
SetWinEnable(0, 0, 0);
ExecUnitPromotion(unit, parent->jid, -1, 0);
if (gparent->bmtype != PROMO_HANDLER_TYPE_PREP)
gBattleStats.config = BATTLE_CONFIG_PROMOTION_PREP | BATTLE_CONFIG_PROMOTION;
else
gBattleStats.config = BATTLE_CONFIG_PROMOTION;
BeginBattleAnimations();
}
void ClassChgPostConfirmWaitBanimEnd(struct ProcClassChgPostConfirm *proc)
{
int game_lock = proc->game_lock;
if (game_lock == GetGameLock())
Proc_Break(proc);
}
void sub_80CDE98(struct ProcClassChgPostConfirm *proc)
{
struct ProcPromoMain *parent = proc->proc_parent;
GetUnitFromCharId(parent->pid);
}
void ExecClassChgReal(struct ProcPromoMain *proc)
{
int slot;
struct ProcPromoHandler *parent = proc->proc_parent;
gUnknown_03005398 = -1;
sub_808F270();
ResetDialogueScreen();
APProc_DeleteAll();
EndBG3Slider_();
gLCDControlBuffer.bg0cnt.priority = 0;
gLCDControlBuffer.bg1cnt.priority = 1;
gLCDControlBuffer.bg2cnt.priority = 2;
gLCDControlBuffer.bg3cnt.priority = 3;
SetSpecialColorEffectsParameters(3, 0, 0, 0x10);
SetBlendTargetA(1, 1, 1, 1, 1);
EndAllProcChildren(proc);
Proc_StartBlocking(ProcScr_ClassChgReal, proc);
if (parent->bmtype != PROMO_HANDLER_TYPE_TRANINEE) {
slot = parent->item_slot;
if (slot != -1)
UnitUpdateUsedItem(parent->unit, slot);
}
}

668
src/classchg-sel.c Normal file
View File

@ -0,0 +1,668 @@
#include "global.h"
#include "classchg.h"
#include "proc.h"
#include "hardware.h"
#include "scene.h"
#include "classdisplayfont.h"
#include "constants/video-global.h"
#include "constants/classes.h"
#include "bmlib.h"
#include "ctc.h"
#include "fontgrp.h"
#include "uiutils.h"
#include "ekrbattle.h"
#include "efxbattle.h"
#include "bmsave.h"
#include "bm.h"
#include "bmio.h"
#include "bmmap.h"
#include "mu.h"
#include "bmudisp.h"
#include "bmitem.h"
#include "prepscreen.h"
void sub_805AE14(void *);
bool sub_805A96C(void *);
void sub_805A990(void *);
void sub_805AA68(void *);
void sub_805AE40(void *, s16, s16, s16, s16);
void ChangeClassDescription(u32 msg) {
SetInitTalkTextFont();
ClearTalkText();
StartTalkMsg(2, 0xF, msg);
SetTalkPrintColor(0);
SetTalkFlag(TALK_FLAG_INSTANTSHIFT);
SetTalkFlag(TALK_FLAG_NOBUBBLE);
SetTalkFlag(TALK_FLAG_NOSKIP);
SetTalkFlag(TALK_FLAG_NOFAST);
SetTalkFlag(TALK_FLAG_SILENT);
SetTalkPrintDelay(4);
}
void LoadClassReelFontPalette(struct ProcPromoSel *proc, int class_id) {
int i;
s8 str[20];
const struct ClassData *class;
u8 _pad_[0xC];
u16 jid = class_id;
proc->u44 = 0;
proc->u46 = 0;
proc->u47 = 0x78;
class = GetClassData(jid);
GetStringFromIndexInBuffer(class->nameTextId, str);
for (i = 0; i < 20 /* sizeof(str) */ && str[i] != '\0'; i++) {
struct ClassDisplayFont *font = GetClassDisplayFontInfo(str[i]);
if (font)
proc->u46 += font->width - font->xBase;
else
proc->u46 += 4;
}
Decompress(&gUnknown_08A36338, OBJ_VRAM0 + 0x1000);
ApplyPalettes(gUnknown_08A372C0, 0x14, 0x2);
}
void LoadClassNameInClassReelFont(struct ProcPromoSel *proc) {
s8 str[0x20];
s32 index;
u8 idx = proc->menu_index;
u16 classNum = proc->jid[idx];
u32 xOffs = 0x74;
const struct ClassData *class = GetClassData(classNum);
GetStringFromIndexInBuffer(class->nameTextId, str);
for (index = 0; index < 0x14 && str[index] != '\0'; index++) {
struct ClassDisplayFont *font = GetClassDisplayFontInfo(str[index]);
if (font) {
if (font->a) {
PutSpriteExt(4, xOffs - font->xBase - 2, font->yBase + 6, font->a, 0x81 << 7);
xOffs += font->width - font->xBase;
}
} else {
xOffs += 4;
}
}
if (proc->u44 < 0xff)
proc->u44++;
}
void ClassChgLoadEfxTerrain(void)
{
EndEfxAnimeDrvProc();
sub_805AA28(&gUnknown_030053A0);
sub_805AE14(&gUnknown_0201FADC);
}
void ClassChgLoadUI(void)
{
u8 *src = gUnknown_08A30800;
u32 off = GetBackgroundTileDataOffset(BG_2);
Decompress(src, (void *)VRAM + 0x3000 + off);
RegisterTsaWithOffset(gBG2TilemapBuffer, gUnknown_08A30978, TILEREF(0x180, BGPAL_TEXT_DEFAULT) + 0x1000);
}
void ClassChgSelDrawPidName(struct ProcPromoSel *proc) {
u8 _pad_[0x16];
const struct ClassData *class;
char *string;
DrawUiFrame(gBG2TilemapBuffer, 2, 1, 10, 6, 0, 1);
SetFontGlyphSet(0);
SetFont(0);
DrawTextInline(
NULL,
TILEMAP_LOCATED(gBG0TilemapBuffer, 3, 2),
TEXT_COLOR_NORMAL, 0, 0x8,
GetStringFromIndex(GetClassData(proc->jid[0])->nameTextId)
);
DrawTextInline(
NULL,
TILEMAP_LOCATED(gBG0TilemapBuffer, 3, 4),
TEXT_COLOR_NORMAL, 0, 0x8,
GetStringFromIndex(GetClassData(proc->jid[1])->nameTextId)
);
}
bool Check3rdTraineeEnabled(void)
{
struct GlobalSaveInfo info;
u8 unlock = ReadGlobalSaveInfo(&info);
if (!unlock) {
InitGlobalSaveInfodata();
ReadGlobalSaveInfo(&info);
}
/* 3rd trainee class can only get access after both Eirka and ephyram played through */
if (info.Eirk_mode_easy || info.Eirk_mode_norm || info.Eirk_mode_hard)
if (info.Ephy_mode_easy || info.Ephy_mode_norm || info.Ephy_mode_hard)
return true;
return false;
}
struct Struct_8A30978 {
u8 a;
u8 b; // Accessed indirectly, strangely
u16 longBuffer[0x4B2];
};
/** todo
* https://decomp.me/scratch/BnY8k
*/
void RegisterTsaWithOffset(u16 *_dst, u16 *_src, u32 offset) {
s16 i, j;
s16 jrange;
u16 *src;
u16 *dst;
u32 word;
u8 mask;
struct Struct_8A30978 *b = (void *)_src;
u16 add = offset;
src = b->longBuffer;
mask = 0xff;
word = *((u32*)b);
jrange = b->a;
i = (word >> 8) & mask;
while (i > 0xc) {
j = jrange;
dst = _dst + i * 32;
while (j >= 0) {
*dst++ = (*src++) + add;
j--;
}
i--;
}
}
ProcPtr StartPromoClassSelect(ProcPtr parent)
{
return Proc_StartBlocking(ProcScr_PromoSelect, parent);
}
void Make6C_PromotionMenuSelect(struct ProcPromoSel* proc) {
struct ProcPromoMain *parent = proc->proc_parent;
struct ProcPromoHandler *grandparent;
struct Unit *unit;
int i, pid;
parent->stat = PROMO_MAIN_STAT_2;
proc->pid = parent->pid;
proc->u50 = 9;
BG_Fill(gBG0TilemapBuffer, 0);
BG_Fill(gBG1TilemapBuffer, 0);
BG_Fill(gBG2TilemapBuffer, 0);
LoadUiFrameGraphics();
LoadObjUIGfx();
sub_80CD47C(0, -1, 0xfb * 2, 0x58, 6);
ClassChgLoadUI();
sub_80CD408(proc->u50, 0x8c * 2, 0x68);
proc->sprite[0] = 0;
proc->sprite[1] = 0;
proc->sprite[2] = 0;
for (i = 1; i < 0x40; i++) {
u16 classFromSwitch;
u16 weapon;
s32 j;
unit = GetUnit(i);
if (!UNIT_IS_VALID(unit))
continue;
if (unit->pCharacterData->number != proc->pid)
continue;
pid = unit->pClassData->number;
weapon = GetUnitEquippedWeapon(unit);
for (j = 0; j < 2; j++) {
proc->jid[j] = gPromoJidLut[pid][j];
proc->use_wpn[j] = LoadClassBattleSprite(&proc->sprite[j], gPromoJidLut[pid][j], weapon);
proc->msg_desc[j] = GetClassData(gPromoJidLut[pid][j])->descTextId;
}
proc->weapon = weapon;
if (Check3rdTraineeEnabled()) {
pid = unit->pClassData->number;
switch (pid) {
case CLASS_JOURNEYMAN:
proc->jid[2] = CLASS_JOURNEYMAN_T1;
proc->use_wpn[2] = LoadClassBattleSprite(&proc->sprite[2], CLASS_JOURNEYMAN_T1, weapon);
proc->msg_desc[2] = GetClassData(CLASS_JOURNEYMAN_T1)->descTextId;
break;
case CLASS_PUPIL:
proc->jid[2] = CLASS_PUPIL_T1;
proc->use_wpn[2] = LoadClassBattleSprite(&proc->sprite[2], CLASS_PUPIL_T1, weapon);
proc->msg_desc[2] = GetClassData(CLASS_PUPIL_T1)->descTextId;
break;
case CLASS_RECRUIT:
proc->jid[2] = CLASS_RECRUIT_T1;
proc->use_wpn[2] = LoadClassBattleSprite(&proc->sprite[2], CLASS_RECRUIT_T1, weapon);
proc->msg_desc[2] = GetClassData(CLASS_RECRUIT_T1)->descTextId;
break;
}
}
break;
}
if (proc->sprite[0] == 0 && proc->sprite[1] == 0) {
proc->sprite[1] = 0;
proc->sprite[0] = 0;
}
proc->stat = 1;
proc->menu_index = 0;
LoadClassReelFontPalette(proc, pid);
LoadClassNameInClassReelFont(proc);
LoadObjUIGfx();
proc->menu_proc = NewClassChgMenuSelect(proc);
grandparent = parent->proc_parent;
if (grandparent->bmtype == PROMO_HANDLER_TYPE_BM) {
EndSlidingWallEffectMaybe();
BG_EnableSyncByMask(0xf);
}
}
void sub_80CCF60(struct ProcPromoSel *proc) {
u16 tmp;
Font_ResetAllocation();
Font_InitForUIDefault();
BG_EnableSyncByMask(BG0_SYNC_BIT | BG1_SYNC_BIT | BG2_SYNC_BIT | BG3_SYNC_BIT);
InitTalk(0x100, 2, 0);
ChangeClassDescription(proc->msg_desc[proc->menu_index]);
SetTalkPrintDelay(-1);
gLCDControlBuffer.bg0cnt.priority = 0;
gLCDControlBuffer.bg1cnt.priority = 2;
gLCDControlBuffer.bg2cnt.priority = 1;
gLCDControlBuffer.bg3cnt.priority = 3;
BG_EnableSyncByMask(BG0_SYNC_BIT | BG1_SYNC_BIT | BG2_SYNC_BIT | BG3_SYNC_BIT);
tmp = REG_BG0CNT;
tmp &= 0xFFFC;
REG_BG0CNT = tmp + 1;
tmp = REG_BG1CNT;
tmp &= 0xFFFC;
REG_BG1CNT = tmp + 1;
tmp = REG_BG2CNT;
tmp &= 0xFFFC;
REG_BG2CNT = tmp + 1;
tmp = REG_BG3CNT;
tmp &= 0xFFFC;
REG_BG3CNT = tmp + 1;
}
void LoadBattleSpritesForBranchScreen(struct ProcPromoSel *proc) {
u32 a;
u8 b;
struct ProcPromoSel *p2;
struct ProcPromoSel *c2;
struct Anim *anim1;
struct Anim *anim2;
struct Unit copied_unit;
void *tmp;
u16 sp58;
anim1 = gUnknown_030053A0.anim1;
anim2 = gUnknown_030053A0.anim2;
p2 = (void *)gUnknown_0201FADC.p1;
c2 = (void *)gUnknown_0201FADC.p2;
a = proc->stat;
tmp = &gUnknown_030053A0;
if (a == 1) {
u16 r4, r6;
s16 i;
struct Unit *unit;
const void * battle_anim_ptr;
u32 battle_anim_id;
u16 ret;
if ((s16) p2->sprite[0] <= 0x117) {
p2->sprite[0] += 12;
c2->sprite[0] += 12;
anim1->xPosition += 12;
anim2->xPosition = anim1->xPosition;
} else {
proc->stat = 2;
}
if (proc->stat == 2) {
EndEfxAnimeDrvProc();
sub_805AA28(&gUnknown_030053A0);
r4 = proc->pid - 1;
r6 = proc->jid[proc->menu_index];
sp58 = 0xffff;
unit = GetUnitFromCharId(proc->pid);
copied_unit = *unit;
copied_unit.pClassData = GetClassData(proc->jid[proc->menu_index]);
battle_anim_ptr = copied_unit.pClassData->pBattleAnimDef;
ret = GetBattleAnimationId(
&copied_unit,
battle_anim_ptr,
(u16) GetUnitEquippedWeapon(&copied_unit),
&battle_anim_id);
for (i = 0; i <= 6; i++) {
if (gUnknown_0895E0A4[i + (s16) r4 * 7] == (s16) r6) {
sp58 = gUnknown_0895EEA4[i + (s16) r4 * 7] - 1;
break;
}
}
sub_80CD47C((s16) ret, (s16) sp58, (s16) (p2->sprite[0] + 0x28), 0x58, 6);
sub_805AE14(&gUnknown_0201FADC);
sub_80CD408(proc->u50, p2->sprite[0], p2->msg_desc[1]);
} else {
goto D1AC;
}
}
++proc; --proc;
b = proc->stat;
tmp = &gUnknown_030053A0;
if (b == 2) {
if ((s16) p2->sprite[0] > 0x82) {
#ifdef NONMATCHING
u16 off = 12;
#else
register u16 off asm("r1") = 12;
#endif // NONMATCHING
p2->sprite[0] -= off;
c2->sprite[0] -= off;
anim1->xPosition -= off;
anim2->xPosition = anim1->xPosition;
} else {
proc->stat = 0;
}
}
D1AC:
if ((u8) sub_805A96C(tmp)) {
sub_805A990(tmp);
}
LoadClassNameInClassReelFont(proc);
return;
}
void sub_80CD1D4(struct ProcPromoSel *proc)
{
struct ProcPromoMain *parent = proc->proc_parent;
struct ProcPromoHandler *gparent = parent->proc_parent;
switch (gparent->bmtype) {
case PROMO_HANDLER_TYPE_TRANINEE:
return;
case PROMO_HANDLER_TYPE_BM:
Proc_End(proc);
Proc_End(parent);
Proc_End(gparent);
sub_805AA28(&gUnknown_030053A0);
sub_805AE14(&gUnknown_0201FADC);
EndEfxAnimeDrvProc();
}
}
void PrepClassChgOnCancel(struct ProcPromoSel *proc)
{
struct ProcPromoMain *parent;
struct ProcPromoHandler *gparent;
struct ProcPrepItemUse *ggparent;
parent = proc->proc_parent;
gparent = parent->proc_parent;
ggparent = gparent->proc_parent;
if (gparent->bmtype == PROMO_HANDLER_TYPE_PREP) {
Proc_End(proc);
Proc_End(parent);
Proc_End(gparent);
sub_805AA28(&gUnknown_030053A0);
sub_805AE14(&gUnknown_0201FADC);
EndEfxAnimeDrvProc();
gActionData.unitActionType = 0;
Proc_Goto(ggparent, PROC_LABEL_PREPITEMUSE_CONFIRM);
BMapDispResume();
RefreshBMapGraphics();
RefreshEntityBmMaps();
RenderBmMap();
RefreshUnitSprites();
MU_EndAll();
MU_Create(gActiveUnit);
}
}
void sub_80CD294(struct ProcPromoSel *proc)
{
struct ProcPromoMain *parent;
struct ProcPromoHandler *gparent;
parent = proc->proc_parent;
gparent = parent->proc_parent;
if (gparent->bmtype == PROMO_HANDLER_TYPE_TRANINEE)
Proc_Goto(proc, 4);
else if (gparent->bmtype == PROMO_HANDLER_TYPE_BM)
Proc_Break(proc);
else if (gparent->bmtype == PROMO_HANDLER_TYPE_PREP)
Proc_Goto(proc, 4);
}
void sub_80CD2CC(struct ProcPromoSel *proc)
{
struct ProcPromoMain *parent;
struct ProcPromoHandler *gparent;
parent = proc->proc_parent;
gparent = parent->proc_parent;
if (gparent->bmtype == PROMO_HANDLER_TYPE_TRANINEE)
Proc_Goto(proc, 5);
else if (gparent->bmtype == PROMO_HANDLER_TYPE_BM)
Proc_Goto(proc, 5);
else if (gparent->bmtype == PROMO_HANDLER_TYPE_PREP)
Proc_Break(proc);
}
bool StartAndWaitPromoSelect(struct ProcPromoMain *proc)
{
struct ProcPromoMain *_proc = (struct ProcPromoMain *)proc;
switch (_proc->stat) {
case PROMO_MAIN_STAT_SELECTION:
return false;
case PROMO_MAIN_STAT_TRAINEE_EVENT:
case PROMO_MAIN_STAT_INIT:
proc->sel_en = StartPromoClassSelect(proc);
_proc->stat = PROMO_MAIN_STAT_SELECTION;
return false;
default:
return true;
}
}
bool sub_80CD330(struct ProcPromoMain *proc)
{
switch (proc->stat) {
case PROMO_MAIN_STAT_INIT:
case PROMO_MAIN_STAT_SELECTION:
return true;
case PROMO_MAIN_STAT_2:
return false;
default:
return true;
}
}
void sub_80CD34C(void)
{
SetSpecialColorEffectsParameters(1, 16, 16, 0);
SetBlendTargetA(0, 1, 0, 0, 0);
SetBlendTargetB(0, 0, 1, 1, 1);
SetWinEnable(1, 0, 0);
SetWin0Box(0, 0, 0xF0, 0xA0);
SetWin0Layers(1, 1, 1, 1, 1);
SetWOutLayers(1, 0, 1, 1, 1);
gLCDControlBuffer.wincnt.win0_enableBlend = true;
gLCDControlBuffer.wincnt.wout_enableBlend = false;
gLCDControlBuffer.bldcnt.target2_bd_on = true;
}
void sub_80CD408(u32 a, s16 b, s16 c) {
gUnknown_0201FADC.things[0] = a;
gUnknown_0201FADC.things[1] = 0xe;
gUnknown_0201FADC.things[2] = 0x380;
gUnknown_0201FADC.things[3] = a;
gUnknown_0201FADC.things[4] = 0xf;
gUnknown_0201FADC.things[5] = 0xf0 << 2;
gUnknown_0201FADC.things[6] = 0;
gUnknown_0201FADC.things[7] = 0xffff;
gUnknown_0201FADC.u1c = 0x06010000;
gUnknown_0201FADC.u20 = gUnknown_020145C8;
sub_805AA68(&gUnknown_0201FADC);
sub_805AE40(&gUnknown_0201FADC, b, c, b + 0x60, c);
}
void sub_80CD47C(int a, int b, int c, int d, int e) {
u16 c1 = c;
u16 d1 = d;
if (gKeyStatusPtr->heldKeys & 0xc)
gUnknown_03005408[0] = 0;
if (gKeyStatusPtr->newKeys & 0x200)
gUnknown_03005408[0] += 1;
NewEfxAnimeDrvProc();
gUnknown_030053A0.u02 = c1;
gUnknown_030053A0.u04 = d1;
gUnknown_030053A0.u0c = 1;
gUnknown_030053A0.u06 = a;
gUnknown_030053A0.u08 = b;
gUnknown_030053A0.u0a = e;
gUnknown_030053A0.u01 = 0;
gUnknown_030053A0.u0e = 0x200;
gUnknown_030053A0.u10 = 0xa;
gUnknown_030053A0.u1c = gUnknown_02000088;
gUnknown_030053A0.u24 = gBanimOaml;
gUnknown_030053A0.u20 = gBanimPal1;
gUnknown_030053A0.u28 = gBanimScrLeft;
gUnknown_030053A0.u30 = &gUnknown_030053E0;
gUnknown_030053E0.u00 = 0x4;
gUnknown_030053E0.u02 = 0;
gUnknown_030053E0.u04 = 0;
gUnknown_030053E0.u06 = 0;
gUnknown_030053E0.u08 = 0;
gUnknown_030053E0.u0e = 0x300;
gUnknown_030053E0.u10 = 0x8;
gUnknown_030053E0.u0a = 0x200;
gUnknown_030053E0.u0c = 0x4;
gUnknown_030053E0.u12 = 0x1;
gUnknown_030053E0.buf = gBG1TilemapBuffer;
gUnknown_030053E0.u18 = gEkrImgBuffer;
gUnknown_030053E0.u1c = (void *)gEkrTsaBuffer;
gUnknown_030053E0.u20 = gUnknown_0201A790;
gUnknown_030053E0.u24 = sub_80CD34C;
sub_806E8F0();
NewEkrUnitMainMini(&gUnknown_030053A0);
}
u8 LoadClassBattleSprite(s16 *sprite, u16 jid, u16 wpn_before)
{
u8 i;
const u16 *anim_instr = GetClassData(jid)->pBattleAnimDef;
u32 item_type = GetItemType(wpn_before);
u16 expected_type = item_type + 0x100;
u8 ret;
*sprite = 0;
for (i = 0; ; i++) {
u16 item = anim_instr[2 * i];
if (item == expected_type) {
*sprite = anim_instr[2 * i + 1] - 1;
}
if (anim_instr[2 * i + 1] == 0) {
break;
}
}
if (*sprite == 0) {
u32 key = 0x109;
for (i = 0; ; i++) {
if (anim_instr[2 * i] == key) {
*sprite = anim_instr[2 * i + 1] - 1;
}
if (anim_instr[2 * i + 1] == 0)
break;
}
}
if (wpn_before == 0)
return false;
if (GetItemRequiredExp(wpn_before) >= GetClassData(jid)->baseRanks[GetItemType(wpn_before)])
return true;
return false;
}
void NewCcramifyEnd(void) {
Proc_Start(ProcScr_PromoSelectEnd, PROC_TREE_3);
}
CONST_DATA struct ProcCmd ProcScr_PromoSelect[] = {
PROC_CALL(StartMidFadeToBlack),
PROC_REPEAT(WaitForFade),
/* ? */
PROC_NAME("ccramify"),
PROC_LABEL(PROC_CLASSCHG_SEL_INIT),
PROC_CALL(Make6C_PromotionMenuSelect),
PROC_SLEEP(6),
PROC_CALL(sub_80CCF60),
PROC_LABEL(PROC_CLASSCHG_SEL_1),
PROC_CALL(StartMidFadeFromBlack),
PROC_REPEAT(WaitForFade),
PROC_REPEAT(LoadBattleSpritesForBranchScreen),
PROC_GOTO(PROC_CLASSCHG_SEL_END1),
/* Pre End */
PROC_LABEL(PROC_CLASSCHG_SEL_2),
PROC_CALL(sub_80CD294),
PROC_CALL(StartMidFadeToBlack),
PROC_REPEAT(WaitForFade),
/* On End */
PROC_LABEL(PROC_CLASSCHG_SEL_4),
PROC_CALL(sub_80CD1D4),
PROC_CALL(sub_80CD2CC),
PROC_SET_END_CB(NewCcramifyEnd),
PROC_CALL(StartMidFadeToBlack),
PROC_REPEAT(WaitForFade),
PROC_CALL(PrepClassChgOnCancel),
PROC_LABEL(PROC_CLASSCHG_SEL_END2),
PROC_LABEL(PROC_CLASSCHG_SEL_END1),
PROC_END,
};
CONST_DATA struct ProcCmd ProcScr_PromoSelectEnd[] = {
PROC_NAME("ccramify_end"),
PROC_CALL(StartMidFadeFromBlack),
PROC_REPEAT(WaitForFade),
PROC_END,
};

View File

@ -186,8 +186,6 @@ extern struct ProcCmd CONST_DATA gProcScr_opinfo[];
extern ProcPtr* gUnknown_03001D50;
extern u16 gUnknown_08A30978[]; // tsa
static inline int DarknessCoeff(int darkness, u8 lsr) {
return 0x10 - (darkness >> (lsr));
}
@ -1488,8 +1486,6 @@ extern u8 gUnknown_0200CB00[];
extern struct TextHandle gUnknown_0201FB28[6];
void NewEkrUnitMainMini(struct Unk200A2D8*);
extern u8 gUnknown_0201DB28[];
const int gUnknown_08205EDC[2][6] = {

View File

@ -89,7 +89,7 @@ int CONST_DATA gUnused_08A196E4[] = {
//! FE8U = 0x080A0724
void sub_80A0724(struct PrepProcA1962C* proc) {
sub_808F128(10, 7, 17, 4, proc->unk_2c, 0x06011000, -1, 0);
sub_808F128(10, 7, 17, 4, proc->unk_2c, OBJ_VRAM0 + 0x1000, -1, 0);
sub_808E9D8(0x7c);
return;
}

View File

@ -16,7 +16,7 @@
#include "fontgrp.h"
#include "uiutils.h"
#include "soundwrapper.h"
#include "branched_promotion.h"
#include "classchg.h"
#include "bmlib.h"
#include "prepscreen.h"

View File

@ -16,7 +16,7 @@
#include "bmudisp.h"
#include "bm.h"
#include "prepscreen.h"
#include "branched_promotion.h"
#include "classchg.h"
s8 CheckInLinkArena();
@ -54,7 +54,7 @@ void DoPromoteAnimForChar100(struct Proc08A184B4 *proc)
SetWinEnable(0, 0, 0);
sub_802F598(unit, -1, 0);
gBattleStats.config = BATTLE_CONFIG_PROMOTION | BATTLE_CONFIG_PROMOTION_CHAR100;
gBattleStats.config = BATTLE_CONFIG_PROMOTION | BATTLE_CONFIG_PROMOTION_PREP;
gBattleActor.weaponBefore = 0;
gBattleTarget.weaponBefore = 0;
BeginBattleAnimations();

View File

@ -92,7 +92,7 @@ struct MenuProc* StartOrphanMenuAdjusted(
return StartMenuAt(def, rect, NULL);
}
struct MenuProc* StartMenu(const struct MenuDef* def, struct Proc* parent)
struct MenuProc* StartMenu(const struct MenuDef* def, ProcPtr parent)
{
return StartMenuAt(def, def->rect, parent);
}
@ -131,7 +131,7 @@ struct MenuProc* StartMenuExt(
int tileref,
int frontBg,
int unk,
struct Proc* parent)
ProcPtr parent)
{
return StartMenuCore(def, def->rect, backBg, tileref, frontBg, unk, parent);
}
@ -160,7 +160,7 @@ struct MenuProc* StartOrphanMenuExt(
struct MenuProc* StartMenuAt(
const struct MenuDef* def,
struct MenuRect rect,
struct Proc* parent)
ProcPtr parent)
{
return StartMenuCore(def, rect, 1, TILEREF(0, 0), 0, 0, parent);
}
@ -172,7 +172,7 @@ struct MenuProc* StartMenuCore(
int tileref,
int frontBg,
int unk,
struct Proc* parent)
ProcPtr parent)
{
struct MenuProc* proc;
int i, itemCount;

View File

@ -164,8 +164,8 @@
. = 0x005324; gUnknown_03005324 = .;
. = 0x005349; gUnknown_03005349 = .;
. = 0x00534E; gGmMonsterRnState = .;
. = 0x005360; gUnknown_03005360 = .;
. = 0x005380; gUnknown_03005380 = .;
. = 0x005360; gFontClassChgMenu = .;
. = 0x005380; gFontClassChg = .;
. = 0x005398; gUnknown_03005398 = .;
. = 0x0053A0; gUnknown_030053A0 = .;
. = 0x0053E0; gUnknown_030053E0 = .;