summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/party_menu.s744
-rw-r--r--include/battle_party_menu.h1
-rw-r--r--include/items.h3
-rw-r--r--include/pokemon_menu.h1
-rw-r--r--include/script_pokemon_80F9.h4
-rw-r--r--ld_script.txt2
-rw-r--r--src/battle_party_menu.c2
-rw-r--r--src/party_menu.c532
8 files changed, 445 insertions, 844 deletions
diff --git a/data/party_menu.s b/data/party_menu.s
deleted file mode 100644
index 0911ac987..000000000
--- a/data/party_menu.s
+++ /dev/null
@@ -1,744 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .section .rodata
-
- .align 1
-gUnknown_08376504:: @ 8376504
- .2byte MOVE_FOCUS_PUNCH
- .2byte MOVE_DRAGON_CLAW
- .2byte MOVE_WATER_PULSE
- .2byte MOVE_CALM_MIND
- .2byte MOVE_ROAR
- .2byte MOVE_TOXIC
- .2byte MOVE_HAIL
- .2byte MOVE_BULK_UP
- .2byte MOVE_BULLET_SEED
- .2byte MOVE_HIDDEN_POWER
- .2byte MOVE_SUNNY_DAY
- .2byte MOVE_TAUNT
- .2byte MOVE_ICE_BEAM
- .2byte MOVE_BLIZZARD
- .2byte MOVE_HYPER_BEAM
- .2byte MOVE_LIGHT_SCREEN
- .2byte MOVE_PROTECT
- .2byte MOVE_RAIN_DANCE
- .2byte MOVE_GIGA_DRAIN
- .2byte MOVE_SAFEGUARD
- .2byte MOVE_FRUSTRATION
- .2byte MOVE_SOLAR_BEAM
- .2byte MOVE_IRON_TAIL
- .2byte MOVE_THUNDERBOLT
- .2byte MOVE_THUNDER
- .2byte MOVE_EARTHQUAKE
- .2byte MOVE_RETURN
- .2byte MOVE_DIG
- .2byte MOVE_PSYCHIC
- .2byte MOVE_SHADOW_BALL
- .2byte MOVE_BRICK_BREAK
- .2byte MOVE_DOUBLE_TEAM
- .2byte MOVE_REFLECT
- .2byte MOVE_SHOCK_WAVE
- .2byte MOVE_FLAMETHROWER
- .2byte MOVE_SLUDGE_BOMB
- .2byte MOVE_SANDSTORM
- .2byte MOVE_FIRE_BLAST
- .2byte MOVE_ROCK_TOMB
- .2byte MOVE_AERIAL_ACE
- .2byte MOVE_TORMENT
- .2byte MOVE_FACADE
- .2byte MOVE_SECRET_POWER
- .2byte MOVE_REST
- .2byte MOVE_ATTRACT
- .2byte MOVE_THIEF
- .2byte MOVE_STEEL_WING
- .2byte MOVE_SKILL_SWAP
- .2byte MOVE_SNATCH
- .2byte MOVE_OVERHEAT
- .2byte MOVE_CUT
- .2byte MOVE_FLY
- .2byte MOVE_SURF
- .2byte MOVE_STRENGTH
- .2byte MOVE_FLASH
- .2byte MOVE_ROCK_SMASH
- .2byte MOVE_WATERFALL
- .2byte MOVE_DIVE
-
- .4byte gTileBuffer @ unreferenced?
-
-MenuGfx_HoldIcons:
- .incbin "graphics/interface/hold_icons.4bpp"
-MenuPal_HoldIcons:
- .incbin "graphics/interface/hold_icons.gbapal"
-
- .align 2
-gUnknown_083765DC:: @ 83765DC
- obj_tiles MenuGfx_HoldIcons, 64, 0xd750
-
- .align 2
-gUnknown_083765E4:: @ 83765E4
- obj_pal MenuPal_HoldIcons, 0xd750
-
- .align 2
-gOamData_83765EC:: @ 83765EC
- .2byte 0x0000
- .2byte 0x0000
- .2byte 0x0400
-
- .align 2
-gSpriteAnim_83765F4:: @ 83765F4
- obj_image_anim_frame 0, 1
- obj_image_anim_end
-
- .align 2
-gSpriteAnim_83765FC:: @ 83765FC
- obj_image_anim_frame 1, 1
- obj_image_anim_end
-
- .align 2
-gSpriteAnimTable_8376604:: @ 8376604
- .4byte gSpriteAnim_83765F4
- .4byte gSpriteAnim_83765FC
-
- .align 2
-gSpriteTemplate_837660C:: @ 837660C
- spr_template 55120, 55120, gOamData_83765EC, gSpriteAnimTable_8376604, NULL, gDummySpriteAffineAnimTable, SpriteCB_UpdateHeldItemIconPosition
-
- .align 2
-gUnknown_08376624:: @ 8376624
- .4byte OtherText_ChoosePoke
- .4byte OtherText_MovePokeTo
- .4byte OtherText_TeachWhat
- .4byte OtherText_UseWhat
- .4byte OtherText_GiveWhat
- .4byte OtherText_DoWhat
- .4byte OtherText_NothingToCut
- .4byte OtherText_CantSurf
- .4byte OtherText_AlreadySurfing
- .4byte OtherText_CantUseThatHere
- .4byte OtherText_RestoreWhatMove
- .4byte OtherText_BoostPP
- .4byte gOtherText_CancelWithTerminator
- .4byte OtherText_DoWhatWithItem
- .4byte OtherText_NoPokeForBattle
- .4byte OtherText_ChoosePoke2
- .4byte OtherText_NotEnoughHP
- .4byte OtherText_ThreePokeNeeded
- .4byte OtherText_PokeCantBeSame
- .4byte OtherText_NoIdenticalHoldItems
- .4byte OtherText_TeachWhichPoke
-
- .align 2
-gUnknown_08376678:: @ 8376678
- .byte 16, 40, 0, 0
- .byte 104, 18, 0, 0
- .byte 104, 42, 0, 0
- .byte 104, 66, 0, 0
- .byte 104, 90, 0, 0
- .byte 104, 114, 0, 0
- .byte 16, 24, 0, 0
- .byte 16, 80, 0, 0
- .byte 104, 18, 0, 0
- .byte 104, 50, 0, 0
- .byte 104, 82, 0, 0
- .byte 104, 114, 0, 0
- .byte 16, 24, 0, 0
- .byte 16, 80, 0, 0
- .byte 104, 26, 0, 0
- .byte 104, 50, 0, 0
- .byte 104, 82, 0, 0
- .byte 104, 106, 0, 0
- .byte 16, 24, 0, 0
- .byte 104, 26, 0, 0
- .byte 104, 50, 0, 0
- .byte 16, 80, 0, 0
- .byte 104, 82, 0, 0
- .byte 104, 106, 0, 0
- .byte 5, 4, 0, 0
- .byte 16, 1, 0, 0
- .byte 16, 4, 0, 0
- .byte 16, 7, 0, 0
- .byte 16, 10, 0, 0
- .byte 16, 13, 0, 0
- .byte 5, 2, 0, 0
- .byte 5, 9, 0, 0
- .byte 16, 1, 0, 0
- .byte 16, 5, 0, 0
- .byte 16, 9, 0, 0
- .byte 16, 13, 0, 0
- .byte 5, 2, 0, 0
- .byte 5, 9, 0, 0
- .byte 16, 2, 0, 0
- .byte 16, 5, 0, 0
- .byte 16, 9, 0, 0
- .byte 16, 12, 0, 0
- .byte 5, 2, 0, 0
- .byte 16, 2, 0, 0
- .byte 16, 5, 0, 0
- .byte 5, 9, 0, 0
- .byte 16, 9, 0, 0
- .byte 16, 12, 0, 0
-
- .align 2
-gUnknown_08376738:: @ 8376738
- .byte 6, 5, 0, 0
- .byte 17, 2, 0, 0
- .byte 17, 5, 0, 0
- .byte 17, 8, 0, 0
- .byte 17, 11, 0, 0
- .byte 17, 14, 0, 0
- .byte 6, 3, 0, 0
- .byte 6, 10, 0, 0
- .byte 17, 2, 0, 0
- .byte 17, 6, 0, 0
- .byte 17, 10, 0, 0
- .byte 17, 14, 0, 0
- .byte 6, 3, 0, 0
- .byte 6, 10, 0, 0
- .byte 17, 3, 0, 0
- .byte 17, 6, 0, 0
- .byte 17, 10, 0, 0
- .byte 17, 13, 0, 0
- .byte 6, 3, 0, 0
- .byte 17, 3, 0, 0
- .byte 17, 6, 0, 0
- .byte 6, 10, 0, 0
- .byte 17, 10, 0, 0
- .byte 17, 13, 0, 0
- .byte 3, 7, 0, 0
- .byte 22, 2, 0, 0
- .byte 22, 5, 0, 0
- .byte 22, 8, 0, 0
- .byte 22, 11, 0, 0
- .byte 22, 14, 0, 0
- .byte 3, 5, 0, 0
- .byte 3, 12, 0, 0
- .byte 22, 2, 0, 0
- .byte 22, 6, 0, 0
- .byte 22, 10, 0, 0
- .byte 22, 14, 0, 0
- .byte 3, 5, 0, 0
- .byte 3, 12, 0, 0
- .byte 22, 3, 0, 0
- .byte 22, 6, 0, 0
- .byte 22, 10, 0, 0
- .byte 22, 13, 0, 0
- .byte 3, 5, 0, 0
- .byte 22, 3, 0, 0
- .byte 22, 6, 0, 0
- .byte 3, 12, 0, 0
- .byte 22, 10, 0, 0
- .byte 22, 13, 0, 0
- .byte 7, 7, 0, 0
- .byte 26, 2, 0, 0
- .byte 26, 5, 0, 0
- .byte 26, 8, 0, 0
- .byte 26, 11, 0, 0
- .byte 26, 14, 0, 0
- .byte 7, 5, 0, 0
- .byte 7, 12, 0, 0
- .byte 26, 2, 0, 0
- .byte 26, 6, 0, 0
- .byte 26, 10, 0, 0
- .byte 26, 14, 0, 0
- .byte 7, 5, 0, 0
- .byte 7, 12, 0, 0
- .byte 26, 3, 0, 0
- .byte 26, 6, 0, 0
- .byte 26, 10, 0, 0
- .byte 26, 13, 0, 0
- .byte 7, 5, 0, 0
- .byte 26, 3, 0, 0
- .byte 26, 6, 0, 0
- .byte 7, 12, 0, 0
- .byte 26, 10, 0, 0
- .byte 26, 13, 0, 0
-
- .align 2
-gUnknown_08376858:: @ 8376858
- .4byte BG_VRAM + 0xF1C8
- .4byte BG_VRAM + 0xF0AE
- .4byte BG_VRAM + 0xF16E
- .4byte BG_VRAM + 0xF22E
- .4byte BG_VRAM + 0xF2EE
- .4byte BG_VRAM + 0xF3AE
- .4byte BG_VRAM + 0xF148
- .4byte BG_VRAM + 0xF308
- .4byte BG_VRAM + 0xF0AE
- .4byte BG_VRAM + 0xF1AE
- .4byte BG_VRAM + 0xF2AE
- .4byte BG_VRAM + 0xF3AE
- .4byte BG_VRAM + 0xF148
- .4byte BG_VRAM + 0xF308
- .4byte BG_VRAM + 0xF0EE
- .4byte BG_VRAM + 0xF1AE
- .4byte BG_VRAM + 0xF2AE
- .4byte BG_VRAM + 0xF36E
- .4byte BG_VRAM + 0xF148
- .4byte BG_VRAM + 0xF0EE
- .4byte BG_VRAM + 0xF1AE
- .4byte BG_VRAM + 0xF308
- .4byte BG_VRAM + 0xF2AE
- .4byte BG_VRAM + 0xF36E
-
- .align 2
-gUnknown_083768B8:: @ 83768B8
- .byte 8, 44, 0, 0
- .byte 92, 22, 0, 0
- .byte 92, 46, 0, 0
- .byte 92, 70, 0, 0
- .byte 92, 94, 0, 0
- .byte 92, 118, 0, 0
- .byte 196, 136, 0, 0
- .byte 196, 152, 0, 0
- .byte 8, 28, 0, 0
- .byte 8, 84, 0, 0
- .byte 92, 22, 0, 0
- .byte 92, 54, 0, 0
- .byte 92, 86, 0, 0
- .byte 92, 118, 0, 0
- .byte 196, 136, 0, 0
- .byte 196, 152, 0, 0
- .byte 8, 28, 0, 0
- .byte 8, 84, 0, 0
- .byte 92, 30, 0, 0
- .byte 92, 54, 0, 0
- .byte 92, 86, 0, 0
- .byte 92, 110, 0, 0
- .byte 196, 136, 0, 0
- .byte 196, 152, 0, 0
-
- .align 2
-gUnknown_08376918:: @ 8376918
- .4byte BG_VRAM + 0xF1C6
- .4byte BG_VRAM + 0xF06C
- .4byte BG_VRAM + 0xF12C
- .4byte BG_VRAM + 0xF1EC
- .4byte BG_VRAM + 0xF2AC
- .4byte BG_VRAM + 0xF36C
- .4byte BG_VRAM + 0xF148
- .4byte BG_VRAM + 0xF308
- .4byte BG_VRAM + 0xF0AE
- .4byte BG_VRAM + 0xF1AE
- .4byte BG_VRAM + 0xF2AE
- .4byte BG_VRAM + 0xF3AE
-
- .align 2
-gUnknown_08376948:: @ 8376948
- .byte 2, 4, 10, 9
- .byte 16, 1, 29, 3
- .byte 16, 4, 29, 6
- .byte 16, 7, 29, 9
- .byte 16, 10, 29, 12
- .byte 16, 13, 29, 15
- .byte 2, 2, 10, 7
- .byte 2, 9, 10, 14
- .byte 16, 1, 29, 3
- .byte 16, 5, 29, 7
- .byte 16, 9, 29, 11
- .byte 16, 13, 29, 15
-
- .align 2
-gUnknown_08376978:: @ 8376978
- .byte 2, 7, 10, 9
- .byte 21, 1, 29, 3
- .byte 21, 4, 29, 6
- .byte 21, 7, 29, 9
- .byte 21, 10, 29, 12
- .byte 21, 13, 29, 15
- .byte 2, 2, 10, 7
- .byte 2, 9, 10, 14
- .byte 16, 1, 29, 3
- .byte 16, 5, 29, 7
- .byte 16, 9, 29, 11
- .byte 16, 13, 29, 15
-
- .align 2
-gUnknown_083769A8:: @ 83769A8
- .byte 0, 3, 11, 1, 11, 4, 11, 7, 11, 10, 11, 13
- .byte 0, 1, 0, 8, 11, 1, 11, 5, 11, 9, 11, 13
-
- .align 2
-gUnknown_083769C0:: @ 83769C0
- .byte 0, 1
- .byte 0, 8
- .byte 11, 2
- .byte 11, 5
- .byte 11, 9
- .byte 11, 12
- .byte 0, 1
- .byte 0, 8
- .byte 11, 2
- .byte 11, 5
- .byte 11, 9
- .byte 11, 12
-
-gUnknown_083769D8:: @ 83769D8
- .byte 0x24,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x27
- .byte 0x34,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x37
- .byte 0x34,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x37
- .byte 0x34,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x37
- .byte 0x44,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x47
- .byte 0x44,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x47
- .byte 0x54,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x57
-
-gUnknown_08376A25:: @ 8376A25
- .byte 0x50,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x53
- .byte 0x60,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x63
- .byte 0x70,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x73
-
-gUnknown_08376A5E:: @ 8376A5E
- .byte 0x20,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x23
- .byte 0x30,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x33
- .byte 0x40,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x43
-
-@ unknown, unreferenced data
- .byte 0x0C
- .byte 0x0D
- .byte 0x0E
- .byte 0x0F
- .byte 0x00
- .byte 0x01
- .byte 0x02
- .byte 0x03
- .byte 0x04
- .byte 0x05
- .byte 0x0F
- .byte 0x10
- .byte 0x11
- .byte 0x12
- .byte 0x13
- .byte 0x14
- .byte 0x15
- .byte 0x0F
- .byte 0x06
- .byte 0x05
- .byte 0x01
- .byte 0x07
- .byte 0x08
- .byte 0x09
- .byte 0x0F
- .byte 0x16
- .byte 0x15
- .byte 0x11
- .byte 0x17
- .byte 0x18
- .byte 0x19
- .byte 0x0F
- .byte 0x09
- .byte 0x0A
- .byte 0x0B
- .byte 0x05
- .byte 0x0C
- .byte 0x0F
- .byte 0x0F
- .byte 0x19
- .byte 0x1A
- .byte 0x1B
- .byte 0x15
- .byte 0x1C
- .byte 0x0F
- .byte 0x0F
- .byte 0x0D
- .byte 0x0B
- .byte 0x05
- .byte 0x0C
- .byte 0x0F
- .byte 0x0F
- .byte 0x0F
- .byte 0x1D
- .byte 0x1B
- .byte 0x15
- .byte 0x1C
- .byte 0x0F
- .byte 0x0F
- .byte 0x0F
- .byte 0x06
- .byte 0x05
- .byte 0x0B
- .byte 0x05
- .byte 0x0C
- .byte 0x0F
- .byte 0x0F
- .byte 0x16
- .byte 0x15
- .byte 0x1B
- .byte 0x15
- .byte 0x1C
- .byte 0x0F
- .byte 0x0F
- .byte 0x0F
- .byte 0x0F
- .byte 0x20
- .byte 0x0C
- .byte 0x09
- .byte 0x0F
- .byte 0x0F
- .byte 0x0F
- .byte 0x1F
- .byte 0x30
- .byte 0x1C
- .byte 0x19
- .byte 0x0F
- .byte 0x0F
- .byte 0x0F
- .byte 0x25
- .byte 0x0F
- .byte 0x22
- .byte 0x24
- .byte 0x0F
- .byte 0x0F
- .byte 0x0F
- .byte 0x35
- .byte 0x41
- .byte 0x32
- .byte 0x34
- .byte 0x0F
- .byte 0x0F
- .byte 0x0F
- .byte 0x26
- .byte 0x0F
- .byte 0x23
- .byte 0x0E
- .byte 0x0F
- .byte 0x0F
- .byte 0x0F
- .byte 0x36
- .byte 0x43
- .byte 0x33
- .byte 0x1E
- .byte 0x0F
- .byte 0x0F
- .byte 0x27
- .byte 0x28
- .byte 0x29
- .byte 0x03
- .byte 0x2A
- .byte 0x0F
- .byte 0x0F
- .byte 0x37
- .byte 0x38
- .byte 0x39
- .byte 0x13
- .byte 0x3A
- .byte 0x0F
- .byte 0x0F
- .byte 0x27
- .byte 0x28
- .byte 0x29
- .byte 0x03
- .byte 0x04
- .byte 0x05
- .byte 0x0F
- .byte 0x37
- .byte 0x38
- .byte 0x39
- .byte 0x13
- .byte 0x14
- .byte 0x15
- .byte 0x0F
- .byte 0x2B
- .byte 0x2C
- .byte 0x02
- .byte 0x28
- .byte 0x29
- .byte 0x2D
- .byte 0x21
- .byte 0x3B
- .byte 0x3C
- .byte 0x12
- .byte 0x38
- .byte 0x39
- .byte 0x3D
- .byte 0x31
- .byte 0x2B
- .byte 0x2C
- .byte 0x02
- .byte 0x28
- .byte 0x29
- .byte 0x08
- .byte 0x09
- .byte 0x3B
- .byte 0x3C
- .byte 0x12
- .byte 0x38
- .byte 0x39
- .byte 0x18
- .byte 0x19
- .byte 0x2E
- .byte 0x2F
- .byte 0x2B
- .byte 0x2C
- .byte 0x02
- .byte 0x27
- .byte 0x2D
- .byte 0x3E
- .byte 0x3F
- .byte 0x3B
- .byte 0x3C
- .byte 0x12
- .byte 0x45
- .byte 0x3D
-
- .align 2
-gUnknown_08376B54:: @ 8376B54
- .4byte ItemUseMoveMenu_HandleMoveSelection
- .4byte ItemUseMoveMenu_HandleCancel
-
- .align 1
-Unknown_08376B5C:
- .2byte 0x4000, 0x4018, 0xF400
- .2byte 0x4000, 0x4038, 0xF404
- .2byte 0x4008, 0x4018, 0xF408
- .2byte 0x4008, 0x4038, 0xF40C
- .2byte 0x4010, 0x4020, 0xF410
- .2byte 0x4020, 0x4025, 0xF418
- .2byte 0x4020, 0x4045, 0xF41C
- .2byte -1
-
- .align 1
-Unknown_08376B88:
- .2byte 0x4000, 0x4018, 0xF400
- .2byte 0x4000, 0x4038, 0xF404
- .2byte 0x4008, 0x4018, 0xF408
- .2byte 0x4008, 0x4038, 0xF40C
- .2byte 0x4010, 0x4020, 0xF410
- .2byte 0x4010, 0x4065, 0xF418
- .2byte 0x4010, 0x4085, 0xF41C
- .2byte -1
-
- .align 2
-gUnknown_08376BB4:: @ 8376BB4
- .byte 0x1, 0x4
- .space 2
- .4byte Unknown_08376B5C
-
- .byte 0xC, 0x1
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0xC, 0x4
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0xC, 0x7
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0xC, 0xA
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0xC, 0xD
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0x1, 0x2
- .space 2
- .4byte Unknown_08376B5C
-
- .byte 0x1, 0x9
- .space 2
- .4byte Unknown_08376B5C
-
- .byte 0xC, 0x1
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0xC, 0x5
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0xC, 0x9
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0xC, 0xD
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0x1, 0x2
- .space 2
- .4byte Unknown_08376B5C
-
- .byte 0x1, 0x9
- .space 2
- .4byte Unknown_08376B5C
-
- .byte 0xC, 0x2
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0xC, 0x5
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0xC, 0x9
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0xC, 0xC
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0x1, 0x2
- .space 2
- .4byte Unknown_08376B5C
-
- .byte 0xC, 0x2
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0xC, 0x5
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0x1, 0x9
- .space 2
- .4byte Unknown_08376B5C
-
- .byte 0xC, 0x9
- .space 2
- .4byte Unknown_08376B88
-
- .byte 0xC, 0xC
- .space 2
- .4byte Unknown_08376B88
-
- .align 2
-gUnknown_08376C74:: @ 8376C74
- .4byte sub_8089CD4, sub_806AFD0, 0
- .4byte SetUpBattlePokemonMenu, SetUpBattlePartyMenu, 0
- .4byte sub_80F9C6C, sub_80F9ACC, 0
- .4byte sub_80F9C6C, sub_806AFD0, 0
- .4byte sub_81222B0, sub_8121E78, 0
- .4byte sub_8122A48, sub_8122854, 0xFF
- .4byte sub_8122E0C, sub_806AFD0, 0x0F
- .4byte sub_80F9E64, sub_80F9CE8, 0
-
- .align 2
-gUnknown_08376CD4:: @ 8376CD4
- .2byte 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F
- .2byte 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F
-
- .align 2
-gUnknown_08376CEC:: @ 8376CEC
- .2byte 0x2A, 0x0B, 0x0C, 0x0D, 0x0E, 0x2F
- .2byte 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F
-
- .align 2
-gUnknown_08376D04:: @ 8376D04
- .4byte gOtherText_HP
- .4byte gOtherText_Attack
- .4byte gOtherText_Defense
- .4byte gOtherText_SpAtk
- .4byte gOtherText_SpDef
- .4byte gOtherText_Speed
-
-gUnknown_08376D1C:: @ 8376D1C
- .byte 0x3A @ HP
- .byte 0x3B @ Attack
- .byte 0x3C @ Defense
- .byte 0x3E @ Sp. Attack
- .byte 0x3F @ Sp. Defense
- .byte 0x3D @ Speed
diff --git a/include/battle_party_menu.h b/include/battle_party_menu.h
index 71bd2cf51..c3bebbcd4 100644
--- a/include/battle_party_menu.h
+++ b/include/battle_party_menu.h
@@ -5,5 +5,6 @@ extern u8 unk_2000000[];
#define EWRAM_1609D unk_2000000[0x1609D]
void SetUpBattlePokemonMenu(u8);
+bool8 SetUpBattlePartyMenu(void);
#endif
diff --git a/include/items.h b/include/items.h
index 69515f18e..44b0f2013 100644
--- a/include/items.h
+++ b/include/items.h
@@ -386,4 +386,7 @@ enum
ITEM_OLD_SEA_MAP, // 0x178
};
+#define NUM_TECHNICAL_MACHINES 50
+#define NUM_HIDDEN_MACHINES 8
+
#endif // GUARD_ITEMS_H
diff --git a/include/pokemon_menu.h b/include/pokemon_menu.h
index 1c8e6772f..5cac57d5d 100644
--- a/include/pokemon_menu.h
+++ b/include/pokemon_menu.h
@@ -36,6 +36,7 @@ enum
extern u8 gLastFieldPokeMenuOpened;
extern void (*gUnknown_03005CE4)(void);
+void sub_8089CD4(u8 taskID);
void sub_808B5B4(u32 taskID);
void sub_8089A70(void);
void sub_8089C50(u8 arg0, u8 arg1, u8 arg2, u8 noOfOptions, const struct MenuAction2 *menuActions, const u8 *order);
diff --git a/include/script_pokemon_80F9.h b/include/script_pokemon_80F9.h
index d65c99c15..7124c1916 100644
--- a/include/script_pokemon_80F9.h
+++ b/include/script_pokemon_80F9.h
@@ -13,5 +13,9 @@ void sub_80F9A8C(u8);
void sub_80F9C00(void);
void sub_80F9E1C(void);
void sub_80F99CC(void);
+void sub_80F9C6C(u8 var);
+bool8 sub_80F9ACC(void);
+void sub_80F9E64(u8 var);
+bool8 sub_80F9CE8(void);
#endif
diff --git a/ld_script.txt b/ld_script.txt
index 7b5e18167..055d80ed5 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -355,7 +355,7 @@ SECTIONS {
src/coord_event_weather.o(.rodata);
src/field_tasks.o(.rodata);
data/reset_rtc_screen.o(.rodata);
- data/party_menu.o(.rodata);
+ src/party_menu.o(.rodata);
src/start_menu.o(.rodata);
src/menu.o(.rodata);
data/tileset_anim.o(.rodata);
diff --git a/src/battle_party_menu.c b/src/battle_party_menu.c
index fdc1d503d..34af8147e 100644
--- a/src/battle_party_menu.c
+++ b/src/battle_party_menu.c
@@ -348,7 +348,7 @@ void sub_8094E4C(void)
sub_8094E20(3);
}
-int SetUpBattlePartyMenu(void)
+bool8 SetUpBattlePartyMenu(void)
{
switch (EWRAM_1B000.unk264)
//switch (ewram1B000.unk264[0])
diff --git a/src/party_menu.c b/src/party_menu.c
index bcc5ece9f..4a5773f11 100644
--- a/src/party_menu.c
+++ b/src/party_menu.c
@@ -3,6 +3,7 @@
#include "battle.h"
#include "battle_interface.h"
#include "battle_party_menu.h"
+#include "choose_party.h"
#include "data2.h"
#include "decompress.h"
#include "event_data.h"
@@ -15,6 +16,7 @@
#include "main.h"
#include "menu.h"
#include "menu_helpers.h"
+#include "moves.h"
#include "palette.h"
#include "pokemon.h"
#include "pokemon_icon.h"
@@ -23,6 +25,7 @@
#include "pokemon_summary_screen.h"
#include "rom_8077ABC.h"
#include "rom_8094928.h"
+#include "script_pokemon_80F9.h"
#include "songs.h"
#include "sound.h"
#include "species.h"
@@ -32,6 +35,418 @@
#include "task.h"
#include "util.h"
+struct Coords8
+{
+ u8 x;
+ u8 y;
+};
+
+struct PartyMenuWindowCoords
+{
+ u8 left;
+ u8 top;
+ u8 right;
+ u8 bottom;
+};
+
+struct UnknownStruct5
+{
+ u8 unk0;
+ u8 unk1;
+ const u16 *unk4;
+};
+
+struct PartyMenuFunctionsStruct
+{
+ /*0x0*/TaskFunc func1;
+ /*0x4*/bool8 (*func2)(void);
+ /*0x8*/u8 unk8;
+};
+
+static void nullsub_12(u8 monIndex, struct Pokemon *pokemon);
+static void TryPrintPartyMenuMonNickname(u8 monIndex, struct Pokemon *pokemon);
+static void PartyMenuTryPrintHP(u8 monIndex, struct Pokemon *pokemon);
+static void sub_806D05C(u8 taskId);
+static void sub_806D15C(u8 taskId);
+static void sub_806D198(u8 taskId);
+static void sub_806E884(u8 taskId);
+static void sub_8070D90(u8 taskId);
+static void sub_806D5B8(u8 taskId);
+static void sub_806D014(u8 taskId);
+static void sub_806D118(u8 taskId);
+static void sub_806B460(void);
+static void sub_806B548(void);
+static void sub_806BA94(s16 a, u16 b, u8 c, u8 d);
+static void sub_806B9A4(s16 a, u16 b, u8 c);
+static void sub_806CA18(u8 taskId, u8 b);
+static void sub_806C310(u8 spriteId, u8 menuIndex, s8 directionPressed);
+static void sub_806C1E4(u8 spriteId, u8 menuIndex, s8 directionPressed);
+static void sub_806C490(u8 spriteId, u8 menuIndex, s8 directionPressed);
+static void UpdateMonIconFrame_806DA0C(struct Sprite *sprite);
+static void UpdateMonIconFrame_806DA38(struct Sprite *sprite);
+static void UpdateMonIconFrame_806DA44(u8 taskId, u8 monIndex, u8 c);
+static u8 sub_806CA00(u8 taskId);
+static void SpriteCB_sub_806D37C(struct Sprite *sprite);
+static u8 GetMonIconSpriteId_maybe(u8 taskId, u8 monIndex);
+static void SpriteCB_UpdateHeldItemIconPosition(struct Sprite *sprite);
+static void ItemUseMoveMenu_HandleMoveSelection(u8 taskId);
+static void ItemUseMoveMenu_HandleCancel(u8 taskId);
+static bool8 sub_806AFD0(void);
+
+const u16 TMHMMoves[] = {
+ MOVE_FOCUS_PUNCH,
+ MOVE_DRAGON_CLAW,
+ MOVE_WATER_PULSE,
+ MOVE_CALM_MIND,
+ MOVE_ROAR,
+ MOVE_TOXIC,
+ MOVE_HAIL,
+ MOVE_BULK_UP,
+ MOVE_BULLET_SEED,
+ MOVE_HIDDEN_POWER,
+ MOVE_SUNNY_DAY,
+ MOVE_TAUNT,
+ MOVE_ICE_BEAM,
+ MOVE_BLIZZARD,
+ MOVE_HYPER_BEAM,
+ MOVE_LIGHT_SCREEN,
+ MOVE_PROTECT,
+ MOVE_RAIN_DANCE,
+ MOVE_GIGA_DRAIN,
+ MOVE_SAFEGUARD,
+ MOVE_FRUSTRATION,
+ MOVE_SOLAR_BEAM,
+ MOVE_IRON_TAIL,
+ MOVE_THUNDERBOLT,
+ MOVE_THUNDER,
+ MOVE_EARTHQUAKE,
+ MOVE_RETURN,
+ MOVE_DIG,
+ MOVE_PSYCHIC,
+ MOVE_SHADOW_BALL,
+ MOVE_BRICK_BREAK,
+ MOVE_DOUBLE_TEAM,
+ MOVE_REFLECT,
+ MOVE_SHOCK_WAVE,
+ MOVE_FLAMETHROWER,
+ MOVE_SLUDGE_BOMB,
+ MOVE_SANDSTORM,
+ MOVE_FIRE_BLAST,
+ MOVE_ROCK_TOMB,
+ MOVE_AERIAL_ACE,
+ MOVE_TORMENT,
+ MOVE_FACADE,
+ MOVE_SECRET_POWER,
+ MOVE_REST,
+ MOVE_ATTRACT,
+ MOVE_THIEF,
+ MOVE_STEEL_WING,
+ MOVE_SKILL_SWAP,
+ MOVE_SNATCH,
+ MOVE_OVERHEAT,
+ MOVE_CUT,
+ MOVE_FLY,
+ MOVE_SURF,
+ MOVE_STRENGTH,
+ MOVE_FLASH,
+ MOVE_ROCK_SMASH,
+ MOVE_WATERFALL,
+ MOVE_DIVE,
+};
+
+//FIXME
+//const u8 *unrefTileBuffer = gTileBuffer;
+asm(".4byte gTileBuffer\n");
+
+static const u8 MenuGfx_HoldIcons[] = INCBIN_U8("graphics/interface/hold_icons.4bpp");
+static const u16 MenuPal_HoldIcons[] = INCBIN_U16("graphics/interface/hold_icons.gbapal");
+
+static const struct SpriteSheet gUnknown_083765DC = {
+ MenuGfx_HoldIcons,
+ sizeof MenuGfx_HoldIcons,
+ 0xd750
+};
+
+static const struct SpritePalette gUnknown_083765E4 = {
+ MenuPal_HoldIcons,
+ 0xd750
+};
+
+static const struct OamData gOamData_83765EC =
+{
+ .y = 0,
+ .affineMode = 0,
+ .objMode = 0,
+ .mosaic = 0,
+ .bpp = 0,
+ .shape = 0,
+ .x = 0,
+ .matrixNum = 0,
+ .size = 0,
+ .tileNum = 0,
+ .priority = 1,
+ .paletteNum = 0,
+ .affineParam = 0,
+};
+
+static const union AnimCmd gSpriteAnim_83765F4[] = {
+ ANIMCMD_FRAME(0, 1),
+ ANIMCMD_END
+};
+
+static const union AnimCmd gSpriteAnim_83765FC[] = {
+ ANIMCMD_FRAME(1, 1),
+ ANIMCMD_END
+};
+
+static const union AnimCmd *const gSpriteAnimTable_8376604[] = {
+ gSpriteAnim_83765F4,
+ gSpriteAnim_83765FC,
+};
+
+static const struct SpriteTemplate gSpriteTemplate_837660C = {
+ 55120,
+ 55120,
+ &gOamData_83765EC,
+ gSpriteAnimTable_8376604,
+ NULL,
+ gDummySpriteAffineAnimTable,
+ SpriteCB_UpdateHeldItemIconPosition
+};
+
+static const u8 *const gUnknown_08376624[] = {
+ OtherText_ChoosePoke,
+ OtherText_MovePokeTo,
+ OtherText_TeachWhat,
+ OtherText_UseWhat,
+ OtherText_GiveWhat,
+ OtherText_DoWhat,
+ OtherText_NothingToCut,
+ OtherText_CantSurf,
+ OtherText_AlreadySurfing,
+ OtherText_CantUseThatHere,
+ OtherText_RestoreWhatMove,
+ OtherText_BoostPP,
+ gOtherText_CancelWithTerminator,
+ OtherText_DoWhatWithItem,
+ OtherText_NoPokeForBattle,
+ OtherText_ChoosePoke2,
+ OtherText_NotEnoughHP,
+ OtherText_ThreePokeNeeded,
+ OtherText_PokeCantBeSame,
+ OtherText_NoIdenticalHoldItems,
+ OtherText_TeachWhichPoke,
+};
+
+static const struct Coords8 gUnknown_08376678[8][6] = {
+ {{16, 40}, {104, 18}, {104, 42}, {104, 66}, {104, 90}, {104, 114}},
+ {{16, 24}, { 16, 80}, {104, 18}, {104, 50}, {104, 82}, {104, 114}},
+ {{16, 24}, { 16, 80}, {104, 26}, {104, 50}, {104, 82}, {104, 106}},
+ {{16, 24}, {104, 26}, {104, 50}, { 16, 80}, {104, 82}, {104, 106}},
+ {{ 5, 4}, { 16, 1}, { 16, 4}, { 16, 7}, { 16, 10}, { 16, 13}},
+ {{ 5, 2}, { 5, 9}, { 16, 1}, { 16, 5}, { 16, 9}, { 16, 13}},
+ {{ 5, 2}, { 5, 9}, { 16, 2}, { 16, 5}, { 16, 9}, { 16, 12}},
+ {{ 5, 2}, { 16, 2}, { 16, 5}, { 5, 9}, { 16, 9}, { 16, 12}},
+};
+
+static const struct Coords8 gUnknown_08376738[12][6] = {
+ {{6, 5}, {17, 2}, {17, 5}, {17, 8}, {17, 11}, {17, 14}},
+ {{6, 3}, { 6, 10}, {17, 2}, {17, 6}, {17, 10}, {17, 14}},
+ {{6, 3}, { 6, 10}, {17, 3}, {17, 6}, {17, 10}, {17, 13}},
+ {{6, 3}, {17, 3}, {17, 6}, { 6, 10}, {17, 10}, {17, 13}},
+ {{3, 7}, {22, 2}, {22, 5}, {22, 8}, {22, 11}, {22, 14}},
+ {{3, 5}, { 3, 12}, {22, 2}, {22, 6}, {22, 10}, {22, 14}},
+ {{3, 5}, { 3, 12}, {22, 3}, {22, 6}, {22, 10}, {22, 13}},
+ {{3, 5}, {22, 3}, {22, 6}, { 3, 12}, {22, 10}, {22, 13}},
+ {{7, 7}, {26, 2}, {26, 5}, {26, 8}, {26, 11}, {26, 14}},
+ {{7, 5}, { 7, 12}, {26, 2}, {26, 6}, {26, 10}, {26, 14}},
+ {{7, 5}, { 7, 12}, {26, 3}, {26, 6}, {26, 10}, {26, 13}},
+ {{7, 5}, {26, 3}, {26, 6}, { 7, 12}, {26, 10}, {26, 13}},
+};
+
+static u16 *const gUnknown_08376858[4][6] = {
+ {(u16*)(BG_VRAM + 0xF1C8), (u16*)(BG_VRAM + 0xF0AE), (u16*)(BG_VRAM + 0xF16E), (u16*)(BG_VRAM + 0xF22E), (u16*)(BG_VRAM + 0xF2EE), (u16*)(BG_VRAM + 0xF3AE)},
+ {(u16*)(BG_VRAM + 0xF148), (u16*)(BG_VRAM + 0xF308), (u16*)(BG_VRAM + 0xF0AE), (u16*)(BG_VRAM + 0xF1AE), (u16*)(BG_VRAM + 0xF2AE), (u16*)(BG_VRAM + 0xF3AE)},
+ {(u16*)(BG_VRAM + 0xF148), (u16*)(BG_VRAM + 0xF308), (u16*)(BG_VRAM + 0xF0EE), (u16*)(BG_VRAM + 0xF1AE), (u16*)(BG_VRAM + 0xF2AE), (u16*)(BG_VRAM + 0xF36E)},
+ {(u16*)(BG_VRAM + 0xF148), (u16*)(BG_VRAM + 0xF0EE), (u16*)(BG_VRAM + 0xF1AE), (u16*)(BG_VRAM + 0xF308), (u16*)(BG_VRAM + 0xF2AE), (u16*)(BG_VRAM + 0xF36E)},
+};
+
+static const struct Coords8 gUnknown_083768B8[3][8] = {
+ {{8, 44}, {92, 22}, {92, 46}, {92, 70}, {92, 94}, {92, 118}, {196, 136}, {196, 152}},
+ {{8, 28}, { 8, 84}, {92, 22}, {92, 54}, {92, 86}, {92, 118}, {196, 136}, {196, 152}},
+ {{8, 28}, { 8, 84}, {92, 30}, {92, 54}, {92, 86}, {92, 110}, {196, 136}, {196, 152}},
+};
+
+static u16 *const gUnknown_08376918[2][PARTY_SIZE] = {
+ {(u16*)(BG_VRAM + 0xF1C6), (u16*)(BG_VRAM + 0xF06C), (u16*)(BG_VRAM + 0xF12C), (u16*)(BG_VRAM + 0xF1EC), (u16*)(BG_VRAM + 0xF2AC), (u16*)(BG_VRAM + 0xF36C)},
+ {(u16*)(BG_VRAM + 0xF148), (u16*)(BG_VRAM + 0xF308), (u16*)(BG_VRAM + 0xF0AE), (u16*)(BG_VRAM + 0xF1AE), (u16*)(BG_VRAM + 0xF2AE), (u16*)(BG_VRAM + 0xF3AE)},
+};
+
+static const struct PartyMenuWindowCoords gUnknown_08376948[2][6] = {
+ {{2, 4, 10, 9}, {16, 1, 29, 3}, {16, 4, 29, 6}, {16, 7, 29, 9}, {16, 10, 29, 12}, {16, 13, 29, 15}},
+ {{2, 2, 10, 7}, { 2, 9, 10, 14}, {16, 1, 29, 3}, {16, 5, 29, 7}, {16, 9, 29, 11}, {16, 13, 29, 15}},
+};
+
+static const struct PartyMenuWindowCoords gUnknown_08376978[2][6] = {
+ {{2, 7, 10, 9}, {21, 1, 29, 3}, {21, 4, 29, 6}, {21, 7, 29, 9}, {21, 10, 29, 12}, {21, 13, 29, 15}},
+ {{2, 2, 10, 7}, { 2, 9, 10, 14}, {16, 1, 29, 3}, {16, 5, 29, 7}, {16, 9, 29, 11}, {16, 13, 29, 15}},
+};
+
+// This is actually a 2x6x2 array, but the code reads it as a flat array.
+static const u8 gUnknown_083769A8[] = {
+ 0, 3, 11, 1, 11, 4, 11, 7, 11, 10, 11, 13,
+ 0, 1, 0, 8, 11, 1, 11, 5, 11, 9, 11, 13, // Double battle
+};
+
+// This is actually a 2x6x2 array, but the code reads it as a flat array.
+static const u8 gUnknown_083769C0[] = {
+ 0, 1, 0, 8, 11, 2, 11, 5, 11, 9, 11, 12,
+ 0, 1, 0, 8, 11, 2, 11, 5, 11, 9, 11, 12, // Double battle
+};
+
+static const u8 gUnknown_083769D8[] = {
+ 0x24,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x25,0x27,
+ 0x34,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x37,
+ 0x34,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x37,
+ 0x34,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x37,
+ 0x44,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x47,
+ 0x44,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x47,
+ 0x54,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x57,
+};
+
+static const u8 gUnknown_08376A25[] = {
+ 0x50,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x51,0x53,
+ 0x60,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x63,
+ 0x70,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x71,0x73,
+};
+
+static const u8 gUnknown_08376A5E[] = {
+ 0x20,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x23,
+ 0x30,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x33,
+ 0x40,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x43,
+};
+
+static const u8 gUnusedData_08376A97[] = {
+ 0x0C,0x0D,0x0E,0x0F,0x00,0x01,0x02,0x03,0x04,0x05,0x0F,
+ 0x10,0x11,0x12,0x13,0x14,0x15,0x0F,0x06,0x05,0x01,0x07,
+ 0x08,0x09,0x0F,0x16,0x15,0x11,0x17,0x18,0x19,0x0F,0x09,
+ 0x0A,0x0B,0x05,0x0C,0x0F,0x0F,0x19,0x1A,0x1B,0x15,0x1C,
+ 0x0F,0x0F,0x0D,0x0B,0x05,0x0C,0x0F,0x0F,0x0F,0x1D,0x1B,
+ 0x15,0x1C,0x0F,0x0F,0x0F,0x06,0x05,0x0B,0x05,0x0C,0x0F,
+ 0x0F,0x16,0x15,0x1B,0x15,0x1C,0x0F,0x0F,0x0F,0x0F,0x20,
+ 0x0C,0x09,0x0F,0x0F,0x0F,0x1F,0x30,0x1C,0x19,0x0F,0x0F,
+ 0x0F,0x25,0x0F,0x22,0x24,0x0F,0x0F,0x0F,0x35,0x41,0x32,
+ 0x34,0x0F,0x0F,0x0F,0x26,0x0F,0x23,0x0E,0x0F,0x0F,0x0F,
+ 0x36,0x43,0x33,0x1E,0x0F,0x0F,0x27,0x28,0x29,0x03,0x2A,
+ 0x0F,0x0F,0x37,0x38,0x39,0x13,0x3A,0x0F,0x0F,0x27,0x28,
+ 0x29,0x03,0x04,0x05,0x0F,0x37,0x38,0x39,0x13,0x14,0x15,
+ 0x0F,0x2B,0x2C,0x02,0x28,0x29,0x2D,0x21,0x3B,0x3C,0x12,
+ 0x38,0x39,0x3D,0x31,0x2B,0x2C,0x02,0x28,0x29,0x08,0x09,
+ 0x3B,0x3C,0x12,0x38,0x39,0x18,0x19,0x2E,0x2F,0x2B,0x2C,
+ 0x02,0x27,0x2D,0x3E,0x3F,0x3B,0x3C,0x12,0x45,0x3D,
+};
+
+static const TaskFunc gUnknown_08376B54[] = {
+ ItemUseMoveMenu_HandleMoveSelection,
+ ItemUseMoveMenu_HandleCancel,
+};
+
+static const u16 Unknown_08376B5C[] = {
+ 0x4000, 0x4018, 0xF400,
+ 0x4000, 0x4038, 0xF404,
+ 0x4008, 0x4018, 0xF408,
+ 0x4008, 0x4038, 0xF40C,
+ 0x4010, 0x4020, 0xF410,
+ 0x4020, 0x4025, 0xF418,
+ 0x4020, 0x4045, 0xF41C,
+ 0xFFFF,
+};
+
+static const u16 Unknown_08376B88[] = {
+ 0x4000, 0x4018, 0xF400,
+ 0x4000, 0x4038, 0xF404,
+ 0x4008, 0x4018, 0xF408,
+ 0x4008, 0x4038, 0xF40C,
+ 0x4010, 0x4020, 0xF410,
+ 0x4010, 0x4065, 0xF418,
+ 0x4010, 0x4085, 0xF41C,
+ 0xFFFF,
+};
+
+static struct UnknownStruct5 const gUnknown_08376BB4[4][6] = {
+ {
+ { 1, 4, Unknown_08376B5C},
+ {12, 1, Unknown_08376B88},
+ {12, 4, Unknown_08376B88},
+ {12, 7, Unknown_08376B88},
+ {12, 10, Unknown_08376B88},
+ {12, 13, Unknown_08376B88},
+ },
+ {
+ { 1, 2, Unknown_08376B5C},
+ { 1, 9, Unknown_08376B5C},
+ {12, 1, Unknown_08376B88},
+ {12, 5, Unknown_08376B88},
+ {12, 9, Unknown_08376B88},
+ {12, 13, Unknown_08376B88},
+ },
+ {
+ { 1, 2, Unknown_08376B5C},
+ { 1, 9, Unknown_08376B5C},
+ {12, 2, Unknown_08376B88},
+ {12, 5, Unknown_08376B88},
+ {12, 9, Unknown_08376B88},
+ {12, 12, Unknown_08376B88},
+ },
+ {
+ { 1, 2, Unknown_08376B5C},
+ {12, 2, Unknown_08376B88},
+ {12, 5, Unknown_08376B88},
+ { 1, 9, Unknown_08376B5C},
+ {12, 9, Unknown_08376B88},
+ {12, 12, Unknown_08376B88},
+ },
+};
+
+static const struct PartyMenuFunctionsStruct gUnknown_08376C74[] = {
+ {sub_8089CD4, sub_806AFD0, 0},
+ {SetUpBattlePokemonMenu, SetUpBattlePartyMenu, 0},
+ {sub_80F9C6C, sub_80F9ACC, 0},
+ {sub_80F9C6C, sub_806AFD0, 0},
+ {sub_81222B0, sub_8121E78, 0},
+ {sub_8122A48, sub_8122854, 0xFF},
+ {sub_8122E0C, sub_806AFD0, 0x0F},
+ {sub_80F9E64, sub_80F9CE8, 0},
+};
+
+static const u16 gUnknown_08376CD4[] = {
+ 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
+ 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
+};
+
+static const u16 gUnknown_08376CEC[] = {
+ 0x2A, 0x0B, 0x0C, 0x0D, 0x0E, 0x2F,
+ 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
+};
+
+static const u8 *const StatNames[] = {
+ gOtherText_HP,
+ gOtherText_Attack,
+ gOtherText_Defense,
+ gOtherText_SpAtk,
+ gOtherText_SpDef,
+ gOtherText_Speed,
+};
+
+static const u8 StatDataTypes[] = {
+ MON_DATA_MAX_HP,
+ MON_DATA_ATK,
+ MON_DATA_DEF,
+ MON_DATA_SPATK,
+ MON_DATA_SPDEF,
+ MON_DATA_SPD,
+};
+
struct Unk201C000
{
/*0x00*/ struct Pokemon *pokemon;
@@ -51,27 +466,6 @@ struct Unk201F000
u8 unkE00[3]; // not sure if this is an array or struct, or how big it is
};
-struct UnknownStruct5
-{
- u8 unk0;
- u8 unk1;
- u16 *unk4;
-};
-
-struct Coords8
-{
- u8 x;
- u8 y;
-};
-
-struct PartyMenuWindowCoords
-{
- u8 left;
- u8 top;
- u8 right;
- u8 bottom;
-};
-
struct UnknownPokemonStruct2
{
/*0x00*/ u16 species;
@@ -86,18 +480,11 @@ struct UnknownPokemonStruct2
/*0x1D*/ u8 language;
};
-struct PartyMenuFunctionsStruct
-{
- /*0x0*/TaskFunc func1;
- /*0x4*/TaskFunc func2;
- /*0x8*/u8 unk8;
-};
-
#define ewram1C000 (*(struct Unk201C000 *)(ewram + 0x1C000))
#define ewram1F000 (*(struct Unk201F000 *)(ewram + 0x1F000))
extern u16 gBattleTypeFlags;
-
+extern u8 gTileBuffer[];
extern u8 gUnknown_0202E8F4;
extern u8 gUnknown_0202E8F6;
extern u16 gUnknown_0202E8F8;
@@ -107,35 +494,10 @@ extern u8 gPlayerPartyCount;
extern s32 gBattleMoveDamage;
extern u16 gMoveToLearn;
-extern struct PartyMenuFunctionsStruct const gUnknown_08376C74[];
-extern u8 gUnknown_083769D8[];
-extern u8 gUnknown_08376A25[];
-extern u8 gUnknown_08376A5E[];
extern u16 gUnknown_08E9A300[];
-extern const u16 gUnknown_08376CD4[];
-extern const u16 gUnknown_08376CEC[];
-extern u16 *const gUnknown_08376918[2][PARTY_SIZE];
extern struct Coords8 const gUnknown_08376738[12][6];
-extern struct Coords8 const gUnknown_08376678[12][6];
-extern struct PartyMenuWindowCoords const gUnknown_08376948[2][6];
-extern struct PartyMenuWindowCoords const gUnknown_08376978[2][6];
-extern struct Coords8 const gUnknown_083768B8[3][8];
-extern u8 *const gUnknown_08376624[];
extern const u8 gUnknown_083769C0[];
-//extern const u16 gUnknown_083769A8[][6];
-//extern const u8 gUnknown_083769A8[][12];
-extern u16 *const gUnknown_08376858[][6];
-extern const u8 gUnknown_083769A8[];
-extern const u8 gUnknown_08376D1C[NUM_STATS];
-extern const u16 gUnknown_08376504[];
-extern const struct SpriteSheet gUnknown_083765DC;
-extern const struct SpritePalette gUnknown_083765E4;
-extern void (*const gUnknown_08376B54[])(u8);
-extern const u8 *const gUnknown_08376D04[NUM_STATS];
-extern const struct UnknownStruct5 gUnknown_08376BB4[][6];
extern u8 gUnknown_02039460[];
-extern u8 gTileBuffer[];
-extern const struct SpriteTemplate gSpriteTemplate_837660C[];
extern struct Window gUnknown_03004210;
extern const u8 gPartyMenuMisc_Gfx[];
@@ -147,32 +509,6 @@ extern const u8 gPartyMenuOrderText_Gfx[];
extern const u8 gStatusGfx_Icons[];
extern const u8 gStatusPal_Icons[];
-static void nullsub_12(u8 monIndex, struct Pokemon *pokemon);
-static void TryPrintPartyMenuMonNickname(u8 monIndex, struct Pokemon *pokemon);
-static void PartyMenuTryPrintHP(u8 monIndex, struct Pokemon *pokemon);
-static void sub_806D05C(u8 taskId);
-static void sub_806D15C(u8 taskId);
-static void sub_806D198(u8 taskId);
-static void sub_806E884(u8 taskId);
-static void sub_8070D90(u8 taskId);
-static void sub_806D5B8(u8 taskId);
-static void sub_806D014(u8 taskId);
-static void sub_806D118(u8 taskId);
-static void sub_806B460(void);
-static void sub_806B548(void);
-static void sub_806BA94(s16 a, u16 b, u8 c, u8 d);
-static void sub_806B9A4(s16 a, u16 b, u8 c);
-static void sub_806CA18(u8 taskId, u8 b);
-static void sub_806C310(u8 spriteId, u8 menuIndex, s8 directionPressed);
-static void sub_806C1E4(u8 spriteId, u8 menuIndex, s8 directionPressed);
-static void sub_806C490(u8 spriteId, u8 menuIndex, s8 directionPressed);
-static void UpdateMonIconFrame_806DA0C(struct Sprite *sprite);
-static void UpdateMonIconFrame_806DA38(struct Sprite *sprite);
-static void UpdateMonIconFrame_806DA44(u8 taskId, u8 monIndex, u8 c);
-static u8 sub_806CA00(u8 taskId);
-static void SpriteCB_sub_806D37C(struct Sprite *sprite);
-static u8 GetMonIconSpriteId_maybe(u8 taskId, u8 monIndex);
-
#if ENGLISH
#define WINDOW_LEFT (3)
#define WINDOW_RIGHT (26)
@@ -1514,7 +1850,7 @@ void sub_806BA34(s16 a, u16 b)
void sub_806BA94(s16 a, u16 b, u8 c, u8 d)
{
u8 i;
- u8 *arr;
+ const u8 *arr;
u16 var1;
arr = gUnknown_08376A5E;
@@ -1573,7 +1909,7 @@ void sub_806BB9C(u8 a)
u16 *vramPtr;
const u16 arr[12];
- memcpy(&arr, gUnknown_08376CD4, 12 * 2);
+ memcpy(&arr, gUnknown_08376CD4, sizeof gUnknown_08376CD4);
vramPtr = (u16 *)(BG_VRAM + 0x3C30);
for (i = 0; i < PARTY_SIZE; i++)
@@ -1589,7 +1925,7 @@ void sub_806BBEC(u8 a)
u16 *vramPtr;
const u16 arr[12];
- memcpy(&arr, gUnknown_08376CEC, 12 * 2);
+ memcpy(&arr, gUnknown_08376CEC, sizeof gUnknown_08376CEC);
vramPtr = (u16 *)(BG_VRAM + 0x3CB0);
for (i = 0; i < PARTY_SIZE; i++)
@@ -3413,7 +3749,7 @@ void CreateHeldItemIcon(u8 a, u8 b)
u8 spriteId;
subPriority = gSprites[a].subpriority;
- spriteId = CreateSprite(gSpriteTemplate_837660C, 0xFA, 0xAA, subPriority - 1);
+ spriteId = CreateSprite(&gSpriteTemplate_837660C, 0xFA, 0xAA, subPriority - 1);
gSprites[spriteId].pos2.x = 4;
gSprites[spriteId].pos2.y = 10;
@@ -3471,7 +3807,7 @@ void CreateHeldItemIcons_806DC34(u8 taskId)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES))
{
monIconSpriteId = GetMonIconSpriteId_maybe(taskId, i);
- heldItemSpriteId = CreateSprite(gSpriteTemplate_837660C, 0xFA, 0xAA, 4);
+ heldItemSpriteId = CreateSprite(&gSpriteTemplate_837660C, 0xFA, 0xAA, 4);
gSprites[heldItemSpriteId].pos2.x = 4;
gSprites[heldItemSpriteId].pos2.y = 10;
@@ -4555,9 +4891,8 @@ void Task_ConfirmTakeHeldMail(u8 taskId)
u16 ItemIdToBattleMoveId(u16 item)
{
- u16 moveId = item - 289;
-
- return gUnknown_08376504[moveId];
+ u16 machineNumber = item - ITEM_TM01;
+ return TMHMMoves[machineNumber];
}
bool8 pokemon_has_move(struct Pokemon *pkmn, u16 move)
@@ -4812,11 +5147,12 @@ bool8 IsHMMove(u16 move)
{
u8 i;
- for (i = 0; i < 8; i++)
+ for (i = 0; i < NUM_HIDDEN_MACHINES; i++)
{
- if (gUnknown_08376504[50 + i] == move)
+ if (TMHMMoves[NUM_TECHNICAL_MACHINES + i] == move)
return TRUE;
}
+
return FALSE;
}
@@ -5334,7 +5670,7 @@ void DoRareCandyItemEffect(u8 taskId, u16 b, TaskFunc c)
if (GetMonData(ewram1C000.pokemon, MON_DATA_LEVEL) != 100)
{
for (i = 0; i < 6; i++)
- ewram1B000.statGrowths[i] = GetMonData(ewram1C000.pokemon, gUnknown_08376D1C[i]);
+ ewram1B000.statGrowths[i] = GetMonData(ewram1C000.pokemon, StatDataTypes[i]);
r0 = ExecuteTableBasedItemEffect__(ewram1C000.unk5, b, 0);
}
else
@@ -5400,7 +5736,7 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId)
u8 y;
u32 stat;
- stat = GetMonData(ewram1C000.pokemon, gUnknown_08376D1C[i]);
+ stat = GetMonData(ewram1C000.pokemon, StatDataTypes[i]);
ewram1B000.statGrowths[i + NUM_STATS] = stat;
ewram1B000.statGrowths[i] = stat - ewram1B000.statGrowths[i];
@@ -5408,7 +5744,7 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId)
x = (i / 3) * 9 + 11;
y = ((i % 3) << 1) + 1;
- MenuPrint_PixelCoords(gUnknown_08376D04[i], (x + 1) * 8, y * 8, 1);
+ MenuPrint_PixelCoords(StatNames[i], (x + 1) * 8, y * 8, 1);
if (i == 2)
MenuPrint_PixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 0);
@@ -5448,7 +5784,7 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId) {
_0807086C:\n\
ldr r1, _08070930 @ =0x0201c000\n\
ldr r0, [r1]\n\
- ldr r1, _08070934 @ =gUnknown_08376D1C\n\
+ ldr r1, _08070934 @ =StatDataTypes\n\
adds r1, r7, r1\n\
ldrb r1, [r1]\n\
bl GetMonData\n\
@@ -5480,7 +5816,7 @@ _0807086C:\n\
adds r5, 0x1\n\
lsls r5, 24\n\
lsrs r5, 24\n\
- ldr r1, _0807093C @ =gUnknown_08376D04\n\
+ ldr r1, _0807093C @ =StatNames\n\
lsls r0, r7, 2\n\
adds r0, r1\n\
ldr r1, [r0]\n\
@@ -5537,9 +5873,9 @@ _0807086C:\n\
.align 2, 0\n\
_0807092C: .4byte gStringVar1\n\
_08070930: .4byte 0x0201c000\n\
-_08070934: .4byte gUnknown_08376D1C\n\
+_08070934: .4byte StatDataTypes\n\
_08070938: .4byte 0x0201b264\n\
-_0807093C: .4byte gUnknown_08376D04\n\
+_0807093C: .4byte StatNames\n\
_08070940: .4byte gOtherText_TallPlusAndRightArrow\n\
.syntax divided\n");
}
@@ -5556,7 +5892,7 @@ void PrintNewStatsInLevelUpWindow(u8 taskId)
u32 stat;
u32 newStatIndex;
- stat = GetMonData(ewram1C000.pokemon, gUnknown_08376D1C[i]);
+ stat = GetMonData(ewram1C000.pokemon, StatDataTypes[i]);
newStatIndex = i + 6;
ewram1B000.statGrowths[newStatIndex] = stat;