rmboarder1 decompiled

This commit is contained in:
MokhaLeee 2024-02-20 10:08:52 +00:00
parent db01ec11b6
commit d99dfeda20
8 changed files with 320 additions and 516 deletions

View File

@ -2,419 +2,8 @@
.SYNTAX UNIFIED
THUMB_FUNC_START GmapRmBorder1_End
GmapRmBorder1_End: @ 0x080C2728
push {r4, lr}
adds r4, r0, #0
ldr r0, [r4, #0x34]
bl AP_Delete
ldr r0, [r4, #0x2c]
bl AP_Delete
ldr r0, _080C274C @ ProcScr_GmapRmBorder1
bl CountProcs
cmp r0, #1
bne _080C2746
bl EndGmapRmBaPalAnim1
_080C2746:
pop {r4}
pop {r0}
bx r0
.align 2, 0
_080C274C: .4byte ProcScr_GmapRmBorder1
THUMB_FUNC_END GmapRmBorder1_End
THUMB_FUNC_START GmapRmBorder1_80C2750
GmapRmBorder1_80C2750: @ 0x080C2750
push {r4, r5, lr}
sub sp, #4
adds r5, r0, #0
movs r4, #0
str r4, [sp]
movs r0, #0
movs r1, #0
movs r2, #0
movs r3, #0
bl SetBlendTargetA
str r4, [sp]
movs r0, #0
movs r1, #1
movs r2, #0
movs r3, #0
bl SetBlendTargetB
movs r0, #0
movs r1, #0
movs r2, #0x10
movs r3, #0
bl SetBlendConfig
strh r4, [r5, #0x30]
ldr r0, _080C27A0 @ ProcScr_GmapRmBorder1
bl CountProcs
cmp r0, #1
bgt _080C2798
ldr r0, _080C27A4 @ Pal_WmHighLightNationMap
movs r1, #0xc8
lsls r1, r1, #2
movs r2, #0x20
bl CopyToPaletteBuffer
_080C2798:
add sp, #4
pop {r4, r5}
pop {r0}
bx r0
.align 2, 0
_080C27A0: .4byte ProcScr_GmapRmBorder1
_080C27A4: .4byte Pal_WmHighLightNationMap
THUMB_FUNC_END GmapRmBorder1_80C2750
THUMB_FUNC_START sub_80C27A8
sub_80C27A8: @ 0x080C27A8
push {r4, r5, r6, r7, lr}
mov r7, r8
push {r7}
sub sp, #4
mov r8, r0
adds r7, r1, #0
adds r6, r2, #0
lsls r4, r3, #0x18
lsrs r4, r4, #0x18
mov r5, sp
adds r5, #2
mov r0, sp
adds r1, r5, #0
bl GmapRm_GetPosition
mov r0, sp
movs r1, #0
ldrsh r0, [r0, r1]
subs r7, r7, r0
movs r1, #0
ldrsh r0, [r5, r1]
subs r6, r6, r0
cmp r4, #0
beq _080C27EA
mov r1, r8
ldr r0, [r1, #0x34]
movs r2, #0x80
lsls r2, r2, #3
orrs r2, r6
adds r1, r7, #0
bl AP_Update
b _080C27F6
_080C27EA:
mov r1, r8
ldr r0, [r1, #0x34]
adds r1, r7, #0
adds r2, r6, #0
bl AP_Update
_080C27F6:
add sp, #4
pop {r3}
mov r8, r3
pop {r4, r5, r6, r7}
pop {r0}
bx r0
THUMB_FUNC_END sub_80C27A8
THUMB_FUNC_START GmapRmBorder1_80C2804
GmapRmBorder1_80C2804: @ 0x080C2804
push {r4, r5, r6, lr}
adds r6, r0, #0
ldrh r0, [r6, #0x30]
adds r0, #1
strh r0, [r6, #0x30]
lsls r0, r0, #0x10
asrs r0, r0, #0x10
cmp r0, #0x15
bgt _080C2880
movs r1, #0x30
ldrsh r0, [r6, r1]
movs r1, #0x16
movs r2, #2
bl sub_800B7E0
adds r4, r0, #0
movs r5, #0x80
lsls r5, r5, #5
lsls r1, r4, #4
adds r0, r5, #0
bl DivArm
lsls r1, r0, #0x18
lsrs r1, r1, #0x18
movs r2, #0x10
subs r2, r2, r0
lsls r2, r2, #0x18
lsrs r2, r2, #0x18
movs r0, #0
movs r3, #0
bl SetBlendConfig
subs r4, r5, r4
lsls r1, r4, #3
adds r1, r1, r4
lsls r1, r1, #1
adds r0, r5, #0
bl DivArm
ldr r3, _080C287C @ GfxSet_WmNationMap
adds r1, r6, #0
adds r1, #0x2a
ldrb r2, [r1]
lsls r1, r2, #1
adds r1, r1, r2
lsls r1, r1, #2
adds r1, r1, r3
movs r3, #8
ldrsh r2, [r1, r3]
adds r2, r2, r0
movs r0, #0xa
ldrsh r3, [r1, r0]
adds r0, r6, #0
adds r1, r2, #0
adds r2, r3, #0
movs r3, #1
bl sub_80C27A8
b _080C28BA
.align 2, 0
_080C287C: .4byte GfxSet_WmNationMap
_080C2880:
movs r0, #0
movs r1, #0x10
movs r2, #0x10
movs r3, #0
bl SetBlendConfig
movs r0, #0
strh r0, [r6, #0x30]
ldr r2, _080C28C0 @ GfxSet_WmNationMap
adds r0, r6, #0
adds r0, #0x2a
ldrb r1, [r0]
lsls r0, r1, #1
adds r0, r0, r1
lsls r0, r0, #2
adds r0, r0, r2
movs r1, #8
ldrsh r2, [r0, r1]
movs r1, #0xa
ldrsh r3, [r0, r1]
adds r0, r6, #0
adds r1, r2, #0
adds r2, r3, #0
movs r3, #0
bl sub_80C27A8
adds r0, r6, #0
bl Proc_Break
_080C28BA:
pop {r4, r5, r6}
pop {r0}
bx r0
.align 2, 0
_080C28C0: .4byte GfxSet_WmNationMap
THUMB_FUNC_END GmapRmBorder1_80C2804
THUMB_FUNC_START GmapRmBorder1_80C28C4
GmapRmBorder1_80C28C4: @ 0x080C28C4
push {lr}
ldr r0, _080C28D8 @ ProcScr_GmapRmBorder1
bl CountProcs
cmp r0, #1
bne _080C28D4
bl EndGmapRmBaPalAnim1
_080C28D4:
pop {r0}
bx r0
.align 2, 0
_080C28D8: .4byte ProcScr_GmapRmBorder1
THUMB_FUNC_END GmapRmBorder1_80C28C4
THUMB_FUNC_START GmapRmBorder1_80C28DC
GmapRmBorder1_80C28DC: @ 0x080C28DC
push {r4, r5, r6, lr}
adds r6, r0, #0
ldrh r0, [r6, #0x30]
adds r0, #1
strh r0, [r6, #0x30]
lsls r0, r0, #0x10
asrs r0, r0, #0x10
cmp r0, #0x15
bgt _080C2954
movs r1, #0x30
ldrsh r0, [r6, r1]
movs r1, #0x16
movs r2, #2
bl sub_800B7E0
adds r4, r0, #0
movs r5, #0x80
lsls r5, r5, #5
lsls r1, r4, #4
adds r0, r5, #0
bl DivArm
adds r2, r0, #0
movs r1, #0x10
subs r1, r1, r2
lsls r1, r1, #0x18
lsrs r1, r1, #0x18
lsls r2, r2, #0x18
lsrs r2, r2, #0x18
movs r0, #0
movs r3, #0
bl SetBlendConfig
lsls r1, r4, #3
adds r1, r1, r4
lsls r1, r1, #1
adds r0, r5, #0
bl DivArm
ldr r3, _080C2950 @ GfxSet_WmNationMap
adds r1, r6, #0
adds r1, #0x2a
ldrb r1, [r1]
lsls r2, r1, #1
adds r2, r2, r1
lsls r2, r2, #2
adds r2, r2, r3
movs r3, #8
ldrsh r1, [r2, r3]
subs r1, r1, r0
movs r0, #0xa
ldrsh r2, [r2, r0]
adds r0, r6, #0
movs r3, #1
bl sub_80C27A8
b _080C295E
.align 2, 0
_080C2950: .4byte GfxSet_WmNationMap
_080C2954:
bl SetDefaultColorEffects
adds r0, r6, #0
bl Proc_Break
_080C295E:
pop {r4, r5, r6}
pop {r0}
bx r0
THUMB_FUNC_END GmapRmBorder1_80C28DC
THUMB_FUNC_START GmapRmBorder1_80C2964
GmapRmBorder1_80C2964: @ 0x080C2964
push {r4, lr}
adds r4, r0, #0
ldr r0, _080C2988 @ ProcScr_GmapRmBorder1
bl CountProcs
cmp r0, #1
bgt _080C2980
movs r0, #0
bl StartGmapRmBaPalAnim1
adds r0, r4, #0
movs r1, #1
bl Proc_Goto
_080C2980:
pop {r4}
pop {r0}
bx r0
.align 2, 0
_080C2988: .4byte ProcScr_GmapRmBorder1
THUMB_FUNC_END GmapRmBorder1_80C2964
THUMB_FUNC_START sub_80C298C
sub_80C298C: @ 0x080C298C
push {r4, r5, r6, r7, lr}
sub sp, #4
adds r4, r0, #0
mov r5, sp
adds r5, #2
mov r0, sp
adds r1, r5, #0
bl GmapRm_GetPosition
ldr r6, _080C29F4 @ GfxSet_WmNationMap
adds r7, r4, #0
adds r7, #0x2a
ldrb r1, [r7]
lsls r0, r1, #1
adds r0, r0, r1
lsls r0, r0, #2
adds r0, r0, r6
mov r2, sp
ldrh r1, [r0, #8]
ldrh r2, [r2]
subs r1, r1, r2
ldrh r2, [r0, #0xa]
ldrh r0, [r5]
subs r2, r2, r0
ldr r0, [r4, #0x2c]
lsls r1, r1, #0x10
asrs r1, r1, #0x10
movs r5, #0x80
lsls r5, r5, #3
adds r3, r5, #0
lsls r2, r2, #0x10
asrs r2, r2, #0x10
orrs r2, r3
bl AP_Update
ldrb r1, [r7]
lsls r0, r1, #1
adds r0, r0, r1
lsls r0, r0, #2
adds r0, r0, r6
movs r2, #8
ldrsh r1, [r0, r2]
movs r3, #0xa
ldrsh r2, [r0, r3]
adds r0, r4, #0
movs r3, #0
bl sub_80C27A8
add sp, #4
pop {r4, r5, r6, r7}
pop {r0}
bx r0
.align 2, 0
_080C29F4: .4byte GfxSet_WmNationMap
THUMB_FUNC_END sub_80C298C
THUMB_FUNC_START GmapRmBorder1_80C29F8
GmapRmBorder1_80C29F8: @ 0x080C29F8
push {r4, lr}
adds r4, r0, #0
bl sub_80C298C
bl CheckGmapRmBaPalAnim1State
lsls r0, r0, #0x18
cmp r0, #0
beq _080C2A14
movs r0, #0
strh r0, [r4, #0x30]
adds r0, r4, #0
bl Proc_Break
_080C2A14:
pop {r4}
pop {r0}
bx r0
THUMB_FUNC_END GmapRmBorder1_80C29F8
THUMB_FUNC_START GmapRmBorder1_80C2A1C
GmapRmBorder1_80C2A1C: @ 0x080C2A1C
push {r4, lr}
adds r4, r0, #0
bl sub_80C298C
adds r0, r4, #0
adds r0, #0x29
ldrb r0, [r0]
lsls r0, r0, #0x18
asrs r0, r0, #0x18
cmp r0, #0
beq _080C2A38
adds r0, r4, #0
bl Proc_Break
_080C2A38:
pop {r4}
pop {r0}
bx r0
THUMB_FUNC_END GmapRmBorder1_80C2A1C
THUMB_FUNC_START sub_80C2A40
sub_80C2A40: @ 0x080C2A40
THUMB_FUNC_START StartGmapRmBorder1
StartGmapRmBorder1: @ 0x080C2A40
push {r4, r5, lr}
sub sp, #0x18
movs r4, #0
@ -476,7 +65,7 @@ _080C2AA4:
pop {r1}
bx r1
THUMB_FUNC_END sub_80C2A40
THUMB_FUNC_END StartGmapRmBorder1
THUMB_FUNC_START DrawWmNationHighLightMapGfx
DrawWmNationHighLightMapGfx: @ 0x080C2AAC
@ -509,7 +98,7 @@ WmShowNationHighlightedMap: @ 0x080C2AD4
push {r6, r7}
adds r6, r0, #0
adds r4, r1, #0
bl sub_80C2A40
bl StartGmapRmBorder1
mov r8, r0
cmp r4, #0
beq _080C2AF8
@ -582,8 +171,8 @@ _080C2B78: .4byte 0xFFFF9C00
THUMB_FUNC_END WmShowNationHighlightedMap
THUMB_FUNC_START sub_80C2B7C
sub_80C2B7C: @ 0x080C2B7C
THUMB_FUNC_START EndGmapRmBorder1
EndGmapRmBorder1: @ 0x080C2B7C
push {r4, lr}
sub sp, #0xc
adds r4, r0, #0
@ -620,7 +209,7 @@ _080C2BB8:
.align 2, 0
_080C2BC0: .4byte ProcScr_GmapRmBorder1
THUMB_FUNC_END sub_80C2B7C
THUMB_FUNC_END EndGmapRmBorder1
THUMB_FUNC_START sub_80C2BC4
sub_80C2BC4: @ 0x080C2BC4

View File

@ -1,42 +1,7 @@
.section .rodata
.global GfxSet_WmNationMap
GfxSet_WmNationMap: @ 0x08206AF0
@ Replacing .incbin "baserom.gba", 0x206AF0, 0x80
.4byte Img_WmHightLightMapFrecia
.4byte Ap_WmHightLightMapFrecia
.2byte 54, 40
.4byte Pal_WmHighLightNationMap + 0x60c
.4byte Pal_WmHighLightNationMap + 0xcd0
.4byte 0x00750058
.4byte Pal_WmHighLightNationMap + 0xe0c
.4byte Pal_WmHighLightNationMap + 0x1340
.4byte 0x005700b1
.4byte Pal_WmHighLightNationMap + 0x13a4
.4byte Pal_WmHighLightNationMap + 0x181c
.4byte 0x0039007f
.4byte Pal_WmHighLightNationMap + 0x1878
.4byte Pal_WmHighLightNationMap + 0x1b84
.4byte 0x002c009a
.4byte Pal_WmHighLightNationMap + 0x1bb8
.4byte Pal_WmHighLightNationMap + 0x20d8
.4byte 0x002600bc
.4byte Pal_WmHighLightNationMap + 0x2128
.4byte Pal_WmHighLightNationMap + 0x2508
.4byte 0x00300084
.4byte Pal_WmHighLightNationMap + 0x2540
.4byte Pal_WmHighLightNationMap + 0x2a5c
.4byte 0x004a0065
.4byte 0x70616d47
.4byte 0x204d5220
.4byte 0x64726f62
.4byte 0x00007265
.4byte 0x70616d47
.4byte 0x74754120
.4byte 0x754d206f
.4byte 0x00000000
.incbin "baserom.gba", 0x206B60, 0x10
.global gUnknown_08206B70
gUnknown_08206B70: @ 0x08206B70

View File

@ -1,46 +1,4 @@
.section .data
.global ProcScr_GmapRmBorder1
ProcScr_GmapRmBorder1: @ 0x08A3EC48
@ PROC_NAME
.short 0x1, 0x0
.word 0x8206b50
@ PROC_MARK
.short 0xf, 0x8
.word 0x0
@ PROC_SET_END_CB
.short 0x4, 0x0
.word GmapRmBorder1_End
@ PROC_CALL
.short 0x2, 0x0
.word GmapRmBorder1_80C2750
@ PROC_REPEAT
.short 0x3, 0x0
.word GmapRmBorder1_80C2804
@ PROC_CALL
.short 0x2, 0x0
.word GmapRmBorder1_80C2964
@ PROC_REPEAT
.short 0x3, 0x0
.word GmapRmBorder1_80C29F8
@ PROC_LABEL
.short 0xb, 0x1
.word 0x0
@ PROC_REPEAT
.short 0x3, 0x0
.word GmapRmBorder1_80C2A1C
@ PROC_REPEAT
.short 0x3, 0x0
.word GmapRmBorder1_80C29F8
@ PROC_CALL
.short 0x2, 0x0
.word GmapRmBorder1_80C28C4
@ PROC_REPEAT
.short 0x3, 0x0
.word GmapRmBorder1_80C28DC
@ PROC_END
.short 0x0, 0x0
.word 0x0
.global ProcScr_GmapRmBaPalAnim2
ProcScr_GmapRmBaPalAnim2: @ 0x08A3ECB0
@ -1312,7 +1270,63 @@ Img_WmHightLightMapFrecia:
.global Ap_WmHightLightMapFrecia
Ap_WmHightLightMapFrecia:
.incbin "baserom.gba", 0xA9EC24, 0xAA114C - 0xA9EC24
.incbin "baserom.gba", 0xA9EC24, 0xA9EC94 - 0xA9EC24
.global Img_WmHightLightMap2
Img_WmHightLightMap2:
.incbin "baserom.gba", 0xA9EC94, 0xA9F358 - 0xA9EC94
.global Ap_WmHightLightMap2
Ap_WmHightLightMap2:
.incbin "baserom.gba", 0xA9F358, 0xA9F494 - 0xA9F358
.global Img_WmHightLightMap3
Img_WmHightLightMap3:
.incbin "baserom.gba", 0xA9F494, 0xA9F9C8 - 0xA9F494
.global Ap_WmHightLightMap3
Ap_WmHightLightMap3:
.incbin "baserom.gba", 0xA9F9C8, 0xA9FA2C - 0xA9F9C8
.global Img_WmHightLightMap4
Img_WmHightLightMap4:
.incbin "baserom.gba", 0xA9FA2C, 0xA9FEA4 - 0xA9FA2C
.global Ap_WmHightLightMap4
Ap_WmHightLightMap4:
.incbin "baserom.gba", 0xA9FEA4, 0xA9FF00 - 0xA9FEA4
.global Img_WmHightLightMap5
Img_WmHightLightMap5:
.incbin "baserom.gba", 0xA9FF00, 0xAA020C - 0xA9FF00
.global Ap_WmHightLightMap5
Ap_WmHightLightMap5:
.incbin "baserom.gba", 0xAA020C, 0xAA0240 - 0xAA020C
.global Img_WmHightLightMap6
Img_WmHightLightMap6:
.incbin "baserom.gba", 0xAA0240, 0xAA0760 - 0xAA0240
.global Ap_WmHightLightMap6
Ap_WmHightLightMap6:
.incbin "baserom.gba", 0xAA0760, 0xAA07B0 - 0xAA0760
.global Img_WmHightLightMap7
Img_WmHightLightMap7:
.incbin "baserom.gba", 0xAA07B0, 0xAA0B90 - 0xAA07B0
.global Ap_WmHightLightMap7
Ap_WmHightLightMap7:
.incbin "baserom.gba", 0xAA0B90, 0xAA0BC8 - 0xAA0B90
.global Img_WmHightLightMap8
Img_WmHightLightMap8:
.incbin "baserom.gba", 0xAA0BC8, 0xAA10E4 - 0xAA0BC8
.global Ap_WmHightLightMap8
Ap_WmHightLightMap8:
.incbin "baserom.gba", 0xAA10E4, 0xAA114C - 0xAA10E4
.global gUnknown_08AA114C
gUnknown_08AA114C: @ 0x08AA114C

View File

@ -115,6 +115,8 @@ enum wm_hightlighted_nation_idx {
WM_NATION_Rausten = 5,
WM_NATION_Pokhara = 6,
WM_NATION_Renais = 7,
WM_NATION_MAX = 8,
};
enum wm_mu_idx {

View File

@ -320,7 +320,6 @@ extern const struct FaceVramEntry gFaceConfig_PrepItemUseScreen[4];
// extern ??? gUnknown_08206954
// extern ??? GfxSet_WmNationMap
// extern ??? gUnknown_08206B70
// extern ??? gUnknown_08206E24
// extern ??? gUnknown_08206FB4
@ -1285,6 +1284,22 @@ extern u8 gImg_08A9E544[];
extern u16 gPal_08A9E5BC[];
extern u8 gTsa_08A9E5DC[];
extern u16 Pal_WmHighLightNationMap[];
extern u16 Img_WmHightLightMapFrecia[];
extern u16 Ap_WmHightLightMapFrecia[];
extern u16 Img_WmHightLightMap2[];
extern u16 Ap_WmHightLightMap2[];
extern u16 Img_WmHightLightMap3[];
extern u16 Ap_WmHightLightMap3[];
extern u16 Img_WmHightLightMap4[];
extern u16 Ap_WmHightLightMap4[];
extern u16 Img_WmHightLightMap5[];
extern u16 Ap_WmHightLightMap5[];
extern u16 Img_WmHightLightMap6[];
extern u16 Ap_WmHightLightMap6[];
extern u16 Img_WmHightLightMap7[];
extern u16 Ap_WmHightLightMap7[];
extern u16 Img_WmHightLightMap8[];
extern u16 Ap_WmHightLightMap8[];
// extern ??? gUnknown_08AA114C
// extern ??? gUnknown_08AA1190
// extern ??? gUnknown_08AA11B0

View File

@ -4,6 +4,8 @@
#include "proc.h"
#include "hardware.h"
#include "spline.h"
#include "ap.h"
#include "constants/worldmap.h"
enum worldmap_unit_alignace {
WM_FACTION_BLUE = 0,
@ -1071,25 +1073,42 @@ void GmapRmBaPalAnim1_End(struct ProcGmapRmBaPalAnim * proc);
void GmapRmBaPalAnim1_Init(struct ProcGmapRmBaPalAnim * proc);
void GmapRmBaPalAnim1_Loop1(struct ProcGmapRmBaPalAnim * proc);
void GmapRmBaPalAnim1_Loop2(struct ProcGmapRmBaPalAnim * proc);
// ??? StartGmapRmBaPalAnim1(???);
// ??? EndGmapRmBaPalAnim1(???);
// ??? CheckGmapRmBaPalAnim1Exists(???);
// ??? CheckGmapRmBaPalAnim1State(???);
ProcPtr StartGmapRmBaPalAnim1(ProcPtr parent);
void EndGmapRmBaPalAnim1(void);
bool CheckGmapRmBaPalAnim1Exists(void);
bool CheckGmapRmBaPalAnim1State(void);
// ??? GmapRmBorder1_End(???);
// ??? GmapRmBorder1_80C2750(???);
// ??? sub_80C27A8(???);
// ??? GmapRmBorder1_80C2804(???);
// ??? GmapRmBorder1_80C28C4(???);
// ??? GmapRmBorder1_80C28DC(???);
// ??? GmapRmBorder1_80C2964(???);
// ??? sub_80C298C(???);
// ??? GmapRmBorder1_80C29F8(???);
// ??? GmapRmBorder1_80C2A1C(???);
// ??? sub_80C2A40(???);
struct ProcGmapRmBorder1 {
PROC_HEADER;
/* 29 */ bool flag;
/* 2A */ u8 index;
/* 2C */ struct APHandle * sprite1;
/* 30 */ s16 timer;
/* 34 */ struct APHandle * sprite2;
};
struct GmMapRmBorderSet {
void * img;
void * sprite;
s16 x, y;
};
extern const struct GmMapRmBorderSet GfxSet_WmNationMap[WM_NATION_MAX];
void GmapRmBorder1_End(struct ProcGmapRmBorder1 * proc);
void GmapRmBorder1_80C2750(struct ProcGmapRmBorder1 * proc);
void GmapRmBorder1_PutSprite2(struct ProcGmapRmBorder1 * proc, int x, int y, bool transparency);
void GmapRmBorder1_NationMergeIn(struct ProcGmapRmBorder1 * proc);
void GmapRmBorder1_80C28C4(struct ProcGmapRmBorder1 * proc);
void GmapRmBorder1_NationMergeOut(struct ProcGmapRmBorder1 * proc);
void GmapRmBorder1_80C2964(struct ProcGmapRmBorder1 * proc);
void GmapRmBorder1_PutSpriteAll(struct ProcGmapRmBorder1 * proc);
void GmapRmBorder1_80C29F8(struct ProcGmapRmBorder1 * proc);
void GmapRmBorder1_80C2A1C(struct ProcGmapRmBorder1 * proc);
// ??? StartGmapRmBorder1(???);
// ??? DrawWmNationHighLightMapGfx(???);
void WmShowNationHighlightedMap(int, int); // FEBuilder: "Display place name of world map"
void sub_80C2B7C(int);
void EndGmapRmBorder1(int);
int sub_80C2BC4(int);
void sub_80C2C10(int);
// ??? GmapRmBaPalAnim2_End(???);

View File

@ -1005,7 +1005,7 @@ u8 EventB9_WmRemoveHighlightNationPart1(struct EventEngineProc * proc)
if (EVENT_IS_SKIPPING(proc))
{
sub_80C2B7C(-1);
EndGmapRmBorder1(-1);
return EVC_ADVANCE_CONTINUE;
}
@ -1024,7 +1024,7 @@ u8 EventBA_WmRemoveHighlightNationPart2(struct EventEngineProc * proc)
{
if (sub_80C2BC4(a))
{
sub_80C2B7C(a);
EndGmapRmBorder1(a);
}
return EVC_ADVANCE_CONTINUE;

View File

@ -3,6 +3,7 @@
#include "hardware.h"
#include "hardware.h"
#include "bm.h"
#include "gba_sprites.h"
#include "bmlib.h"
#include "uiutils.h"
#include "worldmap.h"
@ -469,3 +470,202 @@ bool CheckGmapRmBaPalAnim1State(void)
return 0;
}
void GmapRmBorder1_End(struct ProcGmapRmBorder1 * proc)
{
AP_Delete(proc->sprite2);
AP_Delete(proc->sprite1);
if (CountProcs(ProcScr_GmapRmBorder1) == 1)
EndGmapRmBaPalAnim1();
}
void GmapRmBorder1_80C2750(struct ProcGmapRmBorder1 * proc)
{
SetBlendTargetA(0, 0, 0, 0, 0);
SetBlendTargetB(0, 1, 0, 0, 0);
SetBlendConfig(0, 0, 0x10, 0);
proc->timer = 0;
if (CountProcs(ProcScr_GmapRmBorder1) <= 1)
{
ApplyPalette(Pal_WmHighLightNationMap, 0x19);
}
}
void GmapRmBorder1_PutSprite2(struct ProcGmapRmBorder1 * proc, int x, int y, bool transparency)
{
s16 ix, iy;
GmapRm_GetPosition(&ix, &iy);
x -= ix;
y -= iy;
if (transparency)
AP_Update(proc->sprite2, x, OBJ_TRANSLUCENT | y);
else
AP_Update(proc->sprite2, x, y);
}
const struct GmMapRmBorderSet GfxSet_WmNationMap[WM_NATION_MAX] = {
[WM_NATION_Frelia] = {
Img_WmHightLightMapFrecia,
Ap_WmHightLightMapFrecia,
0x36, 0x28
},
[WM_NATION_Grado] = {
Img_WmHightLightMap2,
Ap_WmHightLightMap2,
0x58, 0x75
},
[WM_NATION_Jehanna] = {
Img_WmHightLightMap3,
Ap_WmHightLightMap3,
0xB1, 0x57
},
[WM_NATION_Carcino] = {
Img_WmHightLightMap4,
Ap_WmHightLightMap4,
0x7F, 0x39
},
[WM_NATION_ZahaWoods] = {
Img_WmHightLightMap5,
Ap_WmHightLightMap5,
0x9A, 0x2C
},
[WM_NATION_Rausten] = {
Img_WmHightLightMap6,
Ap_WmHightLightMap6,
0xBC, 0x26
},
[WM_NATION_Pokhara] = {
Img_WmHightLightMap7,
Ap_WmHightLightMap7,
0x84, 0x30
},
[WM_NATION_Renais] = {
Img_WmHightLightMap8,
Ap_WmHightLightMap8,
0x65, 0x4A
},
};
void GmapRmBorder1_NationMergeIn(struct ProcGmapRmBorder1 * proc)
{
int offset, x, y;
if (++proc->timer < 22)
{
u32 coeff = sub_800B7E0(proc->timer, 22, 2);
int ret = DivArm(0x1000, coeff * 0x10);
SetBlendConfig(0, ret, 0x10 - ret, 0);
offset = DivArm(0x1000, (0x1000 - coeff) * 18);
x = GfxSet_WmNationMap[proc->index].x + offset;
y = GfxSet_WmNationMap[proc->index].y;
GmapRmBorder1_PutSprite2(proc, x, y, 1);
}
else
{
SetBlendConfig(0, 0x10, 0x10, 0);
proc->timer = 0;
x = GfxSet_WmNationMap[proc->index].x;
y = GfxSet_WmNationMap[proc->index].y;
GmapRmBorder1_PutSprite2(proc, x, y, 0);
Proc_Break(proc);
}
}
void GmapRmBorder1_80C28C4(struct ProcGmapRmBorder1 * proc)
{
if (CountProcs(ProcScr_GmapRmBorder1) == 1)
EndGmapRmBaPalAnim1();
}
void GmapRmBorder1_NationMergeOut(struct ProcGmapRmBorder1 * proc)
{
int offset, x, y;
if (++proc->timer < 22)
{
u32 coeff = sub_800B7E0(proc->timer, 22, 2);
int ret = DivArm(0x1000, coeff * 0x10);
SetBlendConfig(0, 0x10 - ret, ret, 0);
offset = DivArm(0x1000, coeff * 18);
x = GfxSet_WmNationMap[proc->index].x - offset;
y = GfxSet_WmNationMap[proc->index].y;
GmapRmBorder1_PutSprite2(proc, x, y, 1);
}
else
{
SetDefaultColorEffects();
Proc_Break(proc);
}
}
void GmapRmBorder1_80C2964(struct ProcGmapRmBorder1 * proc)
{
if (CountProcs(ProcScr_GmapRmBorder1) <= 1)
{
StartGmapRmBaPalAnim1(NULL);
Proc_Goto(proc, 1);
}
}
void GmapRmBorder1_PutSpriteAll(struct ProcGmapRmBorder1 * proc)
{
s16 ix, iy, x, y;
GmapRm_GetPosition(&ix, &iy);
x = GfxSet_WmNationMap[proc->index].x - ix;
y = GfxSet_WmNationMap[proc->index].y - iy;
AP_Update(proc->sprite1, x, OBJ_TRANSLUCENT | y);
x = GfxSet_WmNationMap[proc->index].x;
y = GfxSet_WmNationMap[proc->index].y;
GmapRmBorder1_PutSprite2(proc, x, y, 0);
}
void GmapRmBorder1_80C29F8(struct ProcGmapRmBorder1 * proc)
{
GmapRmBorder1_PutSpriteAll(proc);
if (CheckGmapRmBaPalAnim1State())
{
proc->timer = 0;
Proc_Break(proc);
}
}
void GmapRmBorder1_80C2A1C(struct ProcGmapRmBorder1 * proc)
{
GmapRmBorder1_PutSpriteAll(proc);
if (proc->flag)
Proc_Break(proc);
}
struct ProcCmd CONST_DATA ProcScr_GmapRmBorder1[] = {
PROC_NAME("Gmap RM border"),
PROC_MARK(8),
PROC_SET_END_CB(GmapRmBorder1_End),
PROC_CALL(GmapRmBorder1_80C2750),
PROC_REPEAT(GmapRmBorder1_NationMergeIn),
PROC_CALL(GmapRmBorder1_80C2964),
PROC_REPEAT(GmapRmBorder1_80C29F8),
PROC_LABEL(1),
PROC_REPEAT(GmapRmBorder1_80C2A1C),
PROC_REPEAT(GmapRmBorder1_80C29F8),
PROC_CALL(GmapRmBorder1_80C28C4),
PROC_REPEAT(GmapRmBorder1_NationMergeOut),
PROC_END,
};