Mistakes were made bc of a bad and idk brain help what

This commit is contained in:
Martmists 2020-06-05 05:01:52 +02:00
parent c77ef46e17
commit 921d9ca18f
8 changed files with 235 additions and 77 deletions

145
arm7/ARM7-TS.lcf Normal file
View File

@ -0,0 +1,145 @@
#---------------------------------------------------------------------------
# Project: NitroSDK - tools - makelcf
# File: ARM7-TS.lcf
#
# Copyright 2003-2005 Nintendo. All rights reserved.
#
# These coded instructions, statements, and computer programs contain
# proprietary information of Nintendo of America Inc. and/or Nintendo
# Company Ltd., and are protected by Federal copyright law. They may
# not be disclosed to third parties or copied or duplicated in any form,
# in whole or in part, without the prior written consent of Nintendo.
#
# $Log: ARM7-TS.lcf,v $
# Revision 1.10 2005/04/14 00:04:17 terui
# Update copyright.
#
# Revision 1.9 2005/04/13 12:53:20 terui
# Change SDK_SUBPRIV_ARENA_LO 0x027c0000 -> 0x027e0000
#
# Revision 1.8 2004/08/18 01:59:32 yasu
# Support SDK_SUBPRIV_ARENA_LO
#
# Revision 1.7 2004/07/26 00:08:27 yasu
# Fix label of exception table
#
# Revision 1.6 2004/07/23 11:32:14 yasu
# Define labels for __exception_table_start__ and _end__
#
# Revision 1.5 2004/07/02 08:35:06 yasu
# Add .wram section
#
# Revision 1.4 2004/07/01 10:41:46 yasu
# support autoload
#
# Revision 1.3 2004/05/28 02:11:15 yasu
# set WRAM arena region correctly
#
# Revision 1.2 2004/05/07 05:13:47 yasu
# remove STATICINIT for cw0.5
#
# Revision 1.1 2004/04/06 01:59:54 yasu
# newly added
#
# $NoKeywords: $
#---------------------------------------------------------------------------
MEMORY
{
main (RWX) : ORIGIN = 0x037f8000, LENGTH = 0x0
bss (RWX) : ORIGIN = AFTER(main), LENGTH = 0x0
arena (RW) : ORIGIN = AFTER(bss), LENGTH = 0x0
workram (RWX) : ORIGIN = 0x037f8000, LENGTH = 0x10000 > workram.check
}
KEEP_SECTION
{
.ctor
}
SECTIONS
{
.main: AT 0x037f8000
{
ALIGNALL(4); . = ALIGN(4);
SDK_STATIC_START =.;
SDK_STATIC_TEXT_START =.;
#:::::::::: text
crt0.o (.text)
* (.text)
* (.wram)
* (.init)
* (.exception)
. = ALIGN(4);
__exception_table_start__ =.;
EXCEPTION
__exception_table_end__ =.;
. = ALIGN(4);
* (.rodata)
__sinit__ =.;
* (.ctor)
WRITEW 0;
#:::::::::: text
. = ALIGN(4);
SDK_STATIC_TEXT_END =.;
SDK_STATIC_DATA_START =.;
#:::::::::: data
* (.sdata)
* (.data)
#:::::::::: data
. = ALIGN(4);
SDK_STATIC_DATA_END =.;
SDK_STATIC_END =.;
SDK_STATIC_TEXT_SIZE = SDK_STATIC_TEXT_END - SDK_STATIC_TEXT_START;
SDK_STATIC_DATA_SIZE = SDK_STATIC_DATA_END - SDK_STATIC_DATA_START;
SDK_STATIC_SIZE = SDK_STATIC_END - SDK_STATIC_START;
} > main
.bss: AT 0x037f8000 + SIZEOF(main)
{
ALIGNALL(4); . = ALIGN(4);
SDK_STATIC_BSS_START =.;
#:::::::::: bss
* (.sbss)
* (.bss)
#:::::::::: bss
SDK_STATIC_BSS_END =.;
SDK_STATIC_BSS_SIZE = SDK_STATIC_BSS_END - SDK_STATIC_BSS_START;
} > bss
.area:
{
. = ALIGN(4);
SDK_SECTION_ARENA_START = .;
} > arena
############################ AUTOLOAD_INFO ##########################
SDK_AUTOLOAD_START = SDK_STATIC_END;
SDK_AUTOLOAD_SIZE = 0;
SDK_AUTOLOAD_NUMBER = 0;
SDK_AUTOLOAD_LIST = SDK_AUTOLOAD_START;
SDK_AUTOLOAD_LIST_END = SDK_AUTOLOAD_START;
############################ OVERLAYS ###############################
SDK_OVERLAY_NUMBER = 0;
############################ OTHERS #################################
SDK_SUBPRIV_ARENA_LO = 0x027e0000;
SDK_WRAM_ARENA_LO = SDK_SECTION_ARENA_START;
SDK_IRQ_STACKSIZE = 0x200; # allocated in PWRAM
SDK_SYS_STACKSIZE = 0x400; # allocated in PWRAM
# work ram size checker
.workram:
{
. = . + SDK_SECTION_ARENA_START - 0x037f8000 + SDK_IRQ_STACKSIZE + SDK_SYS_STACKSIZE;
} > workram
}

View File

@ -18,31 +18,6 @@ UNK_021C5A0C: ; 0x021C5A0C
.text
thumb_func_start ScrCmd_ABKeyWait
ScrCmd_ABKeyWait: ; 0x0203A45C
push {r3, lr}
ldr r1, _0203A468 ; =FUN_0203A46C
bl SetupNativeScript
mov r0, #0x1
pop {r3, pc}
.balign 4
_0203A468: .word FUN_0203A46C
thumb_func_start FUN_0203A46C
FUN_0203A46C: ; 0x0203A46C
ldr r0, _0203A480 ; =gUnknown21C48B8
ldr r1, [r0, #0x48]
mov r0, #0x3
tst r0, r1
beq _0203A47A
mov r0, #0x1
bx lr
_0203A47A:
mov r0, #0x0
bx lr
nop
_0203A480: .word gUnknown21C48B8
thumb_func_start ScrCmd_ABKeyTimeWait
ScrCmd_ABKeyTimeWait: ; 0x0203A484
push {r4, lr}
@ -1098,8 +1073,8 @@ ScrCmd_BmpMenuMakeList: ; 0x0203AC9C
pop {r4, pc}
.balign 4
thumb_func_start ScrCmd_EvCmdBmpMenuMakeList16,
ScrCmd_EvCmdBmpMenuMakeList16,: ; 0x0203ACC4
thumb_func_start ScrCmd_BmpMenuMakeList16
ScrCmd_BmpMenuMakeList16: ; 0x0203ACC4
push {r4-r6, lr}
add r5, r0, #0x0
add r0, #0x80
@ -3077,16 +3052,16 @@ ScrCmd_WiFiAutoReg: ; 0x0203BCBC
pop {r3, pc}
.balign 4
thumb_func_start ScrCmd_EvCmdWiFiP2PMatchEventCall,
ScrCmd_EvCmdWiFiP2PMatchEventCall,: ; 0x0203BCCC
thumb_func_start ScrCmd_WiFiP2PMatchEventCall
ScrCmd_WiFiP2PMatchEventCall: ; 0x0203BCCC
push {r3, lr}
ldr r0, [r0, #0x74]
bl FUN_0206F3B8
mov r0, #0x1
pop {r3, pc}
thumb_func_start ScrCmd_EvCmdWiFiP2PMatchSetDel,
ScrCmd_EvCmdWiFiP2PMatchSetDel,: ; 0x0203BCD8
thumb_func_start ScrCmd_WiFiP2PMatchSetDel
ScrCmd_WiFiP2PMatchSetDel: ; 0x0203BCD8
push {r3-r5, lr}
add r5, r0, #0x0
add r0, #0x80
@ -6971,8 +6946,8 @@ ScrCmd_SetUpDoorAnime: ; 0x0203DC00
pop {r3-r7, pc}
.balign 4
thumb_func_start ScrCmd_EvCmdWait3DAnime,
ScrCmd_EvCmdWait3DAnime,: ; 0x0203DC58
thumb_func_start ScrCmd_Wait3DAnime
ScrCmd_Wait3DAnime: ; 0x0203DC58
push {r3, lr}
ldr r2, [r0, #0x8]
add r1, r2, #0x1
@ -6985,8 +6960,8 @@ ScrCmd_EvCmdWait3DAnime,: ; 0x0203DC58
pop {r3, pc}
.balign 4
thumb_func_start ScrCmd_EvCmdFree3DAnime,
ScrCmd_EvCmdFree3DAnime,: ; 0x0203DC70
thumb_func_start ScrCmd_Free3DAnime
ScrCmd_Free3DAnime: ; 0x0203DC70
push {r3, lr}
ldr r2, [r0, #0x8]
add r1, r2, #0x1
@ -9617,8 +9592,8 @@ _0203F164:
mov r0, #0x1
pop {r3-r7, pc}
thumb_func_start ScrCmd_EvCmd_D20R0106Legend_IsUnseal,
ScrCmd_EvCmd_D20R0106Legend_IsUnseal,: ; 0x0203F174
thumb_func_start ScrCmd_D20R0106Legend_IsUnseal
ScrCmd_D20R0106Legend_IsUnseal: ; 0x0203F174
push {r3-r5, lr}
add r5, r0, #0x0
bl ScriptReadHalfword
@ -9883,8 +9858,8 @@ ScrCmd_ImcAcceSubItem: ; 0x0203F348
mov r0, #0x0
pop {r4-r6, pc}
thumb_func_start ScrCmd_EvCmdc08r0801ScopeCameraSet,
ScrCmd_EvCmdc08r0801ScopeCameraSet,: ; 0x0203F38C
thumb_func_start ScrCmd_c08r0801ScopeCameraSet
ScrCmd_c08r0801ScopeCameraSet: ; 0x0203F38C
push {r3, lr}
add r0, #0x80
ldr r0, [r0, #0x0]
@ -10070,8 +10045,8 @@ ScrCmd_AnoonSeeNum: ; 0x0203F4D8
pop {r3-r5, pc}
.balign 4
thumb_func_start ScrCmd_EvCmdD17SystemMapSelect,
ScrCmd_EvCmdD17SystemMapSelect,: ; 0x0203F508
thumb_func_start ScrCmd_D17SystemMapSelect
ScrCmd_D17SystemMapSelect: ; 0x0203F508
push {r3-r7, lr}
add r6, r0, #0x0
bl ScriptReadHalfword
@ -10590,8 +10565,8 @@ _0203F91E:
pop {r3-r5, pc}
.balign 4
thumb_func_start ScrCmd_EvCmdUnderGroundTalkCount2,
ScrCmd_EvCmdUnderGroundTalkCount2,: ; 0x0203F924
thumb_func_start ScrCmd_UnderGroundTalkCount2
ScrCmd_UnderGroundTalkCount2: ; 0x0203F924
push {r3-r5, lr}
add r5, r0, #0x0
add r0, #0x80

View File

@ -988,8 +988,8 @@ ScrCmd_GetPokeCount: ; 0x02044B00
pop {r3-r5, pc}
.balign 4
thumb_func_start ScrCmd_EvCmdGetPokeCount2,
ScrCmd_EvCmdGetPokeCount2,: ; 0x02044B2C
thumb_func_start ScrCmd_GetPokeCount2
ScrCmd_GetPokeCount2: ; 0x02044B2C
push {r3-r7, lr}
add r4, r0, #0x0
add r1, r4, #0x0
@ -1031,8 +1031,8 @@ _02044B7A:
pop {r3-r7, pc}
.balign 4
thumb_func_start ScrCmd_EvCmdGetPokeCount3,
ScrCmd_EvCmdGetPokeCount3,: ; 0x02044B84
thumb_func_start ScrCmd_GetPokeCount3
ScrCmd_GetPokeCount3: ; 0x02044B84
push {r4-r7, lr}
sub sp, #0xc
add r4, r0, #0x0
@ -1095,8 +1095,8 @@ _02044C00:
pop {r4-r7, pc}
.balign 4
thumb_func_start ScrCmd_EvCmdGetPokeCount4,
ScrCmd_EvCmdGetPokeCount4,: ; 0x02044C0C
thumb_func_start ScrCmd_GetPokeCount4
ScrCmd_GetPokeCount4: ; 0x02044C0C
push {r4-r7, lr}
sub sp, #0xc
add r4, r0, #0x0

View File

@ -576,8 +576,8 @@ ScrCmd_HaifuPokeRetryCheck: ; 0x02041B40
pop {r3-r5, pc}
.balign 4
thumb_func_start ScrCmd_EvCmd2vs2BattleCheck,
ScrCmd_EvCmd2vs2BattleCheck,: ; 0x02041B70
thumb_func_start ScrCmd_2vs2BattleCheck
ScrCmd_2vs2BattleCheck: ; 0x02041B70
push {r3-r5, lr}
add r5, r0, #0x0
bl ScriptReadHalfword

View File

@ -317,8 +317,8 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_GetTemotiPokeNum
.word ScrCmd_SetMapProc
.word ScrCmd_WiFiAutoReg
.word ScrCmd_EvCmdWiFiP2PMatchEventCall,
.word ScrCmd_EvCmdWiFiP2PMatchSetDel,
.word ScrCmd_WiFiP2PMatchEventCall
.word ScrCmd_WiFiP2PMatchSetDel
.word ScrCmd_MsgBoyEvent
.word ScrCmd_ImageClipSetProc
.word ScrCmd_ImageClipPreviewTvProc
@ -392,7 +392,7 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_TrainerLose
.word ScrCmd_TrainerLoseCheck
.word ScrCmd_SeacretPokeRetryCheck
.word ScrCmd_EvCmd2vs2BattleCheck,
.word ScrCmd_2vs2BattleCheck
.word ScrCmd_DebugBattleSet
.word ScrCmd_DebugTrainerFlagSet
.word ScrCmd_DebugTrainerFlagOnJump
@ -515,8 +515,8 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_SysFlagGameClearGet
.word ScrCmd_SysFlagGameClearSet
.word ScrCmd_SetUpDoorAnime
.word ScrCmd_EvCmdWait3DAnime,
.word ScrCmd_EvCmdFree3DAnime,
.word ScrCmd_Wait3DAnime
.word ScrCmd_Free3DAnime
.word ScrCmd_OpenDoor
.word ScrCmd_CloseDoor
.word ScrCmd_GetSodateyaName
@ -564,9 +564,9 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_PokeStatusGetResult
.word ScrCmd_TemotiMonsNo
.word ScrCmd_MonsOwnChk
.word ScrCmd_EvCmdGetPokeCount2,
.word ScrCmd_EvCmdGetPokeCount3,
.word ScrCmd_EvCmdGetPokeCount4,
.word ScrCmd_GetPokeCount2
.word ScrCmd_GetPokeCount3
.word ScrCmd_GetPokeCount4
.word ScrCmd_GetTamagoCount
.word ScrCmd_UgShopMenuInit
.word ScrCmd_UgShopTalkStart
@ -773,7 +773,7 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_GetNowHour
.word ScrCmd_ObjShakeAnm
.word ScrCmd_ObjBlinkAnm
.word ScrCmd_EvCmd_D20R0106Legend_IsUnseal,
.word ScrCmd_D20R0106Legend_IsUnseal
.word ScrCmd_DressingImcAcceCheck
.word ScrCmd_TalkMsgUnknownFont
.word ScrCmd_AgbCartridgeVerGet
@ -788,7 +788,7 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_LevelJijiiNo
.word ScrCmd_PokeLevelGet
.word ScrCmd_ImcAcceSubItem
.word ScrCmd_EvCmdc08r0801ScopeCameraSet,
.word ScrCmd_c08r0801ScopeCameraSet
.word ScrCmd_LevelJijiiInit
.word ScrCmd_TVEntryParkInfo
.word ScrCmd_NewNankaiWordSet
@ -799,7 +799,7 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_BirthDayCheck
.word ScrCmd_SndInitialVolSet
.word ScrCmd_AnoonSeeNum
.word ScrCmd_EvCmdD17SystemMapSelect,
.word ScrCmd_D17SystemMapSelect
.word ScrCmd_UnderGroundToolGiveCount
.word ScrCmd_UnderGroundKasekiDigCount
.word ScrCmd_UnderGroundTrapHitCount
@ -813,7 +813,7 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_SodateyaPokeListSetProc
.word ScrCmd_SodateyaPokeListGetResult
.word ScrCmd_GetRandomHit
.word ScrCmd_EvCmdUnderGroundTalkCount2,
.word ScrCmd_UnderGroundTalkCount2
.word ScrCmd_BtlPointWinWrite
.word ScrCmd_BtlPointWinDel
.word ScrCmd_BtlPointWrite
@ -823,7 +823,7 @@ gScriptCmdTable: ; 0x020F355C
.word ScrCmd_CompBtlPoint
.word ScrCmd_GetBtlPointGift
.word ScrCmd_UnionViewGetTrainerTypeNo
.word ScrCmd_EvCmdBmpMenuMakeList16,
.word ScrCmd_BmpMenuMakeList16
.word ScrCmd_HidenEffStart
.word ScrCmd_Zishin
.word ScrCmd_TrainerMultiBattleSet

View File

@ -2757,7 +2757,7 @@
.extern ScrCmd_BmpMenuInit
.extern ScrCmd_BmpMenuInitEx
.extern ScrCmd_BmpMenuMakeList
.extern ScrCmd_EvCmdBmpMenuMakeList16,
.extern ScrCmd_BmpMenuMakeList16
.extern ScrCmd_BmpMenuStart
.extern ScrCmd_UnionBmpMenuStart
.extern ScrCmd_BmpListInit
@ -2809,8 +2809,8 @@
.extern ScrCmd_SetMapProc
.extern ScrCmd_FinishMapProc
.extern ScrCmd_WiFiAutoReg
.extern ScrCmd_EvCmdWiFiP2PMatchEventCall,
.extern ScrCmd_EvCmdWiFiP2PMatchSetDel,
.extern ScrCmd_WiFiP2PMatchEventCall
.extern ScrCmd_WiFiP2PMatchSetDel
.extern ScrCmd_CommGetCurrentID
.extern ScrCmd_PokeWindowPut
.extern ScrCmd_PokeWindowPutPP
@ -2949,8 +2949,8 @@
.extern ScrCmd_ObjDirChange
.extern ScrCmd_ReturnScriptWkSet
.extern ScrCmd_SetUpDoorAnime
.extern ScrCmd_EvCmdWait3DAnime,
.extern ScrCmd_EvCmdFree3DAnime,
.extern ScrCmd_Wait3DAnime
.extern ScrCmd_Free3DAnime
.extern ScrCmd_OpenDoor
.extern ScrCmd_CloseDoor
.extern ScrCmd_InitWaterGym
@ -3052,7 +3052,7 @@
.extern ScrCmd_GetNowHour
.extern ScrCmd_ObjShakeAnm
.extern ScrCmd_ObjBlinkAnm
.extern ScrCmd_EvCmd_D20R0106Legend_IsUnseal,
.extern ScrCmd_D20R0106Legend_IsUnseal
.extern ScrCmd_DressingImcAcceCheck
.extern ScrCmd_AgbCartridgeVerGet
.extern ScrCmd_UnderGroundTalkCountClear
@ -3061,14 +3061,14 @@
.extern ScrCmd_SlotRentyanChk
.extern ScrCmd_LevelJijiiNo
.extern ScrCmd_ImcAcceSubItem
.extern ScrCmd_EvCmdc08r0801ScopeCameraSet,
.extern ScrCmd_c08r0801ScopeCameraSet
.extern ScrCmd_LevelJijiiInit
.extern ScrCmd_NewNankaiWordSet
.extern ScrCmd_NankaiWordCompleteCheck
.extern ScrCmd_RegularCheck
.extern ScrCmd_BirthDayCheck
.extern ScrCmd_AnoonSeeNum
.extern ScrCmd_EvCmdD17SystemMapSelect,
.extern ScrCmd_D17SystemMapSelect
.extern ScrCmd_UnderGroundToolGiveCount
.extern ScrCmd_UnderGroundKasekiDigCount
.extern ScrCmd_UnderGroundTrapHitCount
@ -3080,7 +3080,7 @@
.extern ScrCmd_SodateyaPokeListGetResult
.extern ScrCmd_GetRandomHit
.extern ScrCmd_HidenEffStart
.extern ScrCmd_EvCmdUnderGroundTalkCount2,
.extern ScrCmd_UnderGroundTalkCount2
.extern ScrCmd_Zishin
.extern ScrCmd_CheckMyGSID
.extern ScrCmd_GetFriendDataNum
@ -3218,7 +3218,7 @@
.extern ScrCmd_TrainerLoseCheck
.extern ScrCmd_SeacretPokeRetryCheck
.extern ScrCmd_HaifuPokeRetryCheck
.extern ScrCmd_EvCmd2vs2BattleCheck,
.extern ScrCmd_2vs2BattleCheck
.extern ScrCmd_DebugBattleSet
.extern ScrCmd_DebugTrainerFlagSet
.extern ScrCmd_DebugTrainerFlagOnJump
@ -3318,9 +3318,9 @@
.extern ScrCmd_FrontPokemon
.extern ScrCmd_TemotiPokeType
.extern ScrCmd_GetPokeCount
.extern ScrCmd_EvCmdGetPokeCount2,
.extern ScrCmd_EvCmdGetPokeCount3,
.extern ScrCmd_EvCmdGetPokeCount4,
.extern ScrCmd_GetPokeCount2
.extern ScrCmd_GetPokeCount3
.extern ScrCmd_GetPokeCount4
.extern ScrCmd_GetTamagoCount
.extern ScrCmd_ChkTemotiPokerus
.extern ScrCmd_TemotiPokeSexGet

View File

@ -36,6 +36,7 @@ extern BOOL FUN_02030F40();
BOOL FUN_020399E8(struct ScriptContext* ctx);
BOOL FUN_02039CC8(struct ScriptContext* ctx);
BOOL FUN_0203A2F0(struct ScriptContext* ctx);
BOOL FUN_0203A46C(struct ScriptContext* ctx);
// Functions
// Names taken from
@ -558,3 +559,15 @@ THUMB_FUNC BOOL ScrCmd_TalkConSioMsg(struct ScriptContext* ctx) {
SetupNativeScript(ctx, FUN_0203A2F0);
return TRUE;
}
THUMB_FUNC BOOL ScrCmd_ABKeyWait(struct ScriptContext* ctx) {
SetupNativeScript(ctx, FUN_0203A46C);
return TRUE;
}
THUMB_FUNC BOOL FUN_0203A46C(struct ScriptContext* ctx) {
if (gUnknown21C48B8.unk48 & 0x3) { // Mask (A | B) ?
return TRUE;
}
return FALSE;
}

View File

@ -8,6 +8,31 @@ struct ScriptContext;
typedef u8 (*ScrCmdFunc)(struct ScriptContext *);
typedef u8 Script[];
struct Unk21C48B8
{
void (*unk0)(s32);
s32 unk4;
s32 unk8;
s32 unkC;
s32 unk10;
s32 unk14;
s32 unk18;
s32 unk1C;
s32 unk20;
s32 unk24;
s32 unk28;
u32 unk2C;
s32 unk30;
s32 unk34;
s32 unk38;
u8 filler3C[0xC];
s32 unk48;
u8 filler4C[0x20];
s32 unk6C;
};
extern struct Unk21C48B8 gUnknown21C48B8;
struct UnkStruct {
u8 unk0;
u8 unk1;