diff options
author | Seth Barberee <seth.barberee@gmail.com> | 2021-08-12 17:26:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-12 17:26:01 -0700 |
commit | d9883945954a30e4b753ecbd5d807f4b6cd2a38a (patch) | |
tree | 093c45ab4de91a75d546f58a6672dfc72136677c /asm | |
parent | e005410884803f1ec8f5942bd0c8d2da5c2e29c8 (diff) |
More data dumping and some code cleaning (#46)
* more data dumping and some code cleaning
* split out cutscene scripts
* initial start at script conversion
* more script work
* use correct type
* clearer up struct field names
* split known scripts into seperate files
* no need to preproc pure ascii strings in debug
* more cutscene work
* split out personality test scripts
* solidify text macros and doc some dungeon fields
* more scripting work
Diffstat (limited to 'asm')
-rw-r--r-- | asm/code_8057824.s | 4 | ||||
-rw-r--r-- | asm/code_8098468.s | 4 | ||||
-rw-r--r-- | asm/code_8098BDC.s | 2 | ||||
-rw-r--r-- | asm/code_80A26CC.s | 10 | ||||
-rw-r--r-- | asm/friend_list_menu.s | 44 | ||||
-rw-r--r-- | asm/macros.inc | 1 | ||||
-rw-r--r-- | asm/macros/script.inc | 415 | ||||
-rw-r--r-- | asm/pokemon_3.s | 12 |
8 files changed, 454 insertions, 38 deletions
diff --git a/asm/code_8057824.s b/asm/code_8057824.s index 413eeb2..2c65ae8 100644 --- a/asm/code_8057824.s +++ b/asm/code_8057824.s @@ -20163,7 +20163,7 @@ _08061B18: str r2, [sp] ldr r2, [sp, 0x12C] add r3, sp, 0x80 - bl sub_808F844 + bl CreatePokemonInfoTabScreen add r0, sp, 0x114 ldrh r0, [r0] strh r0, [r7, 0x1E] @@ -32810,7 +32810,7 @@ _080680C4: adds r1, r7, 0 add r2, sp, 0x4 mov r3, r10 - bl sub_808F844 + bl CreatePokemonInfoTabScreen ldr r1, _080681C8 movs r2, 0 ldrsh r0, [r1, r2] diff --git a/asm/code_8098468.s b/asm/code_8098468.s index fa0a031..1f46809 100644 --- a/asm/code_8098468.s +++ b/asm/code_8098468.s @@ -392,7 +392,7 @@ _080987C0: bl GroundSprite_Reset bl sub_809C63C bl sub_809A62C - bl sub_80A4AEC + bl GroundMap_Reset bl sub_809D0BC bl sub_80AD9D0 bl sub_80A786C @@ -528,7 +528,7 @@ _08098970: .4byte gRealInputs _08098974: .4byte 0x0000030f _08098978: .4byte gPlayTimeRef _0809897C: - bl sub_80A4AEC + bl GroundMap_Reset movs r7, 0x1 negs r7, r7 ldr r0, _080989E8 diff --git a/asm/code_8098BDC.s b/asm/code_8098BDC.s index e068e60..1f43a87 100644 --- a/asm/code_8098BDC.s +++ b/asm/code_8098BDC.s @@ -632,7 +632,7 @@ _080994B0: movs r1, 0x1 movs r2, 0x1 bl sub_800641C - bl sub_80A4AEC + bl GroundMap_Reset bl sub_809D0BC mov r0, r10 bl GroundMap_Select diff --git a/asm/code_80A26CC.s b/asm/code_80A26CC.s index 26c886e..48d8179 100644 --- a/asm/code_80A26CC.s +++ b/asm/code_80A26CC.s @@ -4526,7 +4526,7 @@ sub_80A4A7C: bl sub_809D600 movs r0, 0 bl sub_80A5E8C - bl sub_80A4AEC + bl GroundMap_Reset add sp, 0x4 pop {r4} pop {r0} @@ -4540,7 +4540,7 @@ _080A4AC0: .4byte gUnknown_811736C thumb_func_start sub_80A4AC4 sub_80A4AC4: push {r4,lr} - bl sub_80A4AEC + bl GroundMap_Reset bl sub_80A5EBC ldr r4, _080A4AE8 ldr r0, [r4] @@ -4556,8 +4556,8 @@ sub_80A4AC4: _080A4AE8: .4byte gUnknown_3001B6C thumb_func_end sub_80A4AC4 - thumb_func_start sub_80A4AEC -sub_80A4AEC: + thumb_func_start GroundMap_Reset +GroundMap_Reset: push {r4,lr} movs r0, 0 movs r1, 0x37 @@ -4588,7 +4588,7 @@ _080A4B1E: _080A4B2C: .4byte gUnknown_3001B6C _080A4B30: .4byte gUnknown_8117538 _080A4B34: .4byte gUnknown_3001B70 - thumb_func_end sub_80A4AEC + thumb_func_end GroundMap_Reset thumb_func_start sub_80A4B38 sub_80A4B38: diff --git a/asm/friend_list_menu.s b/asm/friend_list_menu.s index 9c9a903..a01b173 100644 --- a/asm/friend_list_menu.s +++ b/asm/friend_list_menu.s @@ -11096,7 +11096,7 @@ sub_80245D0: adds r4, 0xE0 ldr r4, [r4] str r4, [sp] - bl sub_808F844 + bl CreatePokemonInfoTabScreen add sp, 0x4 pop {r4} pop {r0} @@ -11549,7 +11549,7 @@ _080249E8: ldr r0, _080249F4 b _08024CAE .align 2, 0 -_080249F4: .4byte gUnknown_80DCAD0 +_080249F4: .4byte gLuminousCaveEvolutionInfo _080249F8: ldr r1, [r5] movs r0, 0x4 @@ -11568,7 +11568,7 @@ _08024A14: ldr r0, _08024A1C b _08024A3C .align 2, 0 -_08024A1C: .4byte gUnknown_80DCD90 +_08024A1C: .4byte gLuminousCaveGiveItem _08024A20: movs r0, 0x2 movs r1, 0x3 @@ -11603,7 +11603,7 @@ _08024A42: bl sub_8014248 b _08024CF4 .align 2, 0 -_08024A60: .4byte gUnknown_80DCDB8 +_08024A60: .4byte gLuminousCaveGiveAnotherItem _08024A64: .4byte gUnknown_203B2B0 _08024A68: movs r0, 0x2 @@ -11824,7 +11824,7 @@ _08024C2C: ldr r0, _08024C38 b _08024CAE .align 2, 0 -_08024C38: .4byte gUnknown_80DCF44 +_08024C38: .4byte gLuminousCaveLackLevel _08024C3C: ldr r1, [r5] movs r0, 0x3 @@ -11840,7 +11840,7 @@ _08024C4C: ldr r0, _08024C58 b _08024CAE .align 2, 0 -_08024C58: .4byte gUnknown_80DCFAC +_08024C58: .4byte gLuminousCaveLackFriendArea _08024C5C: ldr r1, [r5] movs r0, 0x3 @@ -11848,7 +11848,7 @@ _08024C5C: ldr r0, _08024C68 b _08024CAE .align 2, 0 -_08024C68: .4byte gUnknown_80DCFF4 +_08024C68: .4byte gLuminousCaveLackRoom _08024C6C: ldr r1, [r5] movs r0, 0x3 @@ -11856,7 +11856,7 @@ _08024C6C: ldr r0, _08024C78 b _08024CAE .align 2, 0 -_08024C78: .4byte gUnknown_80DD054 +_08024C78: .4byte gLuminousCaveLackIQ _08024C7C: ldr r1, [r5] movs r0, 0x3 @@ -11864,7 +11864,7 @@ _08024C7C: ldr r0, _08024C88 b _08024CAE .align 2, 0 -_08024C88: .4byte gUnknown_80DD098 +_08024C88: .4byte gLuminousCaveLackItem _08024C8C: ldr r1, [r5] movs r0, 0x3 @@ -11891,7 +11891,7 @@ _08024CB0: b _08024CF4 .align 2, 0 _08024CBC: .4byte gUnknown_203B2B0 -_08024CC0: .4byte gUnknown_80DD104 +_08024CC0: .4byte gLuminousCaveGiveName _08024CC4: .4byte 0x00000105 _08024CC8: ldr r1, [r5] @@ -14986,8 +14986,8 @@ _08026542: .align 2, 0 _08026574: .4byte gRecruitedPokemonRef _08026578: .4byte gUnknown_203B2B8 -_0802657C: .4byte gUnknown_80DD664 -_08026580: .4byte gUnknown_80DD670 +_0802657C: .4byte gPartyMenuStandBy +_08026580: .4byte gPartyMenuMakeLeader _08026584: ldr r2, [r4] movs r3, 0xB6 @@ -15211,15 +15211,15 @@ _08026710: str r0, [r1, 0x70] b _08026780 .align 2, 0 -_08026734: .4byte gUnknown_80DD67C +_08026734: .4byte gPartyMenuJoinTeam _08026738: .4byte gUnknown_203B2B8 -_0802673C: .4byte gUnknown_80DD688 -_08026740: .4byte gUnknown_80DD694 -_08026744: .4byte gUnknown_80DD69C -_08026748: .4byte gUnknown_80DD6A4 -_0802674C: .4byte gUnknown_80DD6B4 -_08026750: .4byte gUnknown_80DD6BC -_08026754: .4byte gUnknown_80DD6C4 +_0802673C: .4byte gPartyMenuGiveGummi +_08026740: .4byte gPartyMenuGive +_08026744: .4byte gPartyMenuTake +_08026748: .4byte gPartyMenuSayFarewell +_0802674C: .4byte gPartyMenuSummary +_08026750: .4byte gPartyMenuMoves +_08026754: .4byte gPartyMenuCheckIQ _08026758: adds r3, 0x1 cmp r3, r6 @@ -15343,7 +15343,7 @@ _08026814: b _08026872 .align 2, 0 _08026840: .4byte gUnknown_203B2B8 -_08026844: .4byte gUnknown_80DD694 +_08026844: .4byte gPartyMenuGive _08026848: .4byte gUnknown_80D4970 _0802684C: adds r3, 0x1 @@ -16054,7 +16054,7 @@ sub_8026DAC: bx r0 .align 2, 0 _08026E00: .4byte gUnknown_202DE58 -_08026E04: .4byte gUnknown_80DD6D0 +_08026E04: .4byte gPartyMenuItemPlaceholder thumb_func_end sub_8026DAC thumb_func_start sub_8026E08 diff --git a/asm/macros.inc b/asm/macros.inc index e728284..d821836 100644 --- a/asm/macros.inc +++ b/asm/macros.inc @@ -1,2 +1,3 @@ .include "asm/macros/function.inc" .include "asm/macros/music_voice.inc" + .include "asm/macros/script.inc" diff --git a/asm/macros/script.inc b/asm/macros/script.inc new file mode 100644 index 0000000..8ef4bd8 --- /dev/null +++ b/asm/macros/script.inc @@ -0,0 +1,415 @@ +.macro warpLocation id:req + .byte 0x01 + .byte 0x00 + .2byte \id + .4byte 0x00, 0x00, 0x00 +.endm + +.macro warpDungeon id:req + .byte 0x02 + .byte 0x00 + .2byte \id + .4byte 0x00, 0x00, 0x00 +.endm + +.macro warpFriendArea time:req + .byte 0x02 + .byte 0x00 + .2byte \time + .4byte 0x00, 0x00, 0x00 +.endm + +.macro ConfirmDungeonRules + .byte 0x05 + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro changeTileset id:req + .byte 0x08, 0x00, 0x00, 0x00 + .2byte \id + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +@ Start Scene? Run Call? +.macro StartSceneRunCall id:req + .byte 0x0C + .byte \id + .byte 0xFF, 0xFF + .4byte 0x00, 0x00, 0x00 +.endm + +.macro RunCall id:req + .byte 0x0D + .byte \id + .byte 0xFF, 0xFF + .4byte 0x00, 0x00, 0x00 +.endm + +.macro triggerCutscene id:req + .byte 0x1B + .byte 0x00 + .2byte \id + .4byte 0x00, 0x00, 0x00 +.endm + +.macro fadeOut arg0:req time:req arg2:req + .byte 0x23 + .byte \arg0 + .2byte \time + .4byte \arg2 + .4byte 0x00, 0x00 +.endm + +.macro fadeColorOut arg0:req arg1:req time:req color:req + .byte 0x27 + .byte \arg0 + .2byte \arg1 + .4byte \time + .4byte \color + .4byte 0x00 +.endm + +.macro fadeColorIn arg0:req arg1:req time:req color:req + .byte 0x28 + .byte \arg0 + .2byte \arg1 + .4byte \time + .4byte \color + .4byte 0x00 +.endm + +.macro loadData type:req charac:req source:req + .byte 0x2D + .byte \type + .2byte \charac + .2byte \source + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +@ Face Locations +.set bottomL, 0x2 +.set bottomR, 0x3 +.set insetTopL, 0xE +.set insetTopR, 0xF + +.set previousLoc, 0x15 + +.macro selectFace loc:req charac:req face:req + .byte 0x2E + .byte \loc + .2byte \charac + .4byte \face + .4byte 0x00, 0x00 +.endm + +.macro closeTextBox + .byte 0x30 + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro scrollTextBox character:req textPtr:req + .byte 0x33, 0x00 + .2byte \character + .4byte 0x00, 0x00 + .4byte \textPtr +.endm + +.macro PicNameTextBox character:req textPtr:req + .byte 0x34, 0x00 + .2byte \character + .4byte 0x00, 0x00 + .4byte \textPtr +.endm + +.macro quickCloseTextBox character:req textPtr:req + .byte 0x36, 0x00 + .2byte \character + .4byte 0x00, 0x00 + .4byte \textPtr +.endm + +@ Is it always 0xff, 0xff? +.macro floatingText textPtr:req + .byte 0x37, 0x00 + .byte 0xff, 0xff + .4byte 0x00, 0x00 + .4byte \textPtr +.endm + +.macro fadeFloatingText time:req textPtr:req + .byte 0x39, 0x00 + .2byte \time + .4byte 0x00, 0x00 + .4byte \textPtr +.endm + +.macro YesNoTextBox eventID:req character:req textPtr:req + .byte 0x3A, 0x00 + .2byte \eventID + .2byte \character + .2byte 0x00 + .4byte 0x00 + .4byte \textPtr +.endm + +.macro showName arg0:req + .byte 0x3B + .byte \arg0 + .2byte 0x00 + .4byte 0x00, 0x00, 0x00 +.endm + +@ TODO: 0x3C has a lot of different cases... + +.macro renamePoke id:req + .byte 0x3D, 0x00, 0x00, 0x00 + .byte \id, 0x00, 0x00, 0x00 + .4byte 0x00, 0x00 +.endm + +.macro renameTeam + .byte 0x3D, 0x00, 0x00, 0x00 + .4byte 0x00, 0x00, 0x00 +.endm + +.macro abruptStopMusic + .byte 0x42 + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro fadeMusic time:req + .byte 0x43 + .byte 0x00 + .2byte \time + .4byte 0x00, 0x00, 0x00 +.endm + +.macro PlayMusic id:req + .byte 0x44 + .byte 0x00 + .2byte 0x0 + .2byte \id + .2byte 0x00 + .4byte 0x00, 0x00 +.endm + +.macro fadeInMusic id:req time:req + .byte 0x45, 0x00 + .2byte \id + .2byte \time + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +@ Also seen referred to as StopSng +.macro pushR14 + .byte 0x47 + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro fadeMusicOut time:req + .byte 0x48 + .byte 0x00 + .2byte \time + .4byte 0x00, 0x00, 0x00 +.endm + +.macro playSound id:req + .byte 0x4C + .byte 0x00, 0x00, 0x00 + .2byte \id + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +.macro stopSound id:req + .byte 0x4D + .byte 0x00, 0x00, 0x00 + .2byte \id + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +.macro setAnimation anim:req + .byte 0x54 + .byte 0x00 + .2byte \anim + .4byte 0x00, 0x00, 0x00 +.endm + +.macro warpToLoc id:req + .byte 0x5B, 0x00 + .2byte 0x00 + .byte \id + .byte 0x00, 0x00, 0x00 + .4byte 0x00, 0x00 +.endm + +@ move to prefined location along grid +.macro gridMoveTo speed:req id:req + .byte 0x6B, 0x00 + .2byte \speed + .byte \id + .4byte 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro changeSpriteZ speed:req targetHeight:req + .byte 0x70, 0x00 + .byte \speed + .3byte \targetHeight + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +@ Rotation Directions +.set CW, 1 +.set CCW, 2 +.set shortestDir, 0xA + +@ Cardinal Directions / Facing Directions +.set south, 0 +.set southeast, 1 +.set east, 2 +.set northeast, 3 +.set north, 4 +.set northwest, 5 +.set west, 6 +.set southwest, 7 + +.macro setFaceDir delay:req faceDir:req + .byte 0x8B + .byte \delay + .byte \faceDir + .byte 0x00 + .4byte 0x00, 0x00, 0x00 +.endm + +.macro rotate time:req rotDir:req faceDir:req + .byte 0x91 + .byte \time + .byte \rotDir + .byte 0x00 + .byte \faceDir + .byte 0x00 + .4byte 0x00, 0x00 + .2byte 0x00 +.endm + +.macro initVariableTextBox arg0:req arg1:req speaker:req + .byte 0xCF + .byte \arg0 + .byte \arg1 + .byte 0x00 + .4byte \speaker + .4byte 0x00, 0x00 +.endm + +.macro variableTextBox version:req textPtr:req + .byte 0xD0, 0x00 + .2byte \version + .4byte 0x00, 0x00 + .4byte \textPtr +.endm + +.macro elseTextBox textPtr:req + .byte 0xD1, 0x00 + .4byte 0x00, 0x00 + .byte 0x00, 0x00 + .4byte \textPtr +.endm + +.macro pause time:req + .byte 0xDB + .byte 0x00 + .2byte \time + .4byte 0x00, 0x00, 0x00 +.endm + +@ Wait for sound to finish playing? +.macro waitSound id:req + .byte 0xE2 + .byte 0x00 + .2byte \id + .4byte 0x00, 0x00, 0x00 +.endm + +.macro waitFlag flagnum:req + .byte 0xE3 + .byte 0x00 + .2byte \flagnum + .4byte 0x00, 0x00, 0x00 +.endm + +.macro setFlag flagnum:req + .byte 0xE4 + .byte 0x00 + .2byte \flagnum + .4byte 0x00, 0x00, 0x00 +.endm + +.macro goTo id:req + .byte 0xE5 + .byte 0x00 + .byte \id + .byte 0x00 + .4byte 0x00, 0x00, 0x00 +.endm + +@ Loop at label until end of scene +.macro loopLabel id:req + .byte 0xE7, 0x00 + .byte \id, 0x00 + .4byte 0x00, 0x00, 0x00 +.endm + +.macro executeScript scriptNum:req + .byte 0xE8 + .byte 0x00 + .2byte \scriptNum + .4byte 0x00, 0x00, 0x00 +.endm + +.macro MsgEnd arg0:req + .byte 0xE9 + .byte 0x00 + .2byte \arg0 + .4byte 0x00, 0x00, 0x00 +.endm + +.macro endFuncContinueScript + .byte 0xEE + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro endFuncandScript + .byte 0xEF + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro closeThread + .byte 0xF0 + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +.macro closeThreadRemoveObject + .byte 0xF1 + .4byte 0x00, 0x00, 0x00 + .byte 0x00, 0x00, 0x00 +.endm + +@ Set label for loop +.macro label id:req + .byte 0xF4, 0x00 + .byte \id, 0x00 + .4byte 0x00, 0x00, 0x00 +.endm diff --git a/asm/pokemon_3.s b/asm/pokemon_3.s index ccf5979..db8b773 100644 --- a/asm/pokemon_3.s +++ b/asm/pokemon_3.s @@ -539,8 +539,8 @@ sub_808F83C: bx lr thumb_func_end sub_808F83C - thumb_func_start sub_808F844 -sub_808F844: + thumb_func_start CreatePokemonInfoTabScreen +CreatePokemonInfoTabScreen: push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -701,8 +701,8 @@ _0808F964: .align 2, 0 _0808F998: .4byte gUnknown_8107754 _0808F99C: .4byte gUnknown_202DE30 -_0808F9A0: .4byte gUnknown_810DD80 -_0808F9A4: .4byte gUnknown_810DD9C +_0808F9A0: .4byte gLevel810DD6C_Ptr +_0808F9A4: .4byte gExpPts810DD9C_Ptr _0808F9A8: .4byte gUnknown_810DDB8 _0808F9AC: .4byte gUnknown_810DDD0 _0808F9B0: .4byte gUnknown_810DDE4 @@ -1092,7 +1092,7 @@ _0808FCE4: mov r8, r4 b _0808FD84 .align 2, 0 -_0808FCF8: .4byte gUnknown_810DD68 +_0808FCF8: .4byte gIQSkill810DD68_Ptr _0808FCFC: mov r5, sp adds r5, r7 @@ -1337,7 +1337,7 @@ _0808FF10: .4byte gUnknown_810DEF4 _0808FF14: .4byte gUnknown_810E02C _0808FF18: .4byte gUnknown_810DF98 _0808FF1C: .4byte gEvolutionStrings - thumb_func_end sub_808F844 + thumb_func_end CreatePokemonInfoTabScreen thumb_func_start sub_808FF20 sub_808FF20: |